Puzzle Maker Online

XYZ-Wing Sudoku Technique: How to Spot and Solve It

XYZ-Wing Sudoku Technique: How to Spot and Solve It

An XYZ-Wing is a three-cell pattern made of one cell holding candidates X, Y and Z, plus two cells that see it holding XZ and YZ; between them those three cells must contain a Z somewhere, so any cell that sees all three loses Z as a candidate. It is the natural next step after the XY-Wing, and it shows up constantly in hard puzzles once you know what the shape looks like.

The technique has a reputation for being fiddly, and that reputation is half deserved. The logic is a two-line argument. The hard part is knowing where on the grid the eliminations can possibly live, because unlike an XY-Wing, an XYZ-Wing almost never lets you delete a candidate that is far away. Get the geometry into your head and you will start finding these in seconds.

The pattern in precise terms

An XYZ-Wing has three cells and three digits.

The digit Z is the one that appears in all three cells. X appears in the pivot and pincer 1 only. Y appears in the pivot and pincer 2 only. Every cell must be reduced to exactly those candidate counts, three in the pivot and two in each pincer. If the pivot has four candidates you have a different animal (a WXYZ-Wing, covered further down), and if a pincer has a third candidate the argument collapses.

Why the elimination is valid

Walk the three possibilities for the pivot. It has to be X, Y or Z, because those are its only candidates.

  1. If the pivot is X, then pincer 1 cannot be X, because the pivot sees it. Pincer 1 only holds X and Z, so pincer 1 is Z.
  2. If the pivot is Y, then pincer 2 cannot be Y for the same reason. Pincer 2 only holds Y and Z, so pincer 2 is Z.
  3. If the pivot is Z, then the pivot itself is Z.

In every branch, at least one of the three cells ends up as Z. That is the whole proof. You do not know which cell it is, and you never will from this pattern alone, but you know a Z is somewhere in that trio.

Therefore any other cell that sees all three of them cannot be Z. If it were, it would conflict with whichever of the three actually holds the Z.

Notice how this differs from the XY-Wing. There the pivot is bivalue, only the two pincers can carry Z, and a victim only has to see the two pincers. Here the pivot can be Z too, so a victim has to see the pivot as well. That extra requirement is what makes XYZ-Wing eliminations so localized.

Where the victims can actually be

This is the part most explanations skip, and it is the part that makes the technique fast to hunt.

Start with a fact: if all three cells sit inside a single house, you do not have a useful XYZ-Wing at all. Three cells holding XYZ, XZ and YZ inside one box or one row are a naked triple, and a naked triple is strictly stronger. It removes X, Y and Z from every other cell in that house, not just Z. So if you spot the shape inside one house, call it a triple and take the bigger prize.

The useful XYZ-Wing therefore spans exactly two houses, and it always has this shape:

Once you know that, the victims are forced. A victim must see the pivot, the box-mate pincer and the line-mate pincer. The only cells that manage all three are the remaining cells of the pivot's box that lie on the shared line. In a standard 9x9 grid that is at most two cells, and often fewer once you check which of them actually contains Z.

So the search reduces to: find the pattern, identify the line the far pincer sits on, look at the other two cells of the pivot's box on that line, and strike Z out of them.

One more useful negative. If one pincer shares a row with the pivot and the other shares a column, there are no victims at all. No cell in the grid can see all three. Do not waste time checking that arrangement.

Worked example one: a row-based wing

Take a grid where the candidate marks have settled down. Suppose:

Match the letters. X is 2, because it is in the pivot and in r5c2. Y is 5, because it is in the pivot and in r4c6. Z is 8, present in all three.

Run the argument. If r5c5 is 2, then r5c2 must be 8. If r5c5 is 5, then r4c6 must be 8. If r5c5 is 8, we are done. An 8 lives in that trio.

Now find the victims. The far pincer is r5c2 on row 5, so the shared line is row 5. The other cells of box 5 on row 5 are r5c4 and r5c6. Check them: r5c4 shares row 5 with both r5c5 and r5c2, and shares box 5 with r4c6. Correct on all three. r5c6 shares row 5 with the pivot and r5c2, and shares both box 5 and column 6 with r4c6. Also correct.

Eliminate 8 from r5c4 and r5c6. If either had only one other candidate left, you have just placed a digit and the rest of the grid usually cascades.

Worked example two: a column-based wing

The same shape rotates. Suppose:

Here X is 1, Y is 4, and Z is 6. The far pincer sits on column 3, so the shared line is column 3, and the other box 7 cells on column 3 are r8c3 and r9c3.

Verify r9c3 carefully, since it is the one people doubt. It shares column 3 with the pivot and with r2c3. It shares box 7 with r8c1. All three connections hold, so 6 comes out of it. The same check passes for r8c3, which also shares row 8 with r8c1.

Eliminate 6 from r8c3 and r9c3.

How to hunt for one efficiently

A blind scan of every trivalue cell is slow. This order is faster.

  1. List the trivalue cells. In a hard puzzle at the stage where wings matter, there are usually somewhere between five and fifteen cells with exactly three candidates. Each is a pivot candidate.
  2. For each pivot, look inside its own box first. You need a bivalue cell in that box whose two candidates are both drawn from the pivot's three. If the box has none, the pivot is dead. Move on. This kills most pivots in a couple of seconds.
  3. If you found a box-mate pincer with candidates say {X, Z}, you now know exactly what to look for. Scan the pivot's row and column outside the box for a bivalue cell holding {Y, Z}, where Y is the pivot's remaining digit and Z is the digit the box-mate shares with the pivot.
  4. Check the two intersection cells for Z before celebrating. Plenty of valid XYZ-Wings eliminate nothing because neither intersection cell has Z penciled in. That is not a failure of the technique, just a wing with no target.

Step 2 is the shortcut that makes this practical. Because the useful configuration always pairs the pivot with a box-mate, you never have to consider pivots whose box is empty of suitable bivalue cells.

If you want to drill the shape rather than hunt for it in the wild, generating a stack of hard grids and working them on paper is more effective than replaying the same puzzle. Our sudoku puzzle maker will print fresh grids at the difficulty where these patterns start appearing.

XY-Wing, Y-Wing and XYZ-Wing side by side

The names get muddled in the wild. Y-Wing and XY-Wing are the same technique under two names. XYZ-Wing is genuinely different.

Feature XY-Wing (Y-Wing) XYZ-Wing
Pivot candidates 2 (XY) 3 (XYZ)
Pincer candidates XZ and YZ XZ and YZ
Cells that can hold Z The 2 pincers All 3 cells
A victim must see Both pincers All three cells
Typical victim count 1 to 4, sometimes far apart 0 to 2, always inside the pivot's box
Relative frequency More common Less common, but appears in most hard puzzles

The practical takeaway is that XY-Wings reward a wide scan and XYZ-Wings reward a narrow one. When you find an XYZ-Wing, do not go looking across the grid for eliminations. Look at two cells.

Common mistakes

Counting a pincer with three candidates. If your "XZ" cell actually holds X, Z and something else, the branch where the pivot is X no longer forces that cell to Z. The pattern is void.

Forgetting that the victim must see the pivot. This is the single most common error, and it is easy to make if you learned XY-Wing first. A cell that sees both pincers but not the pivot is safe, because the pivot may be the cell holding Z.

Eliminating X or Y. Only Z comes out. X lives in two of the three cells, Y lives in two of the three cells, and neither is guaranteed to appear anywhere in the trio.

Missing that it is really a naked triple. Worth repeating, because taking the weaker elimination when the stronger one is available slows a solve down considerably.

Assuming the pincers must see each other. They do not. In both worked examples above, the two pincers share nothing.

The bigger family: WXYZ-Wing and ALS thinking

Once XYZ-Wing clicks, the generalization is obvious. Add a fourth cell and a fourth digit and you get the WXYZ-Wing: four cells collectively holding four candidates W, X, Y, Z, arranged so that Z must appear among them. Any cell seeing every cell that could hold Z loses Z.

Both patterns are special cases of almost locked set logic. An almost locked set is a group of N cells holding N+1 candidates. The pivot of an XYZ-Wing is a one-cell set with three candidates, and each pincer is a one-cell set with two. When two almost locked sets are joined by a shared restricted digit, one of them collapses, and the shared digit becomes forced somewhere. You do not need the vocabulary to use the wings, but it explains why they exist and why the family keeps extending.

When to reach for it

XYZ-Wing sits above naked and hidden subsets, above locked candidates, above X-Wing, and roughly alongside XY-Wing in difficulty. Work the basics to exhaustion first. Wings only become visible once the candidate grid is trimmed, and a single missed locked candidate can hide a wing entirely by leaving an extra pencil mark in a pincer.

The honest cost-benefit: an XYZ-Wing usually removes one or two candidates. That sounds small. In a hard puzzle it is often the only crack available, and that one elimination frequently unlocks a hidden single that restarts the whole solve.

Frequently Asked Questions

What is the difference between an XY-Wing and an XYZ-Wing? The pivot. An XY-Wing pivot has two candidates, so only the pincers can hold Z, and a victim only needs to see both pincers. An XYZ-Wing pivot has three candidates including Z, so the victim must also see the pivot, which restricts eliminations to the pivot's box.

Do the two pincer cells have to see each other? No. Only the pivot must see each pincer. The pincers can be in completely unrelated rows, columns and boxes, and in the standard useful configuration they are.

How many cells can an XYZ-Wing eliminate from? At most two, and often zero or one. Both victims live in the pivot's box, on the line the pivot shares with the far pincer. If neither of those two cells has Z penciled in, the wing is valid but yields nothing.

Is the XYZ-Wing worth learning if I already know X-Wing and Swordfish? Yes, because it works on a different axis. X-Wing and Swordfish are single-digit fish patterns across rows and columns. XYZ-Wing is a multi-digit cell pattern. Hard puzzles routinely block one and open the other, so knowing both roughly doubles the number of hard grids you can finish without guessing.