XY-Wing
An XY-Wing is a three-cell, three-digit ALS-XZ construction using three bivalue cells. It combines a two-cell ALS A with a one-cell ALS B. Here X is the restricted common candidate (RCC), Z is the elimination digit, and Y is the third distinct digit. A weak link on X connects the two sets and guarantees Z in at least one of them. This lets us remove Z from an outside cell that sees both possible Z positions.
What is an XY-Wing?
An almost locked set (ALS) is a group of unsolved cells in one house — a row, column or box — with one more distinct candidate digit than cells. Although its name has two letters, an XY-Wing contains three cells and three distinct candidate digits. Read this XY-Wing as four parts:
- ALS A: the {X,Y} and {Y,Z} cells. They share a house and contain three distinct candidate digits across two cells.
- ALS B: the single {X,Z} cell. This bivalue cell is the smallest possible ALS: two candidate digits in one cell.
- RCC X: it occurs in the {X,Y} cell of ALS A and the {X,Z} cell of ALS B. These cells see each other, giving a weak link (weak inference) between the two X occurrences. X can be placed in one set or neither, but never in both.
- Elimination digit Z: it is a candidate in the {Y,Z} cell of ALS A and the {X,Z} cell of ALS B. A target outside both ALSs must see both of these cells.
Walkthrough example
In this example, ALS A contains B4 {7,9} and B8 {4,7}; ALS B is C5 {4,9}. The RCC is X = 9, and the elimination digit is Z = 4. The 9 candidates in B4 and C5 see each other, forming the weak link.
Step 1
Consider these 3 cells. B4 (7, 9) and B8 (7, 4) share a house and hold three candidate values between them — a two-cell almost locked set, ALS A. The bivalue cell C5 (9, 4) is the one-cell ALS B, and B4 sees it.
Step 2
The digit 9 is the restricted common candidate (RCC) between ALS A and ALS B: every 9 in ALS A sees every 9 in ALS B, so 9 can be true in at most one of the two sets. - If 9 is in ALS A, ALS B loses its degree of freedom and becomes a locked set containing 4. - If 9 is in ALS B, ALS A loses its degree of freedom and becomes a locked set containing 4. - If 9 is in neither set, both ALSs become locked sets containing 4. Either way, 4 is guaranteed to be present in ALS A or ALS B.
Step 3
So 4 must appear in at least one of B8 and C5 — its only occurrences in the construction. An external 4 that sees both cells can be removed: placing it would empty the construction of 4.
Here ALS A is the {X,Y} and {Y,Z} pair, and ALS B is the {X,Z} cell. Their RCC X gives the weak link that prevents X in both ALSs. Therefore Z must be placed in at least one of the two Z-bearing cells. Remove an outside Z candidate only when its cell sees both of these possible Z positions. You can play sudoku online to practise with the current candidate state visible.
How to spot it
Build ALS A first: find {X,Y} and {Y,Z} cells in one house. Next find ALS B, a {X,Z} cell that sees the {X,Y} cell. This visibility establishes the RCC X and its weak link. Finally look for an outside Z candidate whose cell sees both the {Y,Z} and {X,Z} cells. It does not need to see the {X,Y} cell, because that cell has no Z candidate.
The logic
ALS B is a single {X,Z} cell, so it must contain either X or Z. If it contains Z, the construction already has Z. If it contains X, the weak link rules out X in ALS A. Its {X,Y} cell must then be Y, and its {Y,Z} cell must be Z. In either case, Z is guaranteed in at least one of the two Z-bearing cells.
An outside cell that sees both possible Z positions cannot contain Z: whichever position uses Z would conflict with it. Remove Z from that outside cell, not from the ALS cells themselves.