Unique rectangles

By Sudoku Online Editorial Team ·

unique rectangles: Three corners of this rectangle hold only 4/6. If r2c9 were also 4 o…Three corners of this rectangle hold only 4/6. If r2c9 were also 4 or 6, the four cells could swap those digits and the puzzle would have two solutions. A valid puzzle has one, so those digits are removed from r2c9. Pattern cells: r2c1, r2c9, r3c1, r3c9. Candidates removed: 4 from r2c9, 6 from r2c9.146546951464683972461637276581516352988193458167
Three corners of this rectangle hold only 4/6. If r2c9 were also 4 or 6, the four cells could swap those digits and the puzzle would have two solutions. A valid puzzle has one, so those digits are removed from r2c9.

A unique rectangle is a deduction that rests on one extra fact: the puzzle has exactly one solution. If three corners of a rectangle hold only the same two candidates, say 4 and 6, then letting the fourth corner be 4 or 6 would let the four cells swap those digits and produce a second solution.

A valid puzzle cannot allow that, so 4 and 6 are removed from the fourth corner. On this site every Evil puzzle needs this technique or something beyond it.

A technique that uses the promise of uniqueness

Every other technique in this series uses only the rules of Sudoku: each row, column and box holds each digit once. The unique rectangle also uses a property of well-made puzzles, that they have a single solution. That is a real promise for the puzzles on this site, because every stored puzzle is checked by the solution counter to have exactly one solution. It is not a promise you can lean on for a puzzle of unknown origin, where a deduction built on it could remove a candidate that a multi-solution grid actually needs.

The diagram above is a real position from this site's Evil pool, drawn by the technique engine. The caption reads: three corners of this rectangle hold only 4 and 6; if r2c9 were also 4 or 6, the four cells could swap those digits and the puzzle would have two solutions; a valid puzzle has one, so those digits are removed from r2c9. Notation is row first, then column, counted from the top left.

The shape of the pattern

The pattern needs four empty cells at the corners of a rectangle: two rows and two columns. The four corners must lie in exactly two boxes, so the rectangle spans two boxes, either side by side or one above the other. If it spanned four boxes, the swap argument below would not hold. In the simplest version, the one this site's engine implements, three of the four corners have exactly the same two candidates, X and Y, and the fourth corner has X and Y among its candidates plus others.

The swap argument

Imagine the fourth corner were X or Y. Then the four corners could be filled with only X and Y in the pattern X Y over Y X (or the reverse). Because the corners sit in two rows, two columns and two boxes, the swap that exchanges X and Y in all four cells keeps every row, column and box valid, since each of those groups contains exactly two of the corners, one X and one Y either way. So if one arrangement solves the puzzle, the swapped arrangement solves it too, and the puzzle would have two solutions. Since the puzzle has one, the fourth corner cannot be X or Y. It must be one of its other candidates.

How to find them

  1. Fill in candidate notes.
  2. List the cells with exactly two candidates and look for three of them that share the same pair and lie at three corners of a rectangle.
  3. Check that the rectangle covers exactly two boxes.
  4. Confirm that the fourth corner is empty and lists both digits of the pair.
  5. Remove the pair's digits from the fourth corner.

An easy first filter is to look for pairs of identical bivalue cells in the same row or the same box, then check whether a third copy sits in a matching column.

Common mistakes

Where the site's grading needs it

Unique rectangles are the top tier of this site's grading. Evil is defined as needing unique rectangles or techniques beyond the implemented set. In the committed frequency data over 1,000 stored classic puzzles per tier, a unique rectangle was used in 0 puzzles at Easy, Medium, Hard and Expert, and in all 1,000 Evil puzzles. That is by construction: the grader assigns Evil to the puzzles that need this step. Each puzzle is solved cheapest technique first and a technique counts if used at least once. See how difficulty is graded for the method and its limits, and the frequency guide for the full table.

What "Evil" does and does not mean here

The Evil label on this site means that the engine could not finish the puzzle with the lower tiers alone. It says nothing about how long a person will take, and a human who knows other methods may finish an Evil puzzle without unique rectangles. It is a grading by the site's own technique set, not an industry standard, and a puzzle can be Evil for the engine while feeling easy to someone who spots a different route.

Variants where it is switched off

The engine applies unique rectangles only when a board has nothing but rows, columns and regions as groups: no cage sums and no extra constraint groups. That covers the classic board and the plain size variants, including the irregular board, where "region" means a jigsaw shape. On boards with extra rules, such as the diagonal, hyper, anti-knight and killer boards, the additional groups can interfere with the swap argument, so the technique is not used. Several of those constrained boards offer no Evil tier at all: in this site's generated pools, every puzzle on them was solvable at Expert or below, so there was nothing honest to label Evil.

A worked example

Read the diagram. Three corners of the rectangle show only 4 and 6. The fourth corner, r2c9, shows 4 and 6 among other digits. Suppose r2c9 were 4. Then the two corners that share a row or a column with it would have to be 6, and the corner diagonally opposite would be 4. Every row, column and box involved would be satisfied, and so would the arrangement with 4 and 6 swapped. Two valid fillings of the same rectangle means two solutions to the puzzle. The same holds if r2c9 were 6. So r2c9 loses 4 and 6 and keeps whatever else it listed. If it had only those two plus one more digit, it is now a naked single.

Check your understanding

The answers: only 9; no, since the swap would break box rules; and because it relies on the puzzle having a single solution rather than on the row, column and box rules alone.

Practice

Try an Evil puzzle on the main board. When every other technique stalls, scan the bivalue cells for three matching ones at the corners of a rectangle. The level-two hint names the technique when a unique rectangle is the cheapest step available. If you use the expert mode, hints are disabled, so this is one to know by heart.

Previous: simple coloring. Back to the technique list, or read how puzzles are generated and verified unique.