Sudoku Solving Techniques: The Logic Ladder Our Generator Has to Guarantee

You are stuck on a grid with two empty cells left in a row and no instinct for which digit goes where. Guessing feels natural here, and on our puzzles it is never required. Every board our Sudoku engine ships has been checked to have exactly one solution, so a logical deduction always exists. This article walks the technique ladder in a fixed order, the same ladder the engine's uniqueness guarantee makes sufficient.

How our generator guarantees a solvable puzzle

The engine fills a blank 9x9 board with a backtracking search. It walks cells in order, tries the digits 1 through 9 in a shuffled order, and undoes a placement when nothing fits downstream. The shuffle comes from a seeded linear congruential generator, so every run builds a different solved grid.

Then it removes digits to create the puzzle. All 81 positions are shuffled again, and cells are emptied one at a time. A removal survives only when the puzzle still has exactly one solution, verified by a solver that counts solutions and stops the moment it finds a second. Removal halts at the difficulty target: 38 givens for easy, 30 for medium, 24 for hard.

That check matters to you as a player. If a puzzle can have two solutions, some cell must be ambiguous, and guessing would be legitimate. Because the engine rejects every puzzle with a second solution, ambiguity never survives generation, and pure logic always carries you to the end.

Technique 1: last remaining cell

This is the only technique that needs no pencil marks.

1. Scan a single row, column, or 3x3 box.

2. Count the filled digits.

3. If eight of the nine digits are present, write the missing digit into the ninth cell.

Run this over all 27 units before anything slower. Easy puzzles with 38 givens often crack open on this pass alone.

Technique 2: crosshatching

1. Pick one digit d that is missing from one 3x3 box.

2. Look at the three rows crossing that box. If d already sits in two of them, d must sit in the third row inside the box.

3. Repeat for the three columns crossing the box.

4. If exactly one empty cell in the box lies on the surviving row and the surviving column, write d there.

Crosshatching is the workhorse between 30 and 38 givens. Work digit by digit, 1 through 9, and restart from digit 1 after every placement, because each new digit changes what the rows block.

Technique 3: hidden single

1. Choose one unit: a row, a column, or a box.

2. For one candidate digit d, collect every empty cell in that unit where d does not conflict with the row, column, or box containing the cell.

3. If exactly one cell collects, write d there.

The digit hides because other candidates also fit that cell. The unit-by-unit count is what exposes it.

Technique 4: naked pair

1. Find two cells in the same unit whose pencil marks hold exactly the same two digits.

2. Delete those two digits from every other cell in that unit.

The pair consumes both digits even though you do not know which cell takes which. Any third cell holding one of the pair's digits would make the pair unsatisfiable.

Technique 5: pointing pair

1. Inside one 3x3 box, take a candidate d and look at all cells that could hold it.

2. If those cells all share one row, or all share one column, d in that box is bound to that line.

3. Delete d from every cell of that row or column outside the box.

Technique 6: X-Wing

1. Pick a candidate d.

2. Find two different rows where d fits in exactly two cells each.

3. Check whether those four cells span exactly two columns.

4. If they do, delete d from every other cell in those two columns.

Whichever of the two rows holds d, one of the two chosen columns must carry it, so no other cell in those columns can. The mirror rule with rows and columns swapped also holds. Expect to need X-Wing on our hard tier with 24 givens.

Pencil marks the way the game implements them

Our game stores notes as a 10-slot boolean array per cell, one slot per digit. Toggle notes mode, select a cell, and mark candidates. The maintenance loop is deterministic:

1. Fill pencil marks for every empty cell once, at the start.

2. After each placed digit, remove that digit from the marks of every cell in the same row, column, and box.

3. Re-scan in fixed order: last remaining cell, hidden single, naked pair, pointing pair, X-Wing.

4. Stop when the grid is full or no rule fires.

If no rule fires and the grid is not full, you missed an elimination somewhere, because the puzzle has exactly one solution. Audit the unit with the fewest empty cells first.

What the error flag catches, and what it misses

The engine marks a cell as an error only when the same digit appears twice in one row, column, or box. It never compares your entries against the stored solution. A wrong digit that creates no duplicate passes silently. Treat the absence of flagged cells as evidence of no duplicates, and treat a completed grid as the only proof of correctness.

Honest downsides

  • The 24-given hard tier stalls scanning-only solvers. Plan on pairs and X-Wing.
  • The initial pencil mark pass is the slowest manual step. On a hard board you mark 57 cells before the first deduction lands.
  • Backtracking has exponential worst-case cost. Our engine pays that cost at generation time inside the uniqueness check, which is why removing cells dominates puzzle creation.
  • Guessing as a player destroys your error trail. A wrong branch can sit quietly for many placements before a duplicate surfaces, and undoing to the branch point is guesswork of its own.

Checklist

  • [ ] Confirm the puzzle source guarantees a single solution.
  • [ ] Fill pencil marks once, then maintain them after every placement.
  • [ ] Apply rules in fixed order: last cell, hidden single, naked pair, pointing pair, X-Wing.
  • [ ] Read the error flag as duplicate detection only.
  • [ ] Never guess while any rule still fires.

If you solve on our site, your best time per difficulty is stored in your browser under the key sudoku_best and never leaves your machine. Compare your times against the tiers and tell us which technique unlocked your last hard puzzle. Start the ladder on a board from our [Sudoku game](/en/sudoku), where the engine has already proven the solution is unique.