Code covered by the BSD License  

Highlights from
Benchmarking Sudoku Solvers

5.0

5.0 | 3 ratings Rate this file 4 Downloads (last 30 days) File Size: 555 KB File ID: #18921

Benchmarking Sudoku Solvers

by Yi Cao

 

25 Feb 2008 (Updated 27 Feb 2008)

Benchmarking various sudoku solvers

| Watch this File

File Information
Description

There are more than 20 Sudoku solvers submitted in File Exchange. This package provides a benchmark for various MATLAB sudoku solvers. The benchmarking is done by comparing performance (correctness and computation time) against the benchmarking solver, YASS (Yet Another Sudoku Solver, extracted from the author's GUI solver, superSudoku V2).

The package also includes a Sudoku library, which contains more than 30,000 different level puzzles. Most of them have the minimum number of grids initially occupied.

Acknowledgements

Super Sudoku V2 inspired this file.

MATLAB release MATLAB 7.5 (R2007b)
Tags for This File  
Everyone's Tags
benchmark, games, solvers, sudoku
Tags I've Applied
Add New Tags Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (5)
05 Apr 2009 V. Poor  
26 Feb 2008 Yi Cao

Per-Anders

Great! I just downloaded your code and tested as you mentioned. On my machine, dlxsolver is about 10 times faster than yass. I am going to learn the code before I can say more.

26 Feb 2008 Per-Anders Ekström

Now your benchmark code works for me.
Since I prefer representing a sudoku board as a vector instead of a matrix I have to reshape input and output arguments to my sudoku solver function.
From a random run of your benchmark code with my solver code (File Exchange ID 14073):
>> perf=sudukubench(@(board)reshape(dlxsolver(board(:),1),9,9));
for L=1:3
fprintf('Level %i\n error: %g\n computation time %g times more than YASS.\n',L,perf{L}.error,perf{L}.time)
end
Level 1
error: 0
computation time 0.0473684 times more than YASS.
Level 2
error: 0
computation time 0.0785124 times more than YASS.
Level 3
error: 0
computation time 0.057047 times more than YASS.

You need to cut out the function 'dlxsolver' and save it in a function file called dlxsolver.m to make it work.

26 Feb 2008 Yi Cao

Sorry about this. The missing function has been added together with an HTML description file. You should be able to download the update in next day or so.

26 Feb 2008 Per-Anders Ekström

I could not make your code work. It seems there are some functions missing.

>> tic,perf=sudukubench(@yass);toc
??? Undefined function or method 'crosscheck' for input arguments of type 'double'.

Error in ==> yass>findone at 177
C=crosscheck(C,~B,I,J,K);

Error in ==> yass>nonrecsolver at 113
[B,C,err]=findone(B,C,I,J,K);

Error in ==> yass at 92
[B,C,err,level]=nonrecsolver(B,C,I,J,K);

Error in ==> sudukubench at 86
B1=yass(A);

Couldn't find the function 'choosenk' either...

Updates
26 Feb 2008

add missing function and html descriptions

27 Feb 2008

add dlxsolver benchmarking example

27 Feb 2008

update description

Contact us