The mathematics of Sudoku
Updated 2026-11-06
A Latin square with boxes
In a Latin square, every symbol appears once in each row and each column. A finished Sudoku is a Latin square of size 9 with one more condition: each of the nine 3×3 boxes also holds every digit once.
Sources: Wikipedia: Latin square
How many grids there are
Bertram Felgenhauer and Frazer Jarvis counted the finished 9×9 grids in 2005: there are 6,670,903,752,021,072,936,960, about 6.67 × 10²¹. Many of them are the same grid in disguise. Count two grids as one when you can turn one into the other by relabelling the digits, rotating or reflecting, or reordering rows and columns in the ways that keep a grid valid, and 5,472,730,538 essentially different grids remain, a figure computed by Ed Russell and Frazer Jarvis.
Sources: Felgenhauer and Jarvis, Enumerating possible Sudoku grids (2005), OEIS A107739: number of Sudoku grids, Wikipedia: Mathematics of Sudoku
The 17-clue minimum
No standard 9×9 Sudoku with 16 or fewer givens has exactly one answer. Gary McGuire, Bastian Tugemann and Gilles Civario showed this with an exhaustive computer search and announced the result in January 2012. Seventeen is the minimum, not a guarantee: many grids with 17 givens still have more than one answer.
Sources: McGuire, Tugemann and Civario, There is no 16-Clue Sudoku (arXiv 1201.0749)
How the 17-clue proof worked
In a finished grid, some groups of squares are unavoidable: if all of them were left empty and every other square were given, the puzzle would have more than one answer. So a puzzle with exactly one answer must give at least one square from every such group, and any set of givens that does has exactly one answer. McGuire, Tugemann and Civario took the 5,472,730,538 essentially different grids one at a time and searched each for a set of 16 givens with exactly one answer, using unavoidable groups to rule out almost every set without trying it. They found none. The search ran from January to December 2011 at the Irish Centre for High-End Computing and took about 7.1 million core hours; the final version of their program needed about 3.6 seconds per grid on one processor core.
Sources: McGuire, Tugemann and Civario, There is no 16-Clue Sudoku (arXiv 1201.0749)
How many 17-clue puzzles there are
When the proof was published, Gordon Royle's collection held 49,151 different 17-clue puzzles, counting puzzles that are the same up to symmetry only once. New lists sent to him rarely contained puzzles he did not already have, so the authors judged that it must hold almost all the 17-clue puzzles there are. No finished grid was known to contain more than 29 of them.
Sources: McGuire, Tugemann and Civario, There is no 16-Clue Sudoku (arXiv 1201.0749)
Sudoku as graph colouring
Draw one point for each of the 81 cells and connect two points whenever their cells share a row, a column or a box. This Sudoku graph has 810 connections, and every point has exactly 20 neighbours. Solving the puzzle means extending the colours fixed by the givens so that connected points never match. At least nine colours are needed, because each row, column and box is a group of nine points that are all connected, and any finished grid shows that nine are enough.
Sources: Wikipedia: Sudoku graph
Hard in general, quick for 9×9
For Sudoku grids that can grow without limit (n²×n² with n×n boxes), deciding whether a partly filled grid can be completed is NP-complete, a result Takayuki Yato and Takahiro Seta published in 2003. Efficient computer programs typically solve ordinary 9×9 puzzles in a fraction of a second, though the time depends on the program, the computer and the puzzle.
Sources: Wikipedia: Mathematics of Sudoku, Wikipedia: Sudoku solving algorithms, Peter Norvig: Solving Every Sudoku Puzzle
See also
Related articles
- How computers solve Sudoku
- Sudoku rules, explained
- Sudoku variants: Killer, Jigsaw, Diagonal, Samurai and more
Sources
- Wikipedia: Latin square
- Felgenhauer and Jarvis, Enumerating possible Sudoku grids (2005)
- OEIS A107739: number of Sudoku grids
- Wikipedia: Mathematics of Sudoku
- McGuire, Tugemann and Civario, There is no 16-Clue Sudoku (arXiv 1201.0749)
- Wikipedia: Sudoku graph
- Wikipedia: Sudoku solving algorithms
- Peter Norvig: Solving Every Sudoku Puzzle