XYZ-Wing Technique - How It Differs from XY-Wing and Why It Removes So Little
An XYZ-Wing is a pattern of a pivot with three candidates and two pincers with two each, and it removes Z, the candidate common to all three cells. Unlike XY-Wing, the pivot itself can hold Z, so only cells that see all three can lose it, and there are at most two such cells. This article finds an XYZ-Wing on one grid, compares its range with XY-Wing, and explains why the range is so narrow and how to search for it.
What does an XYZ-Wing look like?
An XYZ-Wing is an XY-Wing whose pivot has one more candidate. An XYZ-Wing is made of three cells. The pivot in the middle has three candidates, {X,Y,Z}, and the two pincers have two each, {X,Z} and {Y,Z}. Each pincer shares a row, column or box with the pivot. Z, the candidate common to all three cells, must go in one of them. The short answer is that Z can be removed only from cells that see all three, and the shape of the grid allows at most two such cells. With XY-Wing you removed Z from any cell that sees both pincers; with XYZ-Wing the cell must see the pivot as well. This article finds an XYZ-Wing on one grid, compares in a table what it removes with what an XY-Wing would remove, and explains why the range shrinks and how to search for the pattern. How XY-Wing itself works is left to the XY-Wing article.
Conditions for the three cells
To use an XYZ-Wing, check four conditions on the three cells. First, the pivot has exactly three candidates. Second, each pincer has exactly two candidates, and both sets fit inside the pivot's candidates. Third, the two pincers hold different pairs that share exactly one candidate. That shared candidate is Z. Fourth, each pincer shares a unit with the pivot, but the three cells do not all fit in a single unit. SudokuWiki, a site that explains solving strategies one by one, describes an XYZ-Wing as three cells that hold only three digits between them and fall outside the confines of one row, column or box. If the three cells do fit in one unit, the same candidates form a naked triple instead. That lets you remove all three digits from the rest of the unit, more than an XYZ-Wing would. The XYZ in the name refers to the three candidates of the pivot; SudokuWiki says the name comes from the three numbers required in that cell.
An XYZ-Wing on a real grid
The grid below is a position from a puzzle made for this article, advanced using only single-candidate cells and the only place a digit can go, until no more progress was possible. In this position, naked pairs, hidden pairs, pointing pairs and box/line reduction remove nothing at all, and there is no triple or XY-Wing either. Here r stands for row and c for column, so r2c6 is the cell in row 2, column 6. The pivot is r2c6, with three candidates {2,3,7}. One pincer is r2c7 in the same row 2, with {3,7}. The other is r3c6, in the same box 2 (the top middle box) and the same column 6, with {2,3}. The only candidate in all three cells is 3, so Z is 3. The three cells do not fit in one unit: r2c7 is outside box 2, and r3c6 is outside row 2. The only empty cell that sees all three is r2c4, with candidates {3,6}. It is in row 2 with r2c6 and r2c7, and in box 2 with r3c6. This XYZ-Wing removes the 3 from r2c4. That leaves 6 as its only candidate, so r2c4 becomes 6.
- Pivot (r2c6, {2,3,7})
- Pincers (r2c7 {3,7} and r3c6 {2,3})
- Cell that loses its 3 (r2c4)
- Empty cells that see only the pincers
Candidates of the empty cells: in row 2, r2c3 {6,8}, r2c4 {3,6}, r2c6 {2,3,7}, r2c7 {3,7}, r2c8 {2,6,8}; in row 3, r3c3 {6,8}, r3c5 {6,9}, r3c6 {2,3}, r3c8 {2,6,8}, r3c9 {2,3,6,9}. The 3 is a candidate in r2c4, r2c6 and r2c7 in row 2, and in r2c4, r2c6 and r3c6 in box 2.
Why only cells that see all three?
The logic of an XYZ-Wing is easiest to read by splitting it into three cases, one for each value of the pivot. If the pivot is 7, r2c7 in the same row loses its 7 and becomes 3. If the pivot is 2, r3c6 in the same box loses its 2 and becomes 3. If the pivot is 3, the pivot itself is the 3. In every case, one of r2c6, r2c7 and r3c6 holds a 3. So a cell that sees all three cannot be 3. The HoDoKu guide says the same: because the pivot itself could be Z, Z can only be removed from cells that see the pivot as well as the pincers. In an XY-Wing the pivot has only {X,Y}, so Z always ends up in one of the pincers. In an XYZ-Wing the pivot can hold Z too, which adds a third case. Forget that third case and you will remove Z from cells that see only the pincers. On this grid, r3c9 is such a cell. It is in box 3 with r2c7 and in row 3 with r3c6, but it does not see the pivot r2c6. Solve the grid to the end and the pivot r2c6 turns out to be 3, and so does r3c9. Removing the 3 from r3c9 without allowing for a pivot of 3 would remove the right answer.
Comparing what XY-Wing and XYZ-Wing remove
The difference between XY-Wing and XYZ-Wing comes down to how many cells can hold Z, and the range of eliminations that follows. Suppose, on the same grid, that the pivot r2c6 had only {2,7}. The three cells would then form an XY-Wing, and the 3 could be removed from every cell that sees both pincers. The cells that see both pincers are r2c4 and r2c5 in row 2 and r3c7, r3c8 and r3c9 in row 3, five in all. Of these, the empty cells with a candidate 3 are r2c4 and r3c9. The real pivot is {2,3,7}, so the range shrinks to r2c4 and r2c5, which see all three cells, and only r2c4 loses its 3. SudokuWiki also explains that dropping Z from the pivot gives an XY-Wing, with more cells elsewhere that could lose a Z. The table below sets out the difference in range between the two techniques.
| Point | XY-Wing | XYZ-Wing |
|---|---|---|
| Pivot candidates | Two, {X,Y} | Three, {X,Y,Z} |
| Cells that can hold Z | One of the two pincers | The pivot or one of the two pincers |
| Cells that can lose Z | Cells that see both pincers | Cells that see the pivot and both pincers |
| Number of such cells | Depends on the shape | Two at most |
| Cells in range on this grid | r2c4, r2c5, r3c7, r3c8, r3c9 (if the pivot were {2,7}) | r2c4, r2c5 |
| Cells losing a 3 on this grid | r2c4 and r3c9 (if the pivot were {2,7}) | r2c4 only |
The real pivot on this grid is {2,3,7}, so there is no XY-Wing. The XY-Wing column compares the range for a hypothetical pivot without the 3. The answer in r3c9 is 3, so removing it with the XY-Wing range would be a mistake.
Why there are at most two target cells
An XYZ-Wing can remove Z from at most two cells on any grid. SudokuWiki states this number, and the shape of the grid shows why. For any cell to see all three, one pincer must share the pivot's box and the other must share its row or column. On this grid, r3c6 is linked to the pivot through box 2 and r2c7 through row 2. The cells that see all three are then the cells where that row or column and that box overlap, three cells minus the pivot, which leaves two. Here row 2 and box 2 overlap in r2c4, r2c5 and r2c6, so the two are r2c4 and r2c5. If both pincers are outside the pivot's box and linked only by a row and a column, no cell sees all three. For example, with the pivot at r2c6 and pincers at r2c9 and r8c6, cells in row 2 do not see r8c6, and cells in column 6 do not see r2c9. That shape removes nothing as an XYZ-Wing. As an XY-Wing, the same shape could remove from r8c9, where the pincers' row and column cross. That is why the search area of an XYZ-Wing is so small.
How to find one on the grid
Start the search for an XYZ-Wing from cells with three candidates, the opposite of XY-Wing, which starts from cells with two. First, pick a cell with exactly three candidates as the pivot. Next, look in the same box for a cell with two candidates that fit inside the pivot's candidates. Then look in the pivot's row or column, outside the box, for another cell with two candidates that fit inside the pivot's candidates. This pincer must not share a row or column with the pincer inside the box; if it does, all three cells sit in one unit and form a naked triple. Compare the two cells; if they share exactly one candidate, that candidate is Z. Finally, take the row or column that the pivot shares with the pincer outside the box, find the three cells where it overlaps the pivot's box, set the pivot aside, and remove Z from the other two if they hold it. Because the cells to check are fixed at those two, there is less to verify than with an XY-Wing. When many cells have three candidates, there are many possible pivots. Go through them one at a time, and move on as soon as two pincers cannot be found.
Common mistakes and how to spot them
The first mistake is removing Z, XY-Wing style, from cells that see only the pincers. As r3c9 on this grid shows, the answer in such a cell can be Z. Before removing anything, always check that the cell sees the pivot. The second is using a pincer with a digit the pivot does not have. If r2c7 were {3,5}, a pivot of 7 would not force r2c7 to be 3, and the logic would break. The third is using two pincers with the same pair. With {3,7} and {3,7}, the pincers share two candidates and there is no single Z. The fourth is treating three cells that fit in one unit as an XYZ-Wing. In that case they are a naked triple, and all three digits can be removed from the rest of the unit. Removing only one candidate as an XYZ-Wing leaves eliminations on the table. The fifth is picking the wrong Z. Z is the candidate common to all three cells, 3 on this grid. A 2 or a 7, which only the pivot and one pincer share, cannot be removed this way.
Reading this with the XY-Wing article
An XYZ-Wing is an XY-Wing with one candidate added to the pivot, so it reads more easily once the XY-Wing logic is clear. The XY-Wing article covers how the pivot and pincers relate and why candidates that see both pincers can be removed. Comparing the two pivots on this grid, {2,7} and {2,3,7}, shows how one more cell that can hold Z shrinks the range sharply. X-Wing has a similar name but handles the positions of a single digit in a four-cell rectangle, a different mechanism from XYZ-Wing. W-Wing joins two cells with the same two candidates through a strong link and, like XY-Wing, can be read as a short chain. HoDoKu notes that versions with even more candidates in the pivot have been described, but that they are hard to find and it does not support them. The definitions are in the glossary entries for XYZ-Wing, XY-Wing and bi-value cells.