Objective
Identify valid candidates for open cells, provide a correct value for a selected square as a hint, or solve the complete puzzle on demand.
Applied Artificial Intelligence
An interactive browser edition of a graduate artificial intelligence project exploring constraint satisfaction, depth-first search, recursive backtracking, and candidate reasoning.
Identify valid candidates for open cells, provide a correct value for a selected square as a hint, or solve the complete puzzle on demand.
Constraint checking, AC-3 propagation, minimum-remaining-values selection, depth-first search, and recursive backtracking enforce Sudoku's row, column, and 3×3 sub-grid rules.
The original layered Python/Flask application separated UI, controller, constraint, search, and API responsibilities. This edition retains that separation in a static browser implementation.
Interactive Demo
Select a difficulty, enter values directly, inspect possible candidates, request a hint for the selected cell, or let the algorithm complete the puzzle.
Algorithmic Approach
A brute-force search can explore every candidate, but constraint checking makes the search practical by abandoning invalid paths as soon as they violate the puzzle rules. AC-3 propagation reduces candidate domains before and during search, while the minimum-remaining-values heuristic chooses the most constrained open cell first.
When a branch reaches a contradiction or dead end, recursive backtracking returns to the last valid decision point and explores an alternate value. The same search process is used to solve entered puzzles and to verify that generated puzzles have a unique solution.
Original Implementation