Initialize: Each cell starts with candidates 1–N. All valid solutions for each cage are enumerated. Single-cell cages are fixed immediately.
Propagation loop (repeats until no progress):
- Eliminate solved values: When a cell is solved, remove its value from all other candidates in the same row and column. If any cell drops to one candidate, it is solved (sole candidate).
- Hidden single: If a value appears as a candidate in only one cell within a row or column, that cell must be that value.
- Cage remainder: If a cage has exactly one unsolved cell, compute its value from the target and operator. For − and ÷ cages, only fix if exactly one of the two possibilities is valid.
- Cage solution filter: Remove cage solutions that conflict with current cell candidates.
- Cage candidate elimination: For each cell in a cage, remove any candidate that doesn't appear in any remaining cage solution.
- Cage line elimination: If a cage lies entirely in one row or column, values that appear in every remaining solution must be in the cage — eliminate them from other cells in that row/column.
If stuck: Wait for user to enter a value, then restart the loop.