# The Unique Rectangle

The Unique Rectangle is different from every other technique on this site. It doesn't follow from the rules of sudoku alone. It follows from one extra fact: a proper puzzle has exactly one solution. Used with that in mind, it is one of the most productive advanced techniques there is.

## The deadly pattern

Picture four cells at the corners of a rectangle, in **two rows, two columns and exactly two boxes**, all holding the same two candidates, say 4 and 9. Once everything else is solved, these four cells could still be filled two ways: 4 on one diagonal and 9 on the other, or the other way round.

Swapping them changes nothing else. Each row, each column and each box involved contains two of the four cells, one 4 and one 9, before and after the swap. So if the four cells ever ended up like this, the puzzle would have two solutions. Solvers call this a **deadly pattern**.

_Diagram: A deadly pattern: four cells in two rows, two columns and two boxes (shaded), all with only 4 and 9. The 4s and 9s could be swapped, so a puzzle with one solution never ends up like this._

## Type 1: three corners are pairs

Now suppose three of the corners hold only 4 and 9, and the fourth holds 4, 9 and something else. If the fourth corner became 4 or 9, the deadly pattern would be complete. A puzzle with one solution can't allow that, so **4 and 9 can be removed from the fourth corner**.

In the diagram, r1c2, r1c7 and r3c2 each hold 4 and 9. The fourth corner, r3c7, holds 4, 6 and 9. Removing 4 and 9 leaves r3c7 with a single candidate: it must be 6.

_Diagram: Unique Rectangle type 1. Three corners hold only 4 and 9, so the fourth corner, r3c7, can't be 4 or 9. It must be 6._

Type 1 is the most common unique rectangle and the easiest to spot. Whenever you see two cells with the same pair in one box, such as a [naked pair](https://drop.top/apps/sudoku/naked-pairs/), glance along their rows and columns for a matching pair in a second box.

## Type 2: the same extra digit

Sometimes two corners hold only the pair, and the other two hold the pair plus the **same single extra digit**. Below, r4c1 and r4c3 hold 2 and 5, while r8c1 and r8c3 hold 2, 5 and 7. If neither of the lower two were 7, all four corners would be 2 or 5: the deadly pattern again. So one of r8c1 and r8c3 is 7, and any cell that sees both can't be 7.

_Diagram: Unique Rectangle type 2. One of r8c1 and r8c3 (yellow) must be 7, so r8c6 (same row) and r9c2 (same box) lose their 7._

## Type 4: a forced pair digit

Type 4 also starts with two corners holding only the pair, say 2 and 5. The other two corners share a row (or column) and hold 2, 5 and at least one extra candidate. Now check that row: if 2 appears in it **only in those two corners**, one of them must be 2.

Then neither can be 5. If one were 5, the other would be the 2, and all four corners would hold only 2 and 5. So you can remove 5 from both of those corners. The same works if the forced digit lives in a shared box rather than a row.

## The honest caveat

Every unique rectangle rests on one assumption: **the puzzle has exactly one solution**. If it has several, the deduction can remove a candidate that every solution needs, and you may hit a contradiction later. On puzzles of unknown origin, such as a hand-made grid or a page torn from an old magazine, use it with care.

Well-made puzzles are checked, usually by computer, to have one solution, so the assumption holds (see [how sudoku puzzles are made](https://drop.top/apps/sudoku/how-sudoku-puzzles-are-made/)). Every puzzle in [Graphite Sudoku](https://drop.top/apps/sudoku/) is generated that way. Some solvers still avoid uniqueness techniques on principle, preferring a proof that uses only the rules; that is a matter of taste, not of correctness.

## Common mistakes

- **Four boxes instead of two.** A rectangle spread over four boxes is not deadly: swapping would leave two 4s or two 9s in a box.
- **A clue as a corner.** All four corners must be empty cells. If one is a given, the swap would change a clue, so there is no second solution and no deduction.
- **Removing the extras.** In type 1, only the two pair digits leave the fourth corner; its other candidates stay.

## Questions

### Is the unique rectangle a valid technique?

Yes, on any puzzle with exactly one solution, which includes every properly made sudoku. It is not valid on puzzles that might have several solutions.

### Why does a unique rectangle need two boxes?

With two boxes, each box holds two corners, so swapping the pair keeps every box correct. Across four boxes, a swap would put the wrong digits in a box, and there would be no second solution.

### What is a deadly pattern in sudoku?

A group of cells whose candidates could be swapped without affecting the rest of the grid. A puzzle with one solution can never contain one, which is what uniqueness techniques exploit.

### Are there other unique rectangle types?

Yes. Types 3, 5 and 6 exist, as well as hidden rectangles. Type 1 is the one you will meet most often, and types 2 and 4 are the next most useful.
