Sudoku Smarter
- After succeeding with the naive (or simple) Sudoku-solver method, it's
time to get smarter.
- There are more difficult sudoku boards where the naive method can take a
very long time.
- Here is a larger set of sudoku
boards, and here are my times and other stats for some of them -- level 1 is
a smarter algorithm than the naive method.
- I have included the solved versions of the boards in the file so that
you can confirm that your solution is valid.
- Note the times for the last board below-- that's about
4.5 minutes of elapsed (not CPU) time.
My machine dedicates about 25% of its CPU time to the python program.
- The goal is both to reduce the runtime, but also to reduce the number of
backtracks.
- Extra credit assignment: Create a smarter version of your sudoku
solver and report the elapsed time and number of backtracks for the last two
of the boards below. Upload your program to the homework server, and
in the Comments-to-Teacher give me the stats for both of those boards.
Identify the boards as "Nr-100" and "Nr-50".
Various Board smart-level results:
level 0: is naive solver
level 1: is trying to force as many cells as possibly of the rest of board after each guess
WebSudoku-Evil
level 0: 0.130 secs, bad-guesses: 2,220
level 1: 0.010 secs, bad-guesses: 0
hardest-sudoku-telegraph
level 0: 0.758 secs, bad-guesses: 16,476
level 1: 0.146 secs, bad-guesses: 483
sudokugarden.de/files/100sudoku2-en.pdf-Nr-100
level 0: 34.8 secs, bad-guesses: 670,960
level 1: 5.1 secs, bad-guesses: 37,750
sudokugarden.de/files/100sudoku2-en.pdf-Nr-50
level 0: 300.8 secs, bad-guesses: 5,695,416
level 1: 26.5 secs, bad-guesses: 175,995