Sudoku Flow
Sudoku encyclopedia · Math and computing

The mathematics of Sudoku

Updated 2026-10-05

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)

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

Sources

All articles →

Sudoku app icon

Want more boards like this?

We also make a Sudoku app for iPhone, iPad, Mac and Android. There are no ads in it at all, it works offline, and when you ask for a hint it shows you the technique instead of just filling in a number.

Sudoku Flow is made by Rubigo Games, the developer of the Sudoku app recommended on this site.