# Killer sudoku

Killer sudoku (also killer su doku, sumdoku, sum doku, sumoku, addoku, or samunanpure サムナンプレ sum-num(ber) pla(ce)) is a puzzle that combines elements of sudoku and kakuro. Despite the name, the simpler killer sudokus can be easier to solve than regular sudokus, depending on the solver's skill at mental arithmetic; the hardest ones, however, can take hours to solve.
A typical problem is shown on the right, using colors to define the groups of cells. More often, puzzles are printed in black and white, with thin dotted lines used to outline the "cages" (see below for terminology).

## History

Killer sudoku puzzles were already an established variant of sudoku in Japan by the mid-1990s, where they were known as "samunamupure." The name stemmed from a Nipponised form of the English words "sum number place." Killer sudokus were introduced to most of the English-speaking world by The Times in 2005.
Traditionally, as with regular sudoku puzzles, the grid layout is symmetrical around a diagonal, horizontal or vertical axis, or a quarter or half turn about the centre. This is a matter of aesthetics, though, rather than obligatory: many Japanese puzzle-makers will make small deviations from perfect symmetry for the sake of improving the puzzle. Other puzzle-makers may produce entirely asymmetrical puzzles.

## Terminology
### Cell

    A single square that contains one number in the grid

### Row

    A horizontal line of 9 cells

### Column

    A vertical line of 9 cells

### Nonet

    A 3×3 grid of cells, as outlined by the bolder lines in the diagram above; also called a box

### Cage

    The grouping of cells denoted by a dotted line or by individual colours.

### House

    Any nonrepeating set of 9 cells: can be used as a general term for "row, column, or nonet" (or, in Killer X variants, "long diagonal")

## Rules

The objective is to fill the grid with numbers from 1 to 9 in a way that the following conditions are met:
* Each row, column, and nonet contains each number exactly once.
* The sum of all numbers in a cage must match the small number printed in its corner.
* No number appears more than once in a cage. (This is the standard rule for killer sudokus, and implies that no cage can include more than 9 cells.)
In 'Killer X', an additional rule is that each of the long diagonals contains each number once.

## Duplicate cell ambiguity

By convention in Japan, killer sudoku cages do not include duplicate numbers. However, when The Times first introduced the killer sudoku on 31 August 2005, the newspaper did not make this rule explicit. Even though the vast majority of killer sudoku puzzles followed the rule anyway, English-speaking solvers were confused about appropriate solving strategies given the ambiguity. On September 16, 2005, The Times added a new ruling that “Within each dotted-line shape, a digit CAN be repeated if the normal row, column and 3x3 box rules are not broken”. But on September 19 the rule changed to “Within each dotted-line shape, a digit CANNOT be repeated if the normal row, column and 3x3 box rules are not broken” - causing even more confusion. This revised rule stuck and the world standard is no duplicates within cages.

## Solving strategies
### Fewest possible combinations

Generally the problem is best tackled starting from the extreme sums—cages with the largest or the smallest sums. This is because these have the fewest possible combinations. For example, 5 cells within the same cage totalling 34 can only be 4, 6, 7, 8, and 9. Yet, 5 cells within the same cage totaling 25 has twelve possible combinations.
In the early stages of the game, the most common way to begin filling in numbers is to look at such low-sum or high-sum cages that form a 'straight line'. As the solver can infer from these that certain numbers are in a certain row or column, they can begin 'cross-hatching' across from them.

### The Rule of 45

A further technique can be derived from the knowledge that the numbers in all houses (rows, columns and nonets) add up to 45. By adding up the cages and single numbers in a particular house, the user can deduce the result of a single cell. If the cell calculated is within the house itself, it is referred to as an 'innie'; conversely if the cell is outside it, it is called an 'outie'. Even if this is not possible, advanced players may find it useful to derive the sum of two or three cells, then use other elimination techniques (see below for an example of this). This '45' technique can also be extended to calculate the innies or outies of N adjacent houses, as the difference between the cage-sums and N*45.

#### Clock Arithmetic

A short-cut to calculating or checking the value of a single 'innie' or 'outie' on a large number of cages is to add up the cages using 'clock' arithmetic (formally, Modular Arithmetic modulo 10), in which all digits other than the last in any number are ignored.
When two numbers are added together, the last digit of the total is not affected by anything other than the last digits of the two original numbers. Adding together a number ending in 7 and a number ending in 8 always results in a number ending in 5, for example. So, for example, 17 + 18 = 35 becomes, in clock arithmetic, 7 + 8 = 5. The biggest number an 'innie' or 'outie' can hold is 9, so adding or subtracting that value will change the last digit of the total in a way that no other value would - allowing the 'innie' or 'outie' to be directly calculated. Clock arithmetic has the advantage that you are only ever dealing with single-digit sums, rather than sums like, say, 58+27 - and even if the concept is initially unfamiliar, it rapidly becomes trivial.
Example: A set of cages form a complete nonet with an 'outie'. The cages have values 8, 10, 14, 7, 14.
* Using normal arithmetic, those add up to 53. A single nonet totals 45, so the 'outie' must contain an 8.
* Checking that, using clock arithmetic on those values in turn: 8+0=8; 8+4=2; 2+7=9; 9+4=3. So the clock total is 3, meaning that the actual total also ends in 3 (which we've seen that it does). Any odd number of houses (in this case, 1 nonet) always have an arithmetic total ending in 5 - so, the only 'outie' we could add to change that 5 to a 3 is, again, 8.
Clock arithmetic has the additional bonus that, when the final digits of two cage totals add up to 10 (13 and 27, for example), the pair will make no difference to the overall clock total, and can simply be skipped.
Clock arithmetic should at most be used with caution for houses with more than one 'innie' or 'outie', when more than one set of values may result in the same final number, but may still be useful as a quick arithmetic check.

### Consistent numbers within combinations

Even though some cages can have multiple combinations of numbers available, there can often be one or more numbers that are consistent within all available solutions. For example: a 4 cell cage totaling 13 has the possible combinations of (1, 2, 3, 7), (1, 2, 4, 6), or (1, 3, 4, 5). Even though, initially, there is no way to tell which combination of numbers is correct, every solution available has a 1 in it. The player then knows for certain that one of the numbers within that cage is 1 (no matter which is the final solution). This can be useful if, for example, they have already deduced another cell within a nonet the cage resides in as having the number 1 as its solution. They then know that the 1 can only reside in cells that are outside of this nonet. If there is only one cell available, it is a 1.

### Initial analysis of the sample problem
#### Fewest possible combinations

The two cells in the top left must be 1+2. The 3 cells to the right totaling 15 cannot therefore have either a 1 or a 2, so they must be either 3+4+8, 3+5+7, or 4+5+6.
The two vertical cages in the top left of the top right nonet cannot be 2+2 as that would mean duplicates, so they must be 1+3. The 1 cannot be in the top line as that conflicts with our first 2 cells therefore the top cell of this pair is 3 and the lower cell 1. This also means the 3 cell cage 15 to the left cannot contain a 3 and so is 4+5+6.
Similarly the neighbouring 16 must be 9+7.
The four cells in the top right cage (totaling 15) can only include one of 1, 3, 7, or 9 (if at all) because of the presence of 1, 3, 7, and 9 in the top right hand nonet. If any one of 1, 3, 7, or 9 is present then this must be the lone square in the nonet below. Therefore, these 4 cells are one of 1+2+4+8 or 2+3+4+6.
The 2 cells in the middle of the left edge must be either 1+5 or 2+4; and so on.

#### 45 rule example

Looking at the nonet on the left hand side in the middle, we can see that there are three cages which do not cross over into another nonet; these add up to 33, meaning that the sum of the remaining two cells must be 12. This does not seem particularly useful, but consider that the cell in the bottom right of the nonet is part of a 3-cage of 6; it can therefore only contain 1, 2 or 3. If it contained 1 or 2, the other cell would have to contain 11 or 10 respectively; this is impossible. It must, therefore, contain 3, and the other cell 9.

### Complements

With 6-cell, 7-cell or 8-cell cages, correlating the combinations with their 3-cell, 2-cell, or 1-cell complements usually simplifies things. The table for 6 cell cages is the complement of the 3 cell table adding up to 45 minus the listed value; similarly, the 7 cell table complements the 2 cell table. An 8-cell cage is of course missing only one digit (45 minus the sum of the cage).
For example, the complement of a 7-cell cage totalling 41 is a 2-cell cage totalling 4 (because 9–7=2 and 45–41=4). As a 2-cell cage totalling 4 can contain only 1 and 3, we deduce that a 7-cell cage totalling 41 contains neither 1 nor 3.

## Cage total tables

The following tables list the possible combinations for various sums.