|
|
| File Information |
| Description |
SUDOKU_LVL2 - A Sudoku Solver.
Usage : Sol=sudoku_lvl2(A)
Where A is a incomplete sudoku grid (9 x 9) represented as a 9 x 9 matrix of integers (0-9) with the empty cells being filled with zeros.
The algorithm presented here uses the following techniques.
(*) Filling a cell by candidate elimination
(*) Filling a cell by position exclusion for a given candidate
(*) Refining choices of candidates in a given cell by eliminating members
of locked pairs, locked triplets and so on..
(*) Filling the remaining cells by brute force method.
First 3 algorithms are of my own logic. The brute force algorithm is a big improvement over '8466'.
Note : Please note that the aim of this algorithm is to have the most comprehensive logic while trying to have a decent speed. Speed, though, is not the primary criterion. |
| Acknowledgements |
The author wishes to acknowledge the following in the creation of this submission:
MATLAB Sodoku Solver - Improved
|
| MATLAB release |
MATLAB 7.4 (R2007a)
|
|
Tags for This File
|
| Everyone's Tags |
|
| Tags I've Applied |
|
| Add New Tags |
Please login to tag files.
|
| Updates |
| 26 Sep 2008 |
Improved speed of subroutine brute_force by pre sorting length of candidates list. |
| 03 Oct 2008 |
Added a subroutine refine_again for further refining of candidate choices.
Changed Description slightly.
Modified algorithms to perform refinement only for unsolved sudokus (thus improve speed). |
| 06 Oct 2008 |
Did not know the reason...but the m file was missing. So, uploading it again. |
| 06 Oct 2008 |
Updated some code. |
|
Contact us at files@mathworks.com