Line-solving fundamentals

The single move that resolves most easy nonograms — and a precise account of why it works, with the arithmetic that lets you read it off any line.

Published 3 min read

The first technique you'll learn does most of the work on every easy nonogram and a surprising amount on every hard one. The idea is overlap.

Take a row of length 10 with the clue 7. The run of seven filled cells has to start somewhere between cell 1 and cell 4 (any further and it overflows the row). Whichever start position is correct, every position from cell 4 through cell 7 is inside the run. Those four cells are filled in every valid arrangement, so you can fill them in now without knowing which arrangement is right.

That is the entire move. Find the leftmost legal position for each run; find the rightmost legal position; mark every cell that falls inside both. Those cells are forced.

The arithmetic generalises cleanly. If a line of length L has a single run of length R, the cells from L − R + 1 through R (1-indexed, inclusive) are forced filled, and the move yields nothing if R is at most half of L. So a 7 in a row of 10 forces 4 cells; a 5 forces nothing; a 9 forces 8.

For multi-clue lines the same trick works on each run after you've added up the minimum space the previous runs need. A row of length 10 with clue 4 3 has the first run starting somewhere between cell 1 and cell 3 — its rightmost legal start is cell 3, because the second run plus its mandatory single-cell gap takes 4 more cells out of the right side. Run the overlap on the 4 from positions 1–6 and 3–6, and cells 3 and 4 fill in. Run the overlap on the 3 from positions 6–10 and 8–10, and cell 8 fills in. Three cells from the clue alone, before you've eliminated anything.

Once cells are filled, the same arithmetic with one extra constraint — the runs you've started — produces another wave of deductions. A few passes of overlap, plus the cross-marks for cells you've ruled out, will finish almost every easy puzzle and chip steadily away at every hard one.

Once you've solved a few dozen puzzles you'll do this without thinking about it. Until then, do the arithmetic deliberately — the pattern recognition catches up faster than you'd think.

More articles