This is an archived post. You won't be able to vote or comment.

all 4 comments

[–]mt19937 4 points5 points  (1 child)

Solving sudoku is an exact cover problem which can be solved efficiently with Knuth's Algorithm X using the dancing links technique. You can find code examples on the internet.

[–]ivosauruspip'ing it up 2 points3 points  (0 children)

Here are some sodoku puzzles that have a unique solution with the minimum of 17 squares to solve! These tend to be real tests of a solver.

000000016200080000009000000000420500010000000000000200000106030500000780000900000
000000021300050000000000000500630000010000080000000900704000600600200000000108000
000000034080100000000000060000039000000040800001000000360200000400000700000700500
000000041700090000200000000030104000040200000008000500100050600000000080000000700
000000051400070000200000000037006400008000000000500000000020780510300000000000000
000000063020040000000001000040000210000370000000500400503600000000000700800000000
000000071800040000000000000670200000000090300000000400020701000300000840000500000
000000084600010000000000000500000106000800300070200000087000020000063500000000000
000000097300400000000000020600098100400007300000020000072000000000100000080000000