SudokuBoku

Killer sudoku solver Cages in, answer out

Carve the grid into its cages, give each one its printed total, and the whole puzzle finishes itself — or tells you which total is wrong.

The clues are the cages, so entering them is the work

A classic puzzle travels as eighty-one characters, so the classic solver can take a pasted line and be done. A killer cannot be pasted at all. Its clues are a map of which squares belong together, with a number on each group, and no text box holds a map. So this page is mostly a drawing tool. Press any square and drag across its neighbours, and the squares you cross become one cage; let go, and a list of totals appears. The list offers only the totals a cage of that size can actually carry. Two squares cannot make 2 or 18, so neither is offered, and a slip of the finger has nowhere to land.

Under each total the list prints how many different sets of digits can make it. The engine's own table says a cage can carry 129 different size-and-total pairs, that 43 of them can be made by exactly one set of digits, and that 511 digit sets exist in all. The forced ones are picked out, because they do work before a single digit is written — a two-square cage marked 3, 4, 16 or 17 has told you its digits already. What those sets mean for the solve, and how the rule of 45 turns a row into free digits, is taught on the killer board's own page; this one only needs you to copy the numbers off the paper correctly.

Squares in the cage Totals it can carry How many Made one way only Hardest total to pin down
1 1–9 9 9 none — every total names its digits
2 3–17 15 4 9 (4 sets)
3 6–24 19 4 14 (8 sets)
4 10–30 21 4 20 (12 sets)
5 15–35 21 4 25 (12 sets)
6 21–39 19 4 29 (8 sets)
7 28–42 15 4 34 (4 sets)
8 36–44 9 9 none — every total names its digits
9 45 1 1 none — every total names its digits

Read from the engine's cage table at build time. A one-square cage is a given in disguise, and an eight-square cage names its digits by the one it leaves out.

Four hundred and five, checked as you draw

Two pieces of arithmetic run the whole time you are drawing. Every square of a killer belongs to exactly one cage, so the line above the grid counts the squares still outside any, and the solve button refuses until that count is zero. And every finished grid holds the digits 1 to 9 nine times over, which add to 405, so the cage totals have to add to 405 as well. The line keeps a running sum; the moment the last square is caged, the sum either lands on 405 or the page says by how much it missed.

One wrong total can never hide. The digits of any finished grid add to 405, and the cages have to agree with them.

What the 405 test cannot see is a pair of slips that cancel: one total read a point too high and another a point too low, or two neighbouring totals written onto each other's cages. Both pass the sum. So we measured what the search makes of them. Over 120 puzzles from our own generator, drawn from the medium, hard and expert bands, each layout was damaged both ways and counted again.

In every one of the 240 trials the damaged cages fitted no grid whatsoever, and the count came back zero. That is a measurement, not a theorem, and the honest reading is narrower than it looks: a cancelling slip is almost always caught, but nothing here can promise it always will be. If a solved grid disagrees with the printed answer, the cage whose total you doubt is the place to look, and the take-back button undoes the machine's digits without touching yours.

Three answers and one line of judgement

Once the layout is whole and the totals agree, the search runs by itself and the line above the grid reports what it found: one solution, none, several, or — rarely — that it ran out of budget before deciding. The buttons beside the grid then do what the classic solver's do. Solve fills every empty square in indigo. Reveal fills the one you have selected and leaves the rest alone. Count keeps looking after the first answer and reports how many it found, which is the mechanical test of whether the puzzle you copied is the puzzle that was printed. All three use the cage-aware search that proves every grid on the killer board before it is served: the ordinary row, column and box rules, plus a bound on each cage that throws a digit out the moment the remaining squares could no longer reach the total. It guesses rather than reasons, and the classic solver's page explains why that is faster than thinking without being the same thing.

What the ladder adds

The line the search cannot write is the one underneath it. When the layout proves unique, the killer technique ladder replays your puzzle the way a person would — cage arithmetic, then the digit sets, then the rule of 45 across one unit and then several, then the classic patterns on cage-narrowed candidates — and the page says which rung it had to climb to. That is the same grader that labels the four levels on the killer board, pointed at a puzzle we did not make, so the sentence means what it says there. Give the solver a newspaper's "fiendish" and it will tell you whether the hardest step was a one-row 45 or a combination cross-check.

Budgets are stated rather than hidden. The live check stops at 100,000 search steps and says so; the buttons get 1,500,000; and the slowest proof in the measurement above was done inside 64,000.

From the printed page to a board with hints

Entering a puzzle is the slow part, so the page keeps what you draw. The layout is saved in your browser as you go, and the copy button turns it into a link that carries every cage, every total and any digits you typed, finished or not — paste it into the box under the grid on another day and the drawing resumes. The link the killer board makes when you share a puzzle there is accepted in the same box, so anything played on this site can be brought here and counted.

It also goes the other way. Once a layout is complete, proved to have one solution, and carries no typed digits, a link appears under the grid that opens it on the killer board — the same cages, now with pencil marks that know the sums and a hint button that names the next move rather than filling the square. That is the suggested route for a puzzle you would rather finish than be told. Everything here works from the keyboard as well as by dragging: arrows move, Space gathers the squares of a cage, Enter asks for its total, and typing the number is quicker than finding it in the list.