Download presentation
Presentation is loading. Please wait.
Published byRolf Crawford Modified over 8 years ago
1
SUDOKO PROBLEM: Modeled as an ILP* Daryl L. Santos, Ph.D. Professor – Systems Science and Industrial Engineering Thomas J. Watson School of Engineering and Applied Science Vice Provost for Diversity and Inclusiveness Binghamton University – State University of New York KAIST ISE Visiting Professor – Summer 2006 and 2007 GUEST LECTURE FOR KAIST ISE – APRIL 14, 2014 *From “Teaching Integer Programming via Sudoko and Other Math Puzzles”, D.L. Santos, proceedings of IERC Conference, Nashville, TN, 2007.
2
“Sudoku” Puzzle -Each 3x3 grid (“block”) contains 1-9 (no repeats) -Each row contains 1-9 (no repeats) -Each column contains 1-9 (no repeats) Block 1 Block 2 Block 3 Block 4 Block 5 Block 6 Block 7 Block 8 Block 9
3
“Sudoku” Puzzle (Example Solved) -Each 3x3 block contains 1-9 (no repeats) -Each row contains 1-9 (no repeats) -Each column contains 1-9 (no repeats)
4
3 Features of all LP/ILP Models 1.Definition of alternatives (decision variables) 2.Definition of constraints (equalities/inequalities) 3.Definition of the objective function (what we will optimize)
5
“Sudoku” Puzzle – a solution method using ILP 1.Decision Variables: should be obvious that we are trying to decide the values of the cells. 2.Constraints: these are give to the player/decision- maker. Each row, column, and block must contain integers (1-9) with no repeats in them. 3.Objective function: maybe the trickiest part (but simple). If all constraints are satisfied, the game is solved. WE CAN HAVE ANY OBJECTIVE FUNCTION WE WANT.
6
i j
10
Consider “Block 6” and lowest Row and Column numbers… Block 6 j =7 = low “j” for Block 6 i =4 = low “i” for Block 6
15
Example’s Constraint Set 5 x117 = 1 x152 = 1 x194 = 1 x212 = 1 x226 = 1 x289 = 1 x293 = 1 x349 = 1 x365 = 1 x428 = 1 x457 = 1 x486 = 1 x491 = 1 x536 = 1 x573 = 1 x613 = 1 x622 = 1 x659 = 1 x685 = 1 x741 = 1 x762 = 1 x811 = 1 x829 = 1 x887 = 1 x895 = 1 x918 = 1 x953 = 1 x996 = 1
16
Solution of Example Example was input into LINDO© and only non- zero values was asked for output
17
Solution of Example See PDF file….
18
To conclude… When I model puzzles like this and others, it helps me to learn and appreciate the power of OR techniques.
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.