[Haskell-cafe] Code Review: Sudoku solver

Chris Kuklewicz haskell at list.mightyreason.com
Fri Apr 14 15:40:29 EDT 2006

> I believe if you change the representation of puzzles from [(pos,range)]
> to an Array, you'll get a significant speedup
>>> yet because I only recently removed a logic bug that slowed down the
>>> search instead of speading it up; ..). so the more interesting bit is
>>> that our solvers disagree on which are the most difficult puzzles
>>> (requiring the largest number of guesses):
>>> df
>>> puzzles involving guesses: 5319
>> If that's not a typo, I'm baffled. My original needed to guess in 5309
> Rot! Typo in _my_ previous message, 5319 is correct.

After posting my cleaned up dancing links solver, I went back to my logical
solver.  I sent the 36628 line sudoku17 puzzle through it and it could solve
31322 of the puzzles, leaving 5306 resistant.  I haven't check my algorithms
against your code, but it does not seem like I do any spectacularly more clever.

I don't have any time to clean up my code, but I may try turning off some steps
to see if one of them gives my the same 5319 number you are seeing.

Chris Kuklewicz

More information about the Haskell-Cafe mailing list