Home

Awesome

Sudoku-Solver

Swift implementation of Peter Norvig's constraint based solver.

Benchmarks (master branch)

The original Python program has been compared with the Swift debug and release version.

The average time and the maximum time (in seconds) of solving a Sudoku grid will be measured. Also, the number of solutions per second is calculated from the average time, this shows a better resolution for very short solving times.

The release version of the Swift program is about seven times faster than the debugging version and the original Python program.

Easy Puzzles (easy50.txt)

PythonSwift (Debug)Swift (Release)
average0.010.00420.00066
maximum0.010.00600.00086
frequency2162361517

Hard Puzzles (top95.txt)

PythonSwift (Debug)Swift (Release)
average0.020.0150.0022
maximum0.080.0680.0115
frequency6168.6460

Hardest Puzzles (hardest.txt)

PythonSwift (Debug)Swift (Release)
average0.010.00570.00082
maximum0.010.00790.00109
frequency1671751227

Averaged Frequencies

PythonSwift (Debug)Swift (Release)
frequency111122822