On my machine, running PG26885 takes
ZSolve 0.389 secs
JSolve 0.652 secs.
That is checking for two solutions (the default).
JSolve 6.077 seconds
Zsolver 4.054 seconds (Jason's source)
fsss2 3.261 seconds
Zh64 3.075 seconds (Champagne's modification of Zsolver)
rjamil wrote:Is it true that speed depends on algorithms/techniques?
Which combination/order of techniques are required to solve Sudoku puzzle faster than other programs?
R. Jamil
champagne wrote:AFAIK, none of these programs use more than singles + guesses except for the zhou process using the property of a digit locked in a mini row / mini column.
choosing the best guess (again, how much do you pay to optimize the guess) is another key parameter
JasonLion wrote:All of the fastest programs use naked/hidden singles, locked candidates, and guessing with backtracking, or a sub-set of those. Beyond that, most of them also provide for various non-obvious optimizations, things like optimizing the cells used for guessing so that each guess eliminates as many potential solutions as possible, choosing to do either hidden or naked singles first, deciding to either abort the search or continue looking after discovering the first locked candidate, and on and on.
However, as champagne already pointed out, that only gets you part of the way. The choice of data structures, and the implications those structures have on how much work you can get done per machine instruction makes a huge difference. For example, the Zhou code only does row/block locked candidates and skips column/block locked candidates because column/block makes less progress towards a solution per machine instruction (given the data structures used) and so would slow down the overall process.
JasonLion wrote:I put together a small archive with the next to last version of zhouyundong_2012's solver, converted over to standard C code and repackaged with a standard interface that makes calling form other software very easy.
http://forum.enjoysudoku.com/software/ZSolver1.0.zip
Zhouyundong_2012's solver is amazingly fast, better than JSolve and other state of the art brute force solvers across a variety of puzzle types.
dobrichev wrote:Happy New Year!
It would be great if Zhouyundong_2012, JasonLion and Champagne collaborate and produce clear code (like Jason's ZSolver1.0.zip) that includes Champagne's improvements for earlier contradiction identification.
My observations on Champagne's mod suggested that there is small or no benefit from 64-bit data structures and the solver can be kept portable and 32-bit compatible.
Champagne's mod shows 25% improvement over a set of valid puzzles, see the above posts. Estimation for set of random mixture of valid and invalid puzzles is ~35% improvement over Jason's ZSolver1.0.zip.
JasonLion wrote:The latest versions of fss2 require a modern x86 processor, and are incompatible with ARM CPUs. This has dampened my interest in the recent updates of fss as nearly everything I do is for ARM CPUs.
Wow Serg, I think that is a bit out of date!!!!Serg wrote:OS: Microsoft Windows XP Professional version 2002 SP3 (Is it 64-bit? I don't know.)
MinGW (I use "gcc" compiler, but again don't know is it 64-bit).