How we check a Kakurasu has one solution
The Once Books team · 4 November 2026 · 5 min read
Most of our puzzles are generated by building an answer and carefully carving clues out of it. Kakurasu is generated the lazy way, and it's a good example of when lazy is correct: when the clue is cheap to derive and the solver is strong enough to be the judge.
Shade, total, verify
A Kakurasu has no given marks. The entire clue is the set of row and column totals, and those are trivial to compute from any shading. So generation skips the carving step entirely. We shade a random grid, each cell filled with probability 0.45, compute the totals it implies, and hand the totals to the solver with one question: do these have exactly one solution? If yes, we keep the grid. If no, we re-roll from a stepped seed and try again, up to 200 times.
Uniqueness is the same count-to-two check the whole family uses: find solutions, but stop at the second, because you only need to know there's more than one, not how many. The grid we started from is one solution by construction; the solver's job is to rule out a second.
There's nothing to store beyond the grid size and the edge totals. A cell's weight is always its position, 1 to N, so the weights are implicit and never written down. The puzzle is smaller on disk than it looks on the page.
The pruning that keeps it fast
A naive uniqueness check on a shading puzzle could explore two-to-the-cells possibilities, so the solver leans on a sum narrowing per line. For each line it knows the target and the weights still in play, and for each undecided cell it asks a bounded question: if this cell is shaded, can the remaining undecided cells make up the rest of the target? If this cell is blank, can they? Whichever option can't be reached is removed.
That narrowing is sound, it never drops a legal option, but it's deliberately not a full subset-sum solver. It works on bounds, not exact reachability, so some grids still need the search to branch. The point isn't to solve the puzzle by narrowing alone; it's to prune hard enough that the backtracking uniqueness check stays quick, even on a 7 by 7. The weighted sums are tight constraints, so in practice they cut the tree down sharply.
Same core, a different domain
Kakurasu is the second 0-and-1 puzzle we built on the shared constraint core, after Binairo. That mattered more than it sounds: Binairo and Kakurasu are both binary, but a line rule and a weighted-sum rule are nothing alike, and running both on one solver confirmed the core really is rule-agnostic. The same search that proves a Binairo unique proves a Kakurasu unique, with a different narrowing plugged in. The core itself is written up in how we prove a Binairo has one solution.
To see a grid come out of this code, the free Kakurasu generator runs it in your browser with the solution. For a graded book, the KDP Kakurasu maker runs it in a worker, and how to make and sell Kakurasu books on KDP covers the rest.
Try the tool
Free, in your browser, no sign-up. Make one, then build the whole book in the studio.
Questions parents ask
- How do you generate a Kakurasu with a unique solution?
- Shade a random grid, compute the row and column totals it implies, and accept it only if the solver proves those totals have exactly one solution. If not, re-roll. There's no digging step, because the totals are the whole clue.
- How does a Kakurasu solver prune the search?
- With sum bounds. For each unshaded cell it asks whether the remaining cells in the line could still reach the target with that cell shaded, or without it, and drops the option that can't. It's sound but not a full subset-sum solver, so the search still backtracks to finish.
- Are the position weights stored in the puzzle?
- No. A cell's weight is always its row or column position, 1 to N, so there's nothing to store. The puzzle is just the grid size and the edge totals.
Related reading
How a crossword generator fills a grid
Our crossword maker doesn't fill a black-square skeleton from a dictionary. It lays your words onto an open grid so each one crosses another. Here is how.
Why our Kakuro grids stop at 7 by 7
Our Kakuro generator builds a grid, reads off the sums, and keeps it only if it proves unique. Past 7 by 7 a random grid is almost never unique, so that's the cap.
How to make and sell Kakurasu books on Amazon KDP
A guide to making Kakurasu books for Amazon KDP: pick a grid size, generate single-solution weighted-sum grids, get the interior right, and upload.
Keep reading
Answers
One sharply-scoped question per page, cost, safety, timing, printing, answered in a couple of sentences before the detail.
Glossary
Plain definitions of the vocabulary: the Character Sheet, the Consistency Engine, style profiles, drift.
Help centre
Task-shaped instructions for making, printing and sharing a book once you have started one.