← StudyX Devlog

Every Sudoku Has One Answer: Unique Solutions and the 17-Clue Minimum

Hiroki ObaraHiroki Obara · DeveloperSudoku365How-To
Every Sudoku Has One Answer: Unique Solutions and the 17-Clue Minimum

The rule of sudoku is to fill a 9×9 grid with the digits 1 to 9 so that no row, no column and no 3×3 box contains the same digit twice. I wrote about the rules themselves in Sudoku Rules.

The rules do not say it, but a well-made sudoku keeps one more promise: it has exactly one answer. This is called a unique solution. In this post I write about unique solutions and the mathematical result that follows from them: a puzzle needs at least 17 clues.

What a unique solution is

If there are too few clues, the digits given at the start, there are many ways to fill the grid that follow the rules. In the extreme case, an empty grid with no clues has an enormous number of ways. According to the English Wikipedia article Mathematics of Sudoku, there are about 6.67×10²¹ completed 9×9 grids that satisfy the rules.

As you add clues, that number drops. When it reaches exactly one, you have a puzzle. A puzzle with only one answer is sometimes called a proper puzzle.

How a unique solution shapes solving

I think the unique solution is the main reason sudoku is a puzzle of reasoning.

If there is only one answer, every cell’s digit should follow from the clues by logic alone. The first techniques beginners learn are all ways of deciding that “only this digit fits in this cell” or “this digit fits only in this cell”. In a puzzle with two answers, some cells are left where either digit works, and logic cannot take you further. Then the only way forward is to guess.

Advanced solvers even have techniques that use uniqueness itself. Say four cells where two rows meet two columns sit in exactly two boxes, and all four are left with the same two candidates. The two digits could go into those cells either way round and still follow the rules, so the puzzle would have two answers. Since it should have only one, you choose the candidate that avoids that pattern. This is known as a unique rectangle.

The minimum is 17 clues

So how few clues can a puzzle with a unique solution have?

Puzzles with 17 clues and a unique solution had been found long ago, and collections of them now run to tens of thousands. But no one could find one with 16, however hard they looked. Did 16-clue puzzles not exist, or had they simply not been found yet? This stayed an open question for years.

In 2012, Gary McGuire and colleagues in Ireland released the paper There is no 16-Clue Sudoku. There are about 5.47 billion essentially different completed grids, counting grids that become the same by relabelling digits, rotating and so on as one. For every one of them, a computer search showed that no set of 16 clues gives a unique solution. The paper was published in a journal in 2014. With that, the minimum number of clues for a sudoku with a unique solution was settled at 17.

This is not a proof you can follow by hand. It is a proof by checking every case. The four colour theorem was proved in a similar way, and there are several problems in mathematics that were settled like this with the help of computers.

At least eight different digits

Apart from the number of clues, there is another rule that is easy to see. In a puzzle with a unique solution, the clues must include at least eight of the nine digits.

The reason is short. Suppose neither 3 nor 7 appears anywhere in the clues. Then you can swap every 3 and 7 in the answer grid, and the result still follows the rules and still agrees with the clues. That makes two answers. If two digits are missing from the clues, the solution cannot be unique.

Are fewer clues harder?

Fewer clues look harder, but I do not think the number of clues has much to do with difficulty. Some 17-clue puzzles can be solved with beginner techniques alone. And some puzzles with nearly 30 clues need advanced techniques.

What decides difficulty is not the clue count but which techniques you need. I wrote about that in What Makes a Sudoku Easy or Hard?

If you seem to find a puzzle with two answers

While solving, you may reach a cell where it looks as if either digit would work. When that happens, I think the first thing to suspect is your own oversight. Usually a candidate was not erased somewhere, or a digit you placed is wrong.

A puzzle that really has two answers is a badly made puzzle. In properly checked puzzle books and apps, you will hardly ever meet one.

The puzzles in Sudoku365

Sudoku365 is a daily sudoku app. It has four difficulties, Easy, Medium, Hard and Expert, with 300 puzzles each, 1,200 in total. For this post, I counted the solutions of all 1,200 puzzles with a program and confirmed that every one has exactly one answer. The puzzles have between 21 and 28 clues, and the count does not change much between difficulties.

Because the answer is fixed, turning on Show incorrect numbers lets the app tell you right away whether a digit you placed is correct. If you prefer to check things yourself, you can turn it off.

The app is free with ads, and a one-time Remove Ads purchase turns them off. For your first puzzle, see Getting Started with Sudoku365.

Download on the App Store Download on Google Play