Logic-based Sudoku solver cuts search nodes by 14,000x over basic backtracking
A developer benchmarked three Sudoku-solving strategies against the same engine and 40 identical puzzles to measure how much searching each approach requires. The naive backtracking method used in their shipped puzzle game averaged 28,835 search nodes per puzzle, while a most-constrained-variable (MRV) heuristic reduced that to 177. A logic-based constraint propagation solver went further, averaging just 2 nodes overall and only 3 even on Expert-difficulty puzzles. On Expert puzzles alone, the logic solver required roughly 34,000 times fewer search nodes than naive backtracking. The benchmark code is open source and fully deterministic, allowing anyone to reproduce the exact results by running a single command.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)
Log in to join the discussion and vote.
Log in