You are searching about 1 1 2 1 3 1 N Sum Formula, today we will share with you article about 1 1 2 1 3 1 N Sum Formula was compiled and edited by our team from many sources on the internet. Hope this article on the topic 1 1 2 1 3 1 N Sum Formula is useful to you.

Solving the Sudoku Using Integer Programming

A 9 X9 SUDOKU puzzle has the following rules. Each row and column must contain numbers between 1 and 9 and each of the inner boxes must contain numbers between 1 and 9. Each number in each column and row and in each small box must occur only once.

Let’s just define Xijk for all values ​​of I, j and k from 1 to 9 to be 1. If cell (I,j) contains the number k such that i, j and k are all between 1 and It’s 9 o’clock. Here I denote row j and j column j and k represents a number between 1 and 9. When X134 = 1, it means that cell (1,3) contains the number 4. This means that any other element in Row 1 or Column 3 except cell (1,3) can be 4.

For the SUDOKU model we will use a total of 729 variables.

Let us now formulate all three classes of rules algebraically.

Each line between 1 and 9 must exist exactly once.

For the first line, this rule will look like (called “Prohibition” in Integer Programming language).

for each I from 1 to 9 and for each k from 1 to 9 (I is the mathematical representation of a numerical variable)

sum (Xijk) for all j from 1 to 9 = 1;

For the 1st row, every number between 1 and 9 is written orally

X111 + X121 + X131 + X141 + X151 + X161 + X171 + X181 + X191 = 1.

X112 + X122 + X132 + X142 + X152 + X162 + X172 + X182 + X192 = 1.

X113 + X123 + X133 + X143 + X153 + X163 + X173 + X183 + X193 = 1.

X114 + X124 + X134 + X144 + X154 + X164 + X174 + X184 + X194 = 1.

These equations follow for variables starting with X115 through X119.

Similarly, let’s formulate equations for the rules of any number between 1 and 9 that occurs only once in each of the 9 columns.

Written in mathematical notation,

sum of X for each j from 1 to 9 (for all I and k between 1 and 9) = 1

For each number between 1 and 9, it is written orally for several columns

Column 1

X111 + X211 + X311 + X411 + X511 + X611 + X711 + X811 + X911 = 1.

X112 + X212 + X312 + X412 + X512 + X612 + X712 + X812 + X912 = 1.

X113 + X213 + X313 + X413 + X513 + X613 + X713 + X813 + X913 = 1.

This must be filled in for all other numbers 4 to 9.

Column 2

X121 + X221 + X321 + X421 + X521 + X621 + X721 + X821 + X921 = 1.

X122 + X222 + X322 + X422 + X522 + X622 + X722 + X822 + X922 = 1.

X123 + X223 + X323 + X423 + X523 + X623 + X723 + X823 + X923 = 1.

This must be filled in for all other numbers from 4 to 9.

Now let’s represent small boxes (3 x 3) with a total of 9 squares.

So in every 3 x 3 frame, there should be only one 1 or 2 or 3 or 4 or 5 or 6 or 7 or 8 or 9 etc.

The cells are located between Columns (1 to 3) and Rows (1 to 3), Columns (4 to 6) and Rows (1 to 3), Columns (7 to 9) and Rows (1 to 3). Also, for the same group of columns, they are located in rows (4 to 6) and (6 to 9). So let’s formulate the equations for just a small rectangle between the columns (1 to 3) and the rows (1 to 3). The relevant decision variables are for the digit “1” (total of 9)

X111, X121, X131, X211, X221, X231, X311, X321, X331.

Let’s formulate the equation where this (3 x3) square contains only one “1”.

So it’s an equation

X111 + X121+ X131 + X211 +X221+ X231+ X311 + X321 + X331 = 1.

The above equation means that only one of these 9 variables or only one of these nine cells can take the value 1.

Similarly, limits should be formulated for number “2”, number “3” and so on up to 9.

For singular programming problems, in addition to the equations defining the constraints, there must also be singular constraints on each variable, so that when the system of equations is finally solved, one gets either 0 or 1 as the solution for the variable Xijk. .

The geometric equation of a linear programming problem with an objective function and some constraints is nothing but a dimensional polyhedron where n represents the number of constraints in the problem. Usually the optimum solution will be found on the vertices of the polytope, however the rules of some methods such as SIMPLEX will require the polytope to be rotated to traverse the edges from vertex to vertex and find the optimal solution.

Imposing too many numerical constraints will mean that the optimal solution will not lie on the points of the polytope because a solution found on a vertex may not be an integer. So after calculating that the optimal solution must be 0 or 1, it will mean that geometrically the solution will lie somewhere inside the feasible region of the transition polytope and on one of the many straight lines that from the corresponding hyperplane of Xi jk to be the number. values.

Note that the solution above used 729 decision variables and 81 order constraints. 81 column obstacles and 729 small square obstacles for a total of 901 obstacles. There may be many objective functions, but one can formulate an objective function as providing the quantity (the sum of all 729 variables). One can reduce the number of obstacles by finding some redundancy.

These equations above cannot be solved using programming languages ​​such as Visual Basic, Pascal or C. Numerical programming problems can be solved using optimization software like CPLEX optimizer, Excel add-in for solving Linear Programming problems, Lingo etc.

Video about 1 1 2 1 3 1 N Sum Formula

You can see more content about 1 1 2 1 3 1 N Sum Formula on our youtube channel: Click Here

Question about 1 1 2 1 3 1 N Sum Formula

If you have any questions about 1 1 2 1 3 1 N Sum Formula, please let us know, all your questions or suggestions will help us improve in the following articles!

The article 1 1 2 1 3 1 N Sum Formula was compiled by me and my team from many sources. If you find the article 1 1 2 1 3 1 N Sum Formula helpful to you, please support the team Like or Share!

Rate Articles 1 1 2 1 3 1 N Sum Formula

Rate: 4-5 stars
Ratings: 1605
Views: 14198812

Search keywords 1 1 2 1 3 1 N Sum Formula

1 1 2 1 3 1 N Sum Formula
way 1 1 2 1 3 1 N Sum Formula
tutorial 1 1 2 1 3 1 N Sum Formula
1 1 2 1 3 1 N Sum Formula free
#Solving #Sudoku #Integer #Programming

Source: https://ezinearticles.com/?Solving-the-Sudoku-Using-Integer-Programming&id=9107720

Có thể bạn quan tâm: