{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

sudoku - Sudoku Hernn Abeledo a The George Washington...

Info iconThis preview shows pages 1–5. Sign up to view the full content.

View Full Document Right Arrow Icon
Sudoku Hern´ an Abeledo The George Washington University Abeledo (GWU) Sudoku 1 / 7
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
The Problem Given the digits in this Sudoku puzzle, assign a digit to empty boxes in such a way that 1 No digit shows twice on a row. 2 No digit shows twice on a column. 3 No digit shows twice in each 3x3 subsquare. Formulate this as a binary integer program. Abeledo (GWU) Sudoku 2 / 7
Background image of page 2
Decision Variables Let DIGITS = { 1 , 2 , . . . , 9 } be the set of digits, ROWS = { 1 , 2 , . . . , 9 } be the set of rows, and COLS = { 1 , 2 , . . . , 9 } be the set of columns. SUBSQRS = { 1 , 2 , . . . , 9 } be the set of 3x3 subsquares. Define binary decision variables X d r , c = ( 1 if digit d is to occupy cell in row r and column c 0 otherwise. Since we are provided initial contents for some cells, we need to constraint the assignments on those cells. Suppose we are given for each row r , column c , the data DATA ( r , c ) = ( d if digit d is occupying row r and column c , 0 otherwise. Abeledo (GWU) Sudoku 3 / 7
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Constraints Each digit appears once, and only once in every row, column, and subsquare X c COLS X d r , c =
Background image of page 4
Image of page 5
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}