Skip to main content

Constraint Satisfaction

Build a Kakuro Solver and Generator in Python

Build a Kakuro Solver and Generator in Python

You write the obvious Kakuro solver first: try 1 through 9 in each empty cell, and back up whenever a sum goes wrong. The series 7x7 grid has 24 white cells. Trying every digit in every cell is 9²⁴ combinations, about 8 × 10²², and your laptop’s fan has opinions about that.

The fix isn’t …