{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

sudoku

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

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

Sudoku Hern´ an Abeledo The George Washington University Abeledo (GWU) Sudoku 1 / 7

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

View Full Document
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
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

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

View Full Document
Constraints Each digit appears once, and only once in every row, column, and subsquare X c COLS X d r , c =
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}