Page 1 of 1

SUDOKU (MATHEMATICAL SOLUTION)

Posted: Sat May 01, 2010 2:41 pm
by srvet_claudio
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.

Re: SUDOKU (MATHEMATICAL SOLUTION)

Posted: Sat May 01, 2010 4:16 pm
by Rathinagiri
Great Claudio Soto!

I like your code a lot.

Re: SUDOKU (MATHEMATICAL SOLUTION)

Posted: Sat May 01, 2010 6:43 pm
by esgici
Thanks Dr. :)

Saludos

--

Esgici

Re: SUDOKU (MATHEMATICAL SOLUTION)

Posted: Sun May 02, 2010 12:31 pm
by srvet_claudio
Thanks Rathinagiri and Esgici.

Best Regards,
Claudio Soto