This solver combines Wave Function Collapse (WFC) concepts with Constraint Satisfaction Problem (CSP) techniques. It is NOT simple backtracking - it uses domain-based state, queue-driven propagation, and entropy-guided decisions.
Domains - Each cell stores a set of possible values {1-9}, not just one number.
When a cell has only one possibility left, it "collapses" to that value.
Entropy - The number of possibilities a cell has. Lower entropy = more constrained.
We always pick the lowest entropy cell first (fail-fast strategy).
Propagation - When a cell collapses, we remove that value from all its peers
(same row, column, and 3x3 box). This may cause chain reactions of further collapses.
Deterministic First - Many cells solve themselves through propagation alone,
no guessing needed.
Minimal Speculation - We only guess when forced, and pick the cell with
fewest options to minimize wrong guesses.
Explicit State - Snapshots are stored on a stack, not hidden in recursion.
This makes backtracking transparent and bounded.
Iterations = Main loop cycles checking puzzle state
Backtracks = Times speculation failed and state was restored
Propagations = Constraint propagation steps (values removed from peer domains)