Hi all.
The Sudoku is a game that can be solved by Mathematical Programming.
You can easily solve any Sudoku through a Linear Programming model
with the use of Binary variables.
I developed a program that generates a linear programming model to
solve any Sudoku for two of the most important software dedicated to solving
linear programming models: LINGO and MPL/CPLEX.
1) Generate the model for a given Sudoku specified by the user with my program.
2) Copy the generated linear programming model by my program to the clipboard.
3) Run LINGO or MPL: creates a new file, paste the clipboard,and runs the option solve the model.
4) In the report of LINGO or MPL that shows the solution of the model,
the only variables of importance to the user are RiCj variables.
Where i (i = 1 ... 9) refer to rows and j (j = 1 ... 9) to the columns of Sudoku.
For example, if in the solution R4C1 = 8, in row 4 column 1 of Sudoku should
write the number 8, and so on for the 81 cells (9 rows * 9 columns).
I have attached some reports of LINGO to verify it.
See the file README.TXT
Greetings everyone,
Claudio Soto.
SUDOKU (MATHEMATICAL SOLUTION)
Moderator: Rathinagiri
- srvet_claudio
- Posts: 2193
- Joined: Thu Feb 25, 2010 8:43 pm
- Location: Uruguay
- Contact:
SUDOKU (MATHEMATICAL SOLUTION)
- Attachments
-
- PL_SUDOKU.rar
- (714.36 KiB) Downloaded 999 times
- Rathinagiri
- Posts: 5471
- Joined: Tue Jul 29, 2008 6:30 pm
- DBs Used: MariaDB, SQLite, SQLCipher and MySQL
- Location: Sivakasi, India
- Contact:
Re: SUDOKU (MATHEMATICAL SOLUTION)
Great Claudio Soto!
I like your code a lot.
I like your code a lot.
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
South or North HMG is worth.
...the possibilities are endless.
- srvet_claudio
- Posts: 2193
- Joined: Thu Feb 25, 2010 8:43 pm
- Location: Uruguay
- Contact:
Re: SUDOKU (MATHEMATICAL SOLUTION)
Thanks Rathinagiri and Esgici.
Best Regards,
Claudio Soto
Best Regards,
Claudio Soto