XY-Chain in Sudoku: Linking Two-Candidate Cells Step by Step

An XY-Chain is a path of cells that each have exactly two candidates, where every cell sees the next and shares one digit with it. If the first cell and the last cell both contain the same digit Z, and that Z is the digit left over at each end, then one end must be Z, and any cell that sees both ends loses Z. To spot one, list the two-candidate cells, start from one of them, and follow shared digits from cell to cell until you land on a cell that ends in the digit you started with.

The XY-Wing is the three-cell version. An XY-Chain lets the path run as long as it needs to.

A worked example with five cells

This position is from a real puzzle in our library. The chain runs through five two-candidate cells and ends with a 5 at both ends.

XY-Chain R1C2 {2,5}, R9C2 {2,5}, R9C1 {4,5}, R9C5 {4,7}, R2C5 {5,7}. One end is 5, so 5 is removed from R1C5 and R2C1.C1R1C2R2C3R3C4R4C5R5C6R6C7R7C8R8C9R934525481235867129356912357178124172842893569875621432458136976137942858916354727324924856145256124717938
  • The 5 at each end
  • Inside a cell: one of two
  • Between cells: same digit, cells see each other
  • 5 removed
Follow the chain from R1C2: if it is not 5 it is 2, then R9C2 is 5, R9C1 is 4, R9C5 is 7 and R2C5 is 5. So R1C2 or R2C5 is a 5.

Start at R1C2 and suppose it is not 5.

  1. R1C2 {2, 5}. Not 5, so it is 2.
  2. R9C2 {2, 5}, same column (column 2). It cannot also be 2, so it is 5.
  3. R9C1 {4, 5}, same row (row 9). It cannot also be 5, so it is 4.
  4. R9C5 {4, 7}, same row (row 9). It cannot also be 4, so it is 7.
  5. R2C5 {5, 7}, same column (column 5). It cannot also be 7, so it is 5.

So if R1C2 is not 5, R2C5 is. One of the two ends is a 5 in every case.

Two cells see both ends and still have 5 as a candidate. R1C5 shares row 1 with R1C2 and column 5 with R2C5. R2C1 shares box 1 with R1C2 and row 2 with R2C5. Both lose their 5.

Read the chain the other way and the logic still holds: if R2C5 is not 5 it is 7, R9C5 is 4, R9C1 is 5, R9C2 is 2 and R1C2 is 5. A valid XY-Chain works in both directions, which is a good way to check one you found by hand.

Puzzle 201212 from the Sudoku Royale library. Givens (row by row, dots are blanks): .....6.........8.4.7.4..35.......1.3.4581.6.76.37..2..8.1635...73...8............. The candidates shown are what is left after singles, pointing and claiming, naked and hidden pairs, triples and quads, X-Wing and Swordfish, with nothing else applied.

How to build an XY-Chain

  1. Mark the bivalue cells. Only cells with exactly two candidates can be links. Hard puzzles often have a dozen or more once the easy steps run out.
  2. Pick a start and a target digit. Choose a bivalue cell and one of its digits as Z. The other digit is the one you carry forward.
  3. Hop to a cell that sees it and contains the carried digit. In the new cell, the carried digit is ruled out, so its other digit becomes the new one you carry.
  4. Stop when the carried digit is Z. That last cell is Z whenever the start is not. Look for cells that see both ends and hold Z.
  5. Check each hop names a house. Every step must share a row, column or box. If two cells only look close, the chain breaks.

Short notation helps. The example reads (5=2) R1C2 - (2=5) R9C2 - (5=4) R9C1 - (4=7) R9C5 - (7=5) R2C5. Inside each bracket, "=" means one of the two is true. Between cells, "-" means the two cannot both be that digit.

XY-Chain vs XY-Wing and W-Wing

  • An XY-Wing is an XY-Chain of three cells: pincer, pivot, pincer.
  • A W-Wing also has two bivalue ends with the same pair of digits, but it joins them through a strong link on one digit, so its middle cells can have any number of candidates.
  • An X-Chain stays on one digit across many cells. An XY-Chain changes digit at every cell.

Once you see the same argument in all of these, 3D Medusa and almost locked sets feel like natural next steps. See our list of sudoku techniques in learning order and the overview of advanced sudoku strategies for where they fit.

Train the three-cell version first

The Dojo in Sudoku Royale has no XY-Chain drill. Its XY-Wing drill trains the building block: spotting two-candidate cells that see each other and share a digit. Open the XY-Wing drill on your iPhone.

Get Sudoku Royale: Free on iOS

Frequently Asked Questions

What is an XY-Chain in sudoku?

An XY-Chain is a path of cells that each have exactly two candidates, where each cell sees the next and shares a digit with it. If both ends of the path leave the same digit Z, one end must be Z, so Z can be removed from any cell that sees both ends.

How is an XY-Chain different from an XY-Wing?

An XY-Wing is an XY-Chain with exactly three cells. An XY-Chain can have four, five or more cells, which lets it connect ends that are far apart.

Do all cells in an XY-Chain need two candidates?

Yes. Every cell in the path must be bivalue, with exactly two candidates. That is what makes each cell flip to its other digit when the carried digit is ruled out.

How long can an XY-Chain be?

There is no fixed limit. Chains of four to six cells are common. Longer ones are valid but harder to find and check by hand.

Try Sudoku Royale

Download Free on the App Store
Sudoku Royale: classic sudoku, no ads, live matches when you want themDownload Free