How we generate a Futoshiki with one solution
The Once Books team · 25 October 2026 · 6 min read
Futoshiki shares almost everything with the other logic grids we publish except one trick: there are no given numbers to start from, just less-than and greater-than signs. That changes how you generate it, and it was the first real test of whether the solver we built for 0-and-1 puzzles could carry a 1-to-N one. It could.
The answer comes first
You can't dig clues out of a puzzle you don't have, so generation starts from the finished grid. We draw a random Latin square, every row and column holding 1 to N once, using the shared solver's own seeded fill. Then we read off every inequality the answer implies: for each pair of neighbouring cells, the sign that points from the larger to the smaller. That gives a fully-signed grid that obviously has our square as a solution. The question is whether it has only that one.
Carving back to unique, and no further
A fully-signed grid is usually over-determined and a bit dull, so we take signs away. We remove signs and, where needed, given numbers one at a time in a random order, and after each removal we re-check the grid still solves by logic alone. If a removal would make it ambiguous or force a guess, we put that clue back. What survives is the sparsest grid that a solver can still reason to a single answer.
That "solves by logic alone" check is the same one the whole family uses: run propagation to a fixpoint and see whether every cell ended up decided. If it did, there was never a second answer to find, so the one pass proves uniqueness and no-guessing at once.
Two rules, taking turns
The solver narrows a Futoshiki by interleaving two rules until neither can remove another possibility:
- The Latin rule: once a cell is fixed, that value leaves every other cell in its row and column.
- The inequality rule: a cell that must be greater than its neighbour can't hold the smallest values still open to that neighbour, and the neighbour can't hold the largest.
Each rule feeds the other. Fixing a value by the Latin rule tightens an inequality; tightening an inequality fixes a value. The loop runs until the grid stops changing, which is the moment the solver has extracted everything logic can give.
Why it stops at 7 by 7
The grids grade by size, from 4 by 4 up to 7 by 7, and they stop there on purpose. A bigger Latin square laced with inequalities is a long solve, and the payoff for the reader tails off: an 8 by 8 takes noticeably longer to work without feeling more clever than a 7 by 7. The honest lever a generator controls is size, so we cap it where the puzzle still rewards the time.
Building the answer first and carving back is also what proved the point we cared about internally: the constraint core we first wrote for Binairo, a binary puzzle, carries a permutation puzzle like Futoshiki without change. Same search, same uniqueness proof, a different rule plugged in. The deeper write-up of that core is in how we prove a Binairo has one solution.
To see a grid come out of this code, the free Futoshiki generator runs it in your browser with the solution. For a graded book, the KDP Futoshiki maker runs it in a worker, and how to make and sell Futoshiki 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 Futoshiki with a unique solution?
- Build a random Latin square as the answer, read off every inequality sign it implies, then remove signs and given numbers one at a time, keeping a removal only while the grid still solves by logic alone. What's left is a unique puzzle.
- Is a Futoshiki always solvable without guessing?
- In our books, yes. We keep a grid only if propagation alone fills it in, which both guarantees no guessing and proves the answer is unique.
- How does a Futoshiki solver use the inequality signs?
- It interleaves two narrowings until neither changes anything: the Latin rule (a value used in a row or column is removed from the rest of that line) and the inequality rule (a cell greater than its neighbour can't take the smallest remaining values, and vice versa).
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 we check a Kakurasu has one solution
Kakurasu is generated the lazy way: shade a random grid, read off the totals, and keep it only if the solver proves it unique. Why that works, and the pruning.
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.