Z Zeloku

Advanced technique · also called xy wing sudoku

XY-Wing

Also known as: xy wing sudoku · y wing

An XY-Wing is a three-cell chain — a pivot with two candidates and two pincers, each sharing one candidate with the pivot and one shared 'link' digit with each other — that eliminates the link digit from any cell that sees both pincers.

The intuition

The pivot cell has exactly two candidates, X and Y. It must eventually be one or the other. Each pincer shares a unit with the pivot and has candidates {X, Z} or {Y, Z} — the same link digit Z, paired with whichever of X or Y it shares with the pivot. If the pivot turns out to be X, the pincer that shares X with it can't also be X, so it's forced to Z. If the pivot is Y instead, the other pincer is forced to Z. Either way, Z appears in one of the two pincers — so any cell that can see both pincers can never be Z, no matter which branch is true.

When you'll use it

XY-Wing is usually the first 'chain' technique solvers learn, and it appears in most Expert puzzles that don't yield to X-Wing or Swordfish alone. It's a different kind of reasoning from the fish family — case analysis across three cells rather than counting across lines — and it's the gateway to Coloring and forcing chains.

How to spot a XY-Wing

  1. Find a cell (the pivot) with exactly two candidates, {X, Y}.
  2. Find a cell sharing a unit with the pivot that has candidates {X, Z} — one candidate matching the pivot, one new digit Z.
  3. Find a second cell, sharing a different unit with the pivot, with candidates {Y, Z} — the same new digit Z.
  4. Any cell that shares a unit with BOTH pincers cannot be Z — eliminate it there.

Why the XY-Wing logic works

The pivot must be X or Y — there's no third option. Case 1: pivot = X. The first pincer shares a unit with the pivot and therefore can't also be X, so it must be Z (its only other candidate). Case 2: pivot = Y. By the same logic the second pincer is forced to Z. In both cases, one of the two pincers ends up being Z — you just don't know which one until the rest of the puzzle resolves. But a cell that sees both pincers would conflict with whichever one turns out to be Z, so it can never be Z regardless of which case is true.

A worked XY-Wing example

Pivot R5C5 = {2, 7}. Pincer R5C2 (same row) = {2, 9}. Pincer R2C5 (same column) = {7, 9}. If R5C5 = 2, then R5C2 can't be 2 (same row), so R5C2 = 9. If R5C5 = 7, then R2C5 can't be 7 (same column), so R2C5 = 9. Either way, a 9 lands in R5C2 or R2C5 — so R2C2, which shares column 2 with R5C2 and row 2 with R2C5, can never be 9.

348165 97 92 92 7
Pivot R5C5 holds {2,7}. Pincer R5C2 (same row) holds {2,9}; pincer R2C5 (same column) holds {7,9}. Whichever way the pivot resolves, a 9 lands in one pincer or the other — so R2C2, which sees both, cannot be 9.

Walkthrough

R5C5 has exactly two candidates, {2, 7} — that qualifies it as the pivot. Two other cells each share a unit with it and each share exactly one of its candidates plus one new digit.

R5C2 shares row 5 with the pivot and has candidates {2, 9} — matching on 2, with 9 as the link digit. R2C5 shares column 5 with the pivot and has candidates {7, 9} — matching on 7, with the same link digit 9.

Run both branches: if R5C5 ends up being 2, R5C2 is blocked from 2 by the row rule and must take 9. If R5C5 ends up being 7, R2C5 is blocked from 7 by the column rule and must take 9. There's no third possibility for the pivot, so one of these two branches is guaranteed.

R2C2 sits in both column 2 (with R5C2) and row 2 (with R2C5) — it sees both pincers. Since one of those two pincers is definitely a 9 in every valid solution, R2C2 can never be 9, regardless of which branch actually happens.

How to drill this technique

On an Expert puzzle, list every cell with exactly two candidates — these are your only possible pivots. For each one, check its row, column and box for a cell sharing exactly one candidate plus a new digit. If you find two such cells that share the same new digit, check for a cell that sees both. This is the slowest technique to do by hand; expect ten to fifteen minutes the first few times.

Common mistakes

  • Forgetting that the two pincers must NOT need to share a unit with each other — only the pivot needs to see both of them individually.
  • Eliminating the link digit from the pincers themselves. The elimination only applies to a third cell that sees both pincers, never to the pivot or pincer cells.
  • Using a pivot with more than two candidates. If the pivot has a third candidate, the case analysis breaks — there's a third branch where neither pincer is forced to Z.

FAQ

Why is it sometimes called Y-Wing instead of XY-Wing?

They're the same technique. 'Y-Wing' is a shorthand some solvers use because the pivot's two candidates are usually labelled X and Y, and the pattern forms a wing shape with the two pincers. XY-Wing is the more common name in most technique guides.

Do the two pincers need to see each other?

No — that's the key difference from simpler techniques. The pivot must see both pincers, but the pincers themselves can be anywhere on the board relative to each other. Only the elimination target needs to see both pincers.

What's the difference between XY-Wing and XYZ-Wing?

XYZ-Wing adds a third candidate to the pivot, so the pivot itself also becomes an elimination target in some cases. It's a direct extension of XY-Wing and uses the same pincer-finding process, just with one extra branch to track.

Can XY-Wing place a digit directly?

No — like most intermediate and advanced techniques, XY-Wing only eliminates a candidate. It doesn't tell you what the pivot or pincers actually are, only that a specific third cell can't be a specific digit. That elimination usually exposes a Hidden Single or Naked Single nearby.

Is XY-Wing harder than Swordfish?

They're different kinds of hard. Swordfish requires spotting a counting pattern across three lines, which is tedious but mechanical. XY-Wing requires tracking a conditional (if/then) argument across three specific cells, which many solvers find more mentally demanding even though fewer cells are involved.

What to learn next

Once XY-Wing feels natural, move on to Hidden Single — it builds directly on the candidate-tracking habits you've just developed. Or revisit the full Sudoku techniques library to see the full progression from beginner to advanced.