Skip to content
Vamshi Jandhyala

Books

Solving Puzzles through Mathematical Programming

Solving Puzzles through Mathematical Programming

Non-Japanese puzzles under constraint-programming solvers

2026 · 89 pp

Fifteen classical and contemporary puzzles, Fish, Calendar, Praxis Rhombus, Bedlam Cube, Instant Insanity, Drive Ya Nuts, Ostomachion, Langford, Quintomino on the dodecahedron, Dobble, Bug Byte, Monkey Cat Dog, Prime Circle, Rolling Cubes, and Pilgrims, modelled as constraint-satisfaction problems and solved by Z3, CP-SAT, and NetworkX.

Download PDF → · Read sample chapter →


A companion to Nikoli. Where that volume collected Japanese pencil puzzles, this one collects the rest: historical dissections, manufacturer puzzles from the 1960s and 1970s, modern brain-teasers, and Jane Street’s monthly puzzles. Fifteen chapters, each the solution to a single famous puzzle.

The chapters: Fish (a lattice-tiling puzzle); the Calendar Puzzle (pentominoes on a twelve-month grid); the Praxis Calendar Rhombus; the Bedlam Cube (a packing of thirteen irregular pieces into a 434^3 cube); Instant Insanity (the Parker Brothers 1967 puzzle of four coloured cubes); Drive Ya Nuts (the Milton Bradley 1970 hexagonal puzzle); the Ostomachion (Archimedes’s fourteen-piece dissection); Langford’s problem (Dudley Langford, 1958); Conway’s quintomino on the dodecahedron; Dobble (the card-matching design from projective planes); Bug Byte (Jane Street’s graph-weighting puzzle); the Monkey, Cat, Dog number-grid puzzle; the Prime Circle (Hamiltonian cycles with prime-sum edges); Rolling Cubes; and the Riddle of the Pilgrims.

Each chapter takes the same shape: a clear problem statement with the rules pictured, a modelling narrative that turns the rules into constraints, implementation in Python’s constraint-programming ecosystem, Z3 or Google’s CP-SAT, with NetworkX where graph structure helps, and the resulting solution.