← minty-modesty.github.io

Why "unique solution" is not enough for a nonogram puzzle

A puzzle generator can guarantee exactly one solution and still hand you a page that stops dead if you work it one row and one column at a time. Here is a five-by-five, the property that actually rules that out, and how to check for it yourself.

Correction, 26 July 2026

An earlier version of this page said the five-by-five below forces you to guess. That was wrong, and a reader on r/nonograms was right to say so. The grid can be finished with no guessing at all: suppose a square is filled, follow the consequences to a contradiction, and you have proved it empty. That is deduction. Applied to the twelve squares where line logic stops, it finishes the grid in one sweep.

What is true of the grid is narrower, and it is what this page now claims: line logic alone does not finish it. That is still strictly stronger than a uniqueness check, and it is still the property worth testing if you print puzzles for people solving in pencil. But "not line-solvable" and "requires a guess" are different statements, and I had conflated my own solver's ceiling with a property of nonograms.

The three properties

One solution. Exactly one grid of filled and empty squares satisfies the clues.

Line-solvable. There is an order in which you can work through the rows and columns where, at every step, the clues on some single line force at least one more square. You look at one line at a time and never suppose anything.

Forcing-solvable. Finishable by deduction, but some steps need the whole grid at once: suppose a square, propagate, take the contradiction. Not guessing, but a different and much harder skill.

Line-solvable implies forcing-solvable implies one solution. Neither implication runs backwards.

A five-by-five that has one solution and still stalls line logic

The solution picture, with # for a filled square:

     col clues:  1 2   2   2   1 1   1 2

 1 1     #     .     .     .     #
   1     .     .     .     #     .
 1 1     #     .     .     .     #
 3 1     #     #     #     .     #
   3     .     #     #     #     .

The five row clues are 1 1, 1, 1 1, 3 1, 3; the five column clues are 1 2, 2, 2, 1 1, 1 2.

Exactly one grid satisfies those clues — an exhaustive search confirms the count is one, not two. A generator that filters on uniqueness alone passes this puzzle and prints it.

Now try to solve it. Work along every row, then every column, filling in only squares the clues force, and repeat until nothing more moves. You get 13 of the 25 squares and then line logic is out of moves: twelve squares are still blank and no single row or column can settle any of them on its own.

Going further means reasoning across lines: suppose one of those blanks is filled, push the consequences through the grid, and a contradiction proves it empty. That finishes all twelve at once, so the puzzle never required a guess. It is, though, a large step up in what the reader has to do, and someone working in pen at the kitchen table is more likely to reach for trial and error and then conclude the page is misprinted.

Where the deduction runs out, with ? for the squares line logic cannot reach:

 1 1     #     .     .     ?     ?
   1     .     .     .     ?     ?
 1 1     ?     ?     .     ?     ?
 3 1     #     #     #     .     #
   3     ?     ?     #     ?     ?

Why the stronger check is the one that matters

Nobody solving a puzzle book wants a search problem, and most are not looking for a proof technique either. A puzzle that stalls reads as broken even when it is technically fine, because the solver cannot tell "I am missing a deduction" from "there is no line-level deduction available here." Either way, it looks like the book has an error, and on paper a wrong branch means a page of crossings-out with no way to undo it.

The check

Only write down a square when every arrangement of a line's clue that is still consistent with what is already known agrees on that square. Anything written this way is true in every solution, which is why finishing the grid this way also proves the solution is unique. Process the whole grid one line at a time and repeat until nothing changes. If every square gets settled, the puzzle passes. If the process stalls with blanks remaining, reject it — whether or not it happens to have a unique solution.

There are three possible verdicts, not two:

verdictmeaning
no-guessline logic finishes the grid; accepted
unique-but-not-line-solvableexactly one solution, but line logic stalls. Often still finishable by the suppose-and-contradict step; rejected either way
ambiguousmore than one solution, so no amount of deduction settles it; rejected

This is a well-known technique in constraint-solving circles (it is exactly line-and-column constraint propagation, no search), but most puzzle generators skip the "keep going until nothing moves, then check nothing is left blank" step and stop at uniqueness because uniqueness is cheaper to compute. The cost of skipping it lands on the solver, three-quarters of the way through the grid, in pen.