Ready to play?

Play Sudoku!

XY-Chain Sudoku Technique

DiabolicalClassic + KillerStep 25 of 374 min read

An XY-Chain is a row of two-candidate cells, each one seeing the next, arranged so that the same digit sits at both ends. One of those two ends must hold that digit, so any cell seeing both ends can drop it.

What the pattern is

A bivalue cell is a cell with exactly two candidates left. It is a switch: rule one digit out and the other is forced. Line those switches up and the force travels.

Start with a cell holding {z,a}. Its neighbour holds {a,b} and sees it. The next holds {b,c} and sees that one, and so on, until the last cell holds {y,z} — back to the digit you began with. Each cell shares its link digit with the cell before it and passes a new digit forward.

Now suppose the first cell is not z. Then it is a, so the second cell cannot be a and must be b, so the third cannot be b, and the wave runs to the far end, where the last cell is forced to z. Either the first end is z or the last end is z. There is no third option, and every cell that sees both ends loses z.

Y-WingXY-Chain
Cells involvedExactly threeThree, four, five or more
ShapeA pivot with two pincersAn open path with two ends
RequirementBoth pincers see the pivotEach cell sees only its neighbour
EndsThe two pincersThe two end cells
EliminationsThe shared digit, from cells seeing both pincersThe end digit, from cells seeing both ends

A Y-Wing is simply the shortest useful XY-Chain, which is why the elimination rule reads the same.

When to look for it

  • The grid is full of bivalue cells and nothing else is producing.
  • Two bivalue cells far apart share a digit, and you can see a path of bivalue cells between them.
  • A digit keeps almost resolving. Chains are strongest on digits that appear in many two-candidate cells.

How to apply it, step by step

  1. Mark every bivalue cell in the grid.
  2. Pick a starting cell and choose one of its two digits as z, the digit you hope to eliminate.
  3. Step to a bivalue cell that sees it and shares the other digit.
  4. Keep stepping, each time sharing the digit the previous cell passed forward, never repeating a cell.
  5. Stop when the current cell's second digit is z again. The chain is closed.
  6. Delete z from every cell that sees both end cells.

A worked example

Four bivalue cells, each seeing the next one:

Example
r1c1 {4,7} -- row 1 -- r1c6 {7,2} -- col 6 -- r4c6 {2,9} -- row 4 -- r4c9 {9,4}

If r1c1 is not 4 it is 7
   -> r1c6 is 2   -> r4c6 is 9   -> r4c9 is 4

So r1c1 is 4, or r4c9 is 4, or both. The chain's ends are r1c1 and r4c9, and 4 is the end digit.

Which cells see both ends? Cell r1c9 shares row 1 with r1c1 and column 9 with r4c9. Cell r4c1 shares column 1 with r1c1 and row 4 with r4c9. Neither can be 4, so 4 comes off both.

Common mistakes

  • Using a cell with three candidates. Every link in the chain must be strictly bivalue.
  • Skipping the visibility check. Neighbours must share a row, column or box, not merely look close.
  • Eliminating from the end cells. The ends are part of the pattern and keep their candidates.
  • Reusing a cell. A chain that loops back on itself is a different technique with different rules.
  • Ending on the wrong digit. If the last cell does not offer z, the chain proves nothing yet — extend it.

Where you meet it

XY-Chains are standard equipment for expert classic Sudoku, where bivalue cells are plentiful and the simpler patterns have all been used up. Start with three-cell and four-cell chains; once those come naturally, longer ones cost nothing but patience.