Skip to content
Once Books
Blog

Why a picture nonogram almost never solves by pure logic

The Once Books team · 16 October 2026 · 7 min read

We drew 18 nonogram pictures by hand, shapes you would recognise: a heart, a cat, a sailboat, a star. Every one of them had exactly one solution. Only one of them could be solved without a guess.

That gap is the whole story of why a picture nonogram is a different thing to build than an abstract one, and it is worth knowing before you publish a book of them.

Two bars, not one

A nonogram is publishable only if its row and column clues have one solution. That is the bar everyone means by "a valid nonogram", and we prove it the same way we prove it for sudoku: a backtracking solver that counts solutions and gives up at two.

export function hasUniqueSolution(clues: NonogramClues, width: number, height: number): boolean {
  return countSolutions(clues, width, height, 2) === 1;
}

There's a second, stricter bar, and it's the one that matters for solvers: can the puzzle be finished by logic alone, with no guessing? We call that line-solvable, and it has its own check. It runs one pass of line propagation to a fixpoint, then asks whether every cell is now decided:

export function isLineSolvable(clues: NonogramClues, width: number, height: number): boolean {
  const { cells } = propagate(emptyBoard(width, height), clues, width, height);
  return firstUnknown(cells) === -1;
}

Propagation only fills a cell when a single row or column forces it, given what's already known. If propagation stalls with cells still blank, the puzzle needs a guess: you assume a cell, follow the consequences, and backtrack if they contradict. hasUniqueSolution will happily make those guesses for you. isLineSolvable won't, which is exactly why it's the stronger bar. Every line-solvable puzzle is unique, but the reverse almost never holds.

The experiment

Our abstract generator never has to worry about this. It paints a random picture (Bernoulli noise smoothed into blobs over two passes), reads the clues off it, and keeps the picture only if it's line-solvable. If it isn't, the generator throws it away and paints another, up to 600 times. A random picture is cheap, so re-rolling until one is line-solvable costs nothing a reader notices.

You can't re-roll a recognisable picture. A cat is a cat. So when we built the themed picture bank, we ran every hand-drawn shape through both checks. The result was lopsided:

Grid sizePicturesUniqueLine-solvable
5×5440
10×10881
12×12330
15×15330
Total18181

Eighteen unique pictures, and one of them line-solvable: a sailboat, the only asymmetric shape in the set. Every heart, every star, every symmetric thing failed the stronger bar while passing the weaker one.

Why symmetry forbids a clean solve

The reason is in how line logic fills a cell. It can only commit a cell when one row or column forces that cell on its own. A symmetric picture tends to produce balanced lines whose clues fit in more than one position until a crossing line breaks the tie, and the crossing line is often waiting on the same information. Neither line forces the other first, so propagation stalls with the shape half-drawn. You can still finish it, but only by assuming a cell and checking. Line logic doesn't allow that assume-and-check step.

An asymmetric shape like the sailboat keeps breaking its own symmetry, so some line almost always has a forced move available, and propagation runs to the end without stalling. The sailboat passed for that reason.

The decision we made

We kept both bars, and used a different one for each mode. Abstract puzzles must be line-solvable, because we can afford to re-roll until they are, and a no-guessing puzzle is the better product when the picture is meaningless anyway. Themed puzzles must be unique, because uniqueness is the real guarantee a solver needs, and holding out for a line-solvable cat would empty the bank.

So the copy had to change with it. Our abstract nonograms say "solves by logic, no guessing", because that's checked and true. The picture nonograms say they have one solution but can need a little trial and error, because that's also checked and also true. Writing "no guessing" on a themed book would be the easy lie, and it's the one thing a nonogram solver would catch on the first page.

Every picture in the bank is checked by the test suite, which fails the build if any shape isn't uniquely solvable. A picture that can't pass is redrawn or dropped. Nothing ambiguous reaches a page.

The stricter bar is the cheaper one

One more thing worth knowing if you build this: the no-guessing check is faster than the uniqueness check, not slower. Line propagation runs once and either finishes the grid or stalls. Counting solutions has to propagate and then branch and backtrack. On our engine, averaged over 2,000 runs on a 2.8 GHz Xeon under Node 22:

Check10×1015×15
isLineSolvable0.022 ms0.044 ms
hasUniqueSolution0.130 ms0.349 ms

So the abstract generator's accept check is the quick one, which is part of why re-rolling 600 times is affordable. The themed path pays the dearer check once per picture, but there are only 18 of them and they're verified at build time, so a reader never waits on it.

If you want to try it

The free nonogram generator has an Abstract and a Shapes toggle, so you can print one of each and feel the difference: the abstract grid you can grind out line by line, the picture one where you'll hit a point you have to reason past. To publish a book of either, the KDP nonogram maker generates hundreds at any trim, each proved to have one solution, as a print-ready interior and solutions PDF. The guide to making and selling nonogram books on KDP covers everything after the puzzles are built.

Try the tool

Free, in your browser, no sign-up. Make one, then build the whole book in the studio.

Questions parents ask

Can every nonogram be solved by logic alone?
No. A nonogram with a single solution can still need a guess: a point where no row or column forces the next cell on its own, so you have to assume a cell, follow the consequences, and backtrack if they contradict. Puzzles that never need that are called line-solvable, and recognisable pictures rarely are.
What is the difference between a unique nonogram and a line-solvable one?
Unique means the clues have exactly one solution. Line-solvable is stronger: the one solution can be reached by filling cells each row or column forces on its own, with no guessing. Every line-solvable puzzle is unique; most unique puzzles are not line-solvable.
Why do themed picture nonograms need a guess when abstract ones do not?
Because we pick them by different rules. Our abstract puzzles are only kept if they are line-solvable, and we can re-roll a random picture until one is. A recognisable picture is drawn, not rolled, and its symmetry tends to leave cells no single line forces, so it is unique but not line-solvable.
Do you guarantee nonogram puzzles have one solution?
Yes. Every puzzle we ship, abstract or themed, is proved to have exactly one solution by a backtracking solver that stops at the second answer. A themed picture additionally may need some trial and error; an abstract one is always solvable by pure line logic.

Related reading

Keep reading

← All posts