How Sudoku difficulty is graded

By Sudoku Online Editorial Team ·

This site grades a Sudoku by the hardest technique a solver has to use to finish it, not by how many clues it starts with. A technique solver always picks the cheapest technique that applies, and the puzzle’s level is the highest tier it had to use. It is this site’s own method, not an official standard.

Easy means singles only, Medium pairs and line-and-box interactions, Hard triples and X-Wing, Expert XY-Wing, Swordfish and simple coloring, and Evil unique rectangles or beyond.

Why not just count the clues?

Clue count is the obvious way to label difficulty, and it is a poor one. Two puzzles with the same number of starting digits can differ enormously in what they ask of you. One can be finished by spotting cells with a single possible digit. Another can stall until you find a rectangle of candidates that forces an elimination. The number of clues says very little about which of those you will get.

The site’s own pools show this. Across 1,000 stored classic puzzles at each level, the average clue count is 24.4 for Easy and 24.8 for Evil, and the ranges overlap almost completely. The technique frequency guide has the full table. So the grading looks at the reasoning a puzzle needs and ignores the clue count.

What does each level require?

The solver knows twelve techniques for classic play, each with its own lesson. Each belongs to one of five tiers, and the tier numbers match the levels you choose on the home page.

The site’s five tiers and the techniques that define them
TierLevelTechniques that put a puzzle in this tier
1EasyNaked singles and hidden singles
2MediumPointing pairs and triples, box/line reduction, naked pairs, hidden pairs
3HardNaked triples and X-Wing
4ExpertSwordfish, XY-Wing and simple coloring
5EvilUnique rectangles, or a position the twelve techniques cannot finish

The techniques in the tier column are the ones that first become necessary at that level. A Hard puzzle will usually also use singles and pairs along the way. It is called Hard because at least one step needed something from tier 3 and nothing needed more than tier 3. The techniques hub lists all twelve lessons in the order a learner would meet them.

How does the solver grade a puzzle?

Grading is a loop that a person can follow on paper.

  1. Start with the puzzle’s givens and work out the candidates for every empty cell.
  2. Go through the techniques in a fixed order, from the cheapest to the most expensive, and take the first one that finds anything: a digit to place or a candidate to remove.
  3. Apply that one step, note which technique it was, and start again from the top of the list. Because the list always restarts at the cheapest technique, a heavier technique is only used when every cheaper one has nothing to offer.
  4. Stop when the grid is full. The puzzle’s tier is the highest tier among all the techniques that were used.
  5. If no technique applies and the grid is not full, the solver is stuck. The puzzle is graded as tier 5, Evil, and flagged as needing something beyond the implemented techniques.

The same loop records which techniques were used, and that record is stored with the puzzle. The frequency guide is nothing more than those records added up.

In what order are the techniques tried?

The order is: naked singles, hidden singles, pointing pairs, box/line reduction, naked pairs, hidden pairs, naked triples, X-Wing, Swordfish, XY-Wing, simple coloring and unique rectangles. Killer puzzles also have two cage techniques, one in tier 1 and one in tier 3, which slot in at their tier. The order roughly follows how much work each technique takes a person, and it has two consequences.

First, the grade reflects the hardest wall the puzzle puts up. The engine moves to a technique from a higher tier only when every cheaper one has run dry, so the tier is not inflated by the solver taking a needlessly expensive route. Second, the usage counts depend on the order. Pointing pairs come before box/line reduction in the list, so when both apply the engine takes the pointing pair. The frequency guide notes that, in the Medium pool, pointing pairs were used by 952 puzzles and box/line reduction by 301. That gap reflects the ordering as much as the usefulness of the two patterns.

What does a graded solve look like?

Here is the loop in words, as an illustration and not a record of one particular puzzle. The engine places every naked single and hidden single it can find, restarting from the top of the list after each one. Eventually the board has no more singles. It then looks for a pointing pair, and suppose it finds one: a digit confined to two cells of a box that share a row, so the digit is removed from the rest of that row. That is a tier 2 step, so the puzzle is now at least Medium. The removal may create new singles, and the engine returns to them at once, because singles are cheaper than anything else.

Later the board stalls again and no pair technique applies either. The engine reaches naked triples, finds nothing, and then finds an X-Wing. The puzzle is now at least Hard. If the grid fills without anything above tier 3, the final grade is Hard, even though most of the work was singles and a single pointing pair. The other four techniques in the list were never needed, so they never touched the grade.

How does a generated puzzle end up in a tier?

Puzzles are produced offline, never in your browser. The generator builds a complete valid grid, then removes clues one at a time in random order. After each removal it runs two checks, and it keeps the removal only if both pass: the puzzle must still have exactly one solution, and the technique solver must still be able to finish it using techniques no higher than a target tier. When no more clues can be removed, the puzzle is irreducible under that cap, so it needs the cap’s level of technique and has no spare clues.

Setting a target does not decide the result. After carving, the generator grades the finished puzzle with the full set of techniques and files it under the tier it actually earned. It aims for whichever tier’s pool is emptiest, and puzzles that land in a pool that is already full are discarded. Duplicates are skipped. The details of the grid construction and the solution counter are in how puzzles are generated and verified unique.

The grade is also checked after the fact. The continuous-integration gate re-solves every stored puzzle, counts its solutions and grades it again. It fails if any puzzle has other than exactly one solution, or if the fresh grade does not match the tier the puzzle is stored under. A pool cannot drift away from the grading without the build failing.

Why is Evil defined the way it is?

Evil is the top tier, and it is the least tidy one. It is defined as needing a unique rectangle or something beyond the twelve techniques. A unique rectangle is a shortcut with a catch: it removes a candidate because keeping it would let four cells swap two digits and produce a second solution, and a valid puzzle has only one. The shortcut is only sound if the puzzle really is unique and only for the plain geometry of boxes, rows and columns. The engine therefore applies it only there, and the unique rectangles lesson explains when it is safe to use by hand.

In the classic pool every one of the 1,000 stored Evil puzzles used at least one unique rectangle, which is the definition showing up in the data. The variants do not all have an Evil level. Where a variant’s generated puzzles were all solvable at Expert or below, the page offers no Evil level, because a label with nothing behind it would be misleading.

How do hints use the same engine?

Hints run on the same solver. When you ask for one, the engine looks at the numbers currently placed on the board and finds the cheapest technique that applies. It does not read your pencil marks, and it does not peek at the stored solution. That keeps a hint honest: it shows a step you could have found from the placed digits, and it names the technique so you can look it up. The first hint level points to the area, the second names the technique, and the third gives the move. If nothing in the engine applies, the hint says so instead of inventing a reason. A hint is a small lesson, and hints are switched off in expert mode.

What does this grading not measure?

The levels also differ in coverage. Not every variant has five tiers. The 4×4 board has a single tier, the 6×6 and 16×16 boards have two, and killer has three, so a variant’s page states which levels it offers.

How can a player use the grading?

Treat the level as a statement about which techniques you will be asked for. If Medium feels stuck, check the Medium row of the table and make sure you know all four of its techniques. If Hard stalls, learn naked triples and X-Wing next. The strategy guide for each difficulty turns that into a practice order, and the guides hub lists the rest of the tutorials. When you are ready to test it, pick a level on the home page and play a puzzle graded by the method above.