Puzzle Maker Online

Unique Rectangle in Sudoku: The Deadly Pattern Explained

Unique Rectangle in Sudoku: The Deadly Pattern Explained

A unique rectangle is four cells sitting at the corners of a rectangle across two rows, two columns and exactly two boxes, all containing the same two candidates; because that arrangement would give the puzzle two valid solutions, at least one corner has to break the pattern, and that forced break is what you eliminate on. It is the one mainstream sudoku technique that reasons about the puzzle rather than about the grid.

Every other technique you know, from hidden singles to swordfish, only uses the rules of sudoku. A unique rectangle uses an extra assumption: that the puzzle was built to have exactly one answer. That makes it powerful and slightly controversial, and it makes understanding the underlying logic more important than memorizing the types.

The deadly pattern, and why it cannot exist

Picture four cells: r2c4, r2c5, r6c4 and r6c5. Suppose in a finished grid r2c4 is 3, r2c5 is 7, r6c4 is 7 and r6c5 is 3. Now swap every 3 and 7 among those four cells: r2c4 becomes 7, r2c5 becomes 3, r6c4 becomes 3, r6c5 becomes 7.

Check the constraints. Row 2 still has one 3 and one 7. Row 6 still has one 3 and one 7. Column 4 still has one of each. Column 5 still has one of each. Box 2 contains r2c4 and r2c5, and it still holds one 3 and one 7. Box 5 contains r6c4 and r6c5, same story. Nothing anywhere else in the grid changed.

So if those four cells only ever had 3 and 7 available to them, the puzzle has at least two solutions. A properly constructed sudoku has one. Therefore the situation is impossible, and one of the four cells must be something other than 3 or 7. That impossible arrangement is what solvers call the deadly pattern, and every unique rectangle technique is a different way of cashing in on the fact that it cannot happen.

The four conditions, all mandatory

Before you eliminate anything, confirm all four of these. Getting one wrong produces a false elimination, and false eliminations in a hard puzzle are painful to unwind.

  1. Four cells at the corners of a rectangle. Exactly two rows and exactly two columns.
  2. Exactly two boxes. The rectangle must lie inside a horizontal band of three boxes or a vertical stack of three boxes, so that each of the two boxes holds two of the corners. r2c4, r2c5, r6c4, r6c5 spans boxes 2 and 5, which is fine. r2c4, r2c8, r6c4, r6c8 spans boxes 2, 3, 5 and 6, which is not.
  3. The same two candidates in all four corners. Two corners may hold extra candidates on top of that pair, which is exactly what the different types are about, but the shared pair must be present in all four.
  4. No corner is a given clue. Givens are fixed by the puzzle setter, so the swap argument does not apply to them. Cells you filled in yourself during the solve are fine, and that is the basis of the avoidable rectangle further down.

Condition 2 is the one people skip. Here is why it matters. When the rectangle spans two boxes, each box holds two corners in different rows, so the swap keeps one 3 and one 7 in each box. When it spans four boxes, each box holds a single corner, and the swap changes what that box contains. The second grid might then be illegal, so no second solution is guaranteed, and the whole argument evaporates.

Type 1: three bivalue corners, one corner with extras

This is the common case and the easiest to apply.

Suppose r2c4, r2c5 and r6c4 all hold exactly {3, 7}, and r6c5 holds {3, 5, 7, 9}.

Three corners cannot be anything but 3 or 7. If r6c5 also resolved to a 3 or a 7, all four corners would be filled from the pair alone and the deadly pattern would exist. So r6c5 must be one of its extra candidates.

Eliminate 3 and 7 from r6c5, leaving it as {5, 9}. That single move converts a four-candidate cell into a bivalue cell, which often feeds straight into a naked pair or a wing.

Type 1 is worth hunting for specifically, because it is the only type where you strike out both UR digits at once.

Type 2: two corners with the same single extra

Now suppose r2c4 and r2c5 both hold {3, 7}, and r6c4 and r6c5 both hold {3, 7, 9}. The two corners carrying the extra share the same extra digit.

The floor corners in row 2 are locked to 3 and 7 in some order. If both roof corners in row 6 also took values from {3, 7}, the pattern would be deadly. So at least one roof corner must be 9. Since only one 9 can appear in row 6 anyway, exactly one of them is 9, and you do not know which.

That is a classic "the digit is in one of these two cells" conclusion. Any cell that sees both r6c4 and r6c5 cannot be 9. Those two cells share row 6 and box 5, so 9 comes out of every other cell in row 6 and every other cell in box 5.

Type 2 is the highest-yield version. A single instance can strip a candidate from a dozen cells.

Type 3: two corners with different extras

Suppose r2c4 and r2c5 hold {3, 7}, while r6c4 holds {3, 5, 7} and r6c5 holds {3, 7, 9}. The extras are now different: 5 in one corner, 9 in the other.

The same reasoning applies. At least one roof corner must escape the pair, so between them, r6c4 and r6c5 must supply at least one of 5 or 9. Treat that as a pseudo-cell holding {5, 9} sitting in row 6 and box 5.

Now look for a subset in one of those houses that combines with the pseudo-cell. If r6c8 holds exactly {5, 9}, then the pseudo-cell and r6c8 form a naked pair on {5, 9} within row 6, and 5 and 9 come out of every other cell in row 6. If instead you find two cells in box 5 holding {5, 2} and {9, 2}, the pseudo-cell joins them as a naked triple on {2, 5, 9}, and those three digits leave the rest of box 5.

The mental trick is to stop thinking of the roof as two cells with extras and start thinking of it as one virtual bivalue cell.

Type 4: a locked UR digit in the roof

This one runs the argument in reverse and eliminates one of the pair digits rather than an extra.

Suppose r2c4 and r2c5 hold {3, 7}, and r6c4 and r6c5 hold {3, 7} plus whatever extras. Now check row 6: if the candidate 7 appears nowhere in row 6 except r6c4 and r6c5, then 7 is locked into the roof.

Here is the consequence. Suppose one of the roof corners resolved to 3. Since 7 must occupy one of the two roof cells, the other roof cell would then be 7. The roof would be 3 and 7, the floor is already restricted to 3 and 7, and you are back in the deadly pattern. So neither roof corner can be 3.

Eliminate 3 from both r6c4 and r6c5. You can run the same check on the box instead of the row, and on candidate 3 instead of 7, in which case you eliminate 7.

The four types at a glance

Type Corner shape What you conclude What you eliminate
1 Three bivalue, one with extras The odd corner must take an extra Both UR digits from that one corner
2 Two bivalue, two sharing one extra One roof corner holds the extra The extra from every cell seeing both roof corners
3 Two bivalue, two with different extras The roof acts as a pseudo-cell of the extras Subset eliminations in the shared house
4 Two bivalue, one UR digit locked in the roof The other UR digit cannot sit in the roof That digit from both roof corners

Hidden unique rectangles

A hidden unique rectangle uses strong links instead of restricted candidate lists, which lets it fire when the ordinary types will not.

Take r2c5, r6c4 and r6c5 all holding {3, 7}, and r2c4 holding {3, 7} plus extras. Look at r6c5, the corner diagonally opposite the one with extras. Suppose 7 appears only in r6c4 and r6c5 within row 6, and 7 appears only in r2c5 and r6c5 within column 5. Two strong links, both on 7, both passing through the diagonal corner.

Assume r2c4 is 3. Then r2c5 must be 7. The column 5 link then forces r6c5 to be 3, and the row 6 link forces r6c4 to be 7. Every corner has now landed on 3 or 7, the swap is available, and the puzzle has two solutions. Contradiction. Eliminate 3 from r2c4.

Hidden rectangles are harder to see because you have to notice the strong links first, but they show up in puzzles where every corner carries extra pencil marks and the standard types are dead.

Avoidable rectangles

An avoidable rectangle applies the same logic to cells you have already solved. It works because the deadly pattern is about givens, not about what is currently written in the grid.

Suppose you have already placed r2c4 = 3, r2c5 = 7 and r6c4 = 7 during the solve, and none of those three were clues in the original puzzle. Now r6c5 is still open with 3 among its candidates. If r6c5 turned out to be 3, then all four corners would be non-given cells holding only 3s and 7s in rectangle formation, and the swapped grid would be a second valid solution.

Eliminate 3 from r6c5. You need to be certain the three filled corners were not givens, which is why it helps to work from a printed grid where the clues are visually distinct from your own entries. Grids from our sudoku puzzle generator print the clues in a heavier weight for exactly this reason.

BUG+1, the other uniqueness shortcut

The bivalue universal grave is a cousin worth knowing because it ends puzzles instantly. If you reach a position where every unsolved cell has exactly two candidates, and every digit appears exactly twice in every row, column and box, the remaining grid has two solutions. So that position cannot be reached.

In practice you spot it one step early: every unsolved cell is bivalue except one, which has three candidates. Look at which of that cell's three candidates appears three times in its row, column and box rather than twice. That digit is the answer for that cell. Place it and the whole grid usually falls apart into singles.

How to find rectangles quickly

Scanning cell by cell is slow. Scan by candidate pair instead.

  1. Sweep the grid and note every bivalue cell together with its pair, for example "{3,7} at r2c4, r2c5, r6c4".
  2. Any two cells with the same pair in the same row are half a rectangle. The same goes for the same column.
  3. Extend to the other two corners and check whether they contain both digits, with or without extras.
  4. Confirm the two-box condition and that no corner is a given.
  5. Classify by counting extras: no extras in three corners means Type 1, matching extras in two corners means Type 2, different extras means Type 3. If none of those fit, check for a locked digit and try Type 4.

Because you are matching on pairs, the sweep is quick even on a heavily penciled grid, and the candidate pairs you collect are useful for spotting naked pairs and XY-Wings at the same time.

When you should not use it

The technique assumes exactly one solution. That assumption is safe for puzzles from generators and reputable publishers, which validate uniqueness before publishing. It is not safe in three situations.

Hand-made puzzles from unverified sources. A grid put together by a person without a solver check may genuinely have multiple solutions, and uniqueness logic will lead you to a wrong answer that still looks consistent.

When you are testing a puzzle you built. If your goal is to find out whether a grid is unique, you obviously cannot assume it is.

Competitive settings that ban it. Some tournaments and some solvers consider uniqueness reasoning outside the spirit of the game, on the grounds that you are using information about the puzzle rather than information in it. That is a taste question, not a correctness question, but it is worth knowing before you argue about it.

Everywhere else, unique rectangles are a legitimate and very efficient tool, and Type 2 in particular removes more candidates for less work than almost anything else at that difficulty level.

Frequently Asked Questions

Why does a unique rectangle need to span exactly two boxes? Because the two-solution argument depends on swapping the pair digits without breaking any house. With two boxes, each box holds two corners in different rows, so the swap leaves one of each digit in each box. With four boxes, each box holds one corner and the swap changes its contents, so no second solution is guaranteed.

Can a corner of a unique rectangle be a given clue? No. A given is fixed, so the swapped grid would contradict the puzzle statement rather than being an alternative solution. Cells you filled in yourself are fine, and that is what avoidable rectangles rely on.

Is using unique rectangles cheating? It is a matter of preference. The logic is sound for any puzzle with a guaranteed single solution, which covers virtually every published sudoku. Some solvers prefer to use only techniques derived from the grid itself, and some puzzle competitions discourage it.

Which unique rectangle type appears most often? Type 1 is the easiest to see and Type 2 is the most productive. Type 2 tends to give the largest number of eliminations from one pattern, because it removes a candidate from every cell in the two houses shared by the roof corners.