Sudoku solvers (brute force vs. logic)

new topic     » topic index » view thread      » older message » newer message

Out of curiosity I compared the speed of the brute force sudoku solver by Harm
Veenstra (latest user contibution), to the logic solver that was included in the
sudoku game I contributed a couple of months ago.

When I wrote the logic solver, I reasoned it would be faster than a brute force
search, but I had nothing to compare it to until now:

Difficulty: easy (10000 iterations)

Solver:          brute force      logic solver
                (sudoku.ex)      (EuSudoku.exw)
Average time:    0.002482         0.001658


Difficulty: hard (1000 iterations)

Solver:         brute force       logic
               (sudoku.ex)       (EuSudoku.exw)
Average time:   0.059650          0.003690

The results vary somewhat whit different sudokus of the same difficulty level,
but clearly the logic solver's advantage increases when the sudokus get harder.

I do like the compactness of the brute force solver and it can also solve some
sudokus that my logic solver can't solve (yet).

Harm Veenstra, can I include your brute force solver as an optional solver in my
sudoku game (with proper credits off course)?

Regards,
Erik-Jan

new topic     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu