Main Page - Back
 
From SudokuWiki.org, the puzzle solver's site
breakline

WXYZ-Wing

This is an extension of XYZ-Wing that uses four cells instead of three. A.k.a. Bent Quads.

I am grateful to SudoNova posting below and StrmCkr who posted about this strategy way back when on this page. I only got round to appreciating the insights recently but the much expanded version of WXYZ is now in version 1.96+ of the solver. Previously I'd restricted the scope to a very narrow definition. Using one of my test libraries, the 50k set from Ruud, I increased the detection from 299 instances to 8313, so it is definitely worth looking out for.

I'm going to start with my narrow definition if only to show how this is an extension of the three-cell XYZ-Wing.

Type 1

WXYZ-Wing theory
WXYZ-Wing theory
Its name derives from the four numbers W, X, Y and Z that must be in exactly four cells. In my narrow definition we need a hinge cell containing all four candidates WXYZ and three outlier cells each containing a pair wZ, xZ and yZ - Z being the common number.

The easy principle is that each possible value of the hinge cell results in a Z value in one of the cells in the WXYZ-Wing pattern, thus leaving no room for a Z on any cell all four can 'see'.
That's the narrow definition and a glance at XYZ Wing will show you its the same idea plus one more cell. You could expand it to a five cell pattern and five numbers.

Now, lets consider StrmCkr's more general definition:
WXYZ-Wings can be considered as a group of 4 cells and 4 digits, that has exactly one non-restricted common digit. We use that digit (Z) to eliminate since at least one of Z will be the solution.

Non-Restricted Common Digit
Non-Restricted Common Digit
So what is a non-restricted common digit?

Well, a restricted digit is one where all the instances of candidate N in the pattern can see each other. On the diagram to the left I have connected the W candidates - because they share the same box, and I can connect the Xs and Ys as they share a row. Only Z is non-restricted because some of the Zs - ie the one in C1 CANNOT see the Zs in B4 and B5.
WXYZ-Wing example 1
WXYZ-Wing example 1 : Load Example or : From the Start

In the first example I show a classic WYXZ wing - in that it has all four candidates (1/2/5/9) in the hinge cell D3 marked in brown. The three outlier cells, marked in yellow each contain a 9 (our Z) plus some of the other four candidates.

I have also marked in rings the spread of candidates 1, 2 and 5. You will see that both 1s can 'see' each other because they are in the same box. The 2s can 'see' each other because they are on the same row and the three 5s can all see each other since they share the same row as well. That makes 1, 2 and 5 restricted in the four cell pattern.

Candidate 9 is different. At least one 9 (in F1) cannot see at least one other 9 - the 9s in D4 and D6. That makes it the only non-restricted candidate.

A Type 1 WXYZ elimination will always be made on the non-restricted candidate. We are looking for a 9 elsewhere that can see every 9 in the four cells of our WXYZ pattern. That 9 is on D2.

It is important to note is that StrmCkr's rule says nothing about the hinge requiring four candidates and the other cells two. Like Quads, we need in total four candidates in four cells. This is a four-cell Locked Set. StrmCkr makes this point in his second corollary, So lets look at some examples where the is a thinner spread of four candidates.

Interestingly, where Z is present in less than four cells, ie three or just two cells of the four - more eliminations are possible because there are less cells that the eliminated candidates need to 'see'. I believe my new implementation WXYZ gives more variants than the 10 StrmCkr lists as exemplars.

WXYZ-Wing example 2
WXYZ-Wing example 2 : Load Example or : From the Start

The second WXYZ example is orientated in columns rather than rows, but works the same. The hinge cell in D6 conspicuously fails to contain the non-restricted candidate 5, but no matter. Whatever the final solution of D6 a 5 is forced into either E5 or one of the two cells G6/J6. The outliers are nice easy pairs - like my original narrow definition, but the improvement is not needing 5 (Z) in the hinge every time.

The solver tells us
WXYZ Wing
The four cells {D6,E5,G6,J6} contain in total 2/5/6/9.
Candidate 5 determines the 'wing' cells (in yellow) and one or other of those 5s must be true. Therefore...
5 can be taken off F6
5 can be taken off G5
5 can be taken off J5
WXYZ-Wing example 3
WXYZ-Wing example 3 : Load Example or : From the Start

Here is an example where the non-restricted common digit is present in just two pincer cells. We don't have to worry about 3s 'seeing' the brown cells as they don't have a 3 in them. Consider how the hinge cell in C1 solves when each digit is looked at. Suppose C1 is 4. That makes C8 contain 3/5. C8 + C3 + B2 now becomes an Y-Wing - and eliminates 3s in the same way. Interesting!

The solver returns
WXYZ Wing
The four cells {C1,B2,C8,C3} contain in total 3/4/5/9.
Candidate 3 determines the 'wing' cells (in yellow) and one or other of those 3s must be true. Therefore...
3 can be taken off B7
3 can be taken off B8
3 can be taken off B9

WXYZ-Wing example 4
WXYZ-Wing example 4 : Load Example or : From the Start


I'm ending this article with a nice Sudoku puzzle that has four Y-Wings an XYZ-Wings and four WXYZ-Wings. Here is the first of the later. It is worth following this through on the solver from the start.

Type 2

I am very grateful to David Hollenberg again for providing a detailed argument for a more expansive WXYZ-Wing pattern which I have included in the solver from version 2.31 (February 10th 2025). I am going with his suggestion to call it Type 2. Looking through my past emails I see Ed Logg from California also recommended this pattern back in 2020. I'm also going to have to pick through the page comments to see who else thought of this and check for other variants.

In one way this pattern is simpler to state and define that Type 1 which talks about finding one non-restricted candidate.

Type 2 Pattern
Type 2 Pattern
What we need is two cells in the same box and same row (or column) that in total contain four candidates (the hinge). These are the two orange cells in the pattern diagram here. It is not necessary for both cells to contain all four, they must have four between them.

Now, if there are two other cells that cannot see each other and contain two each of the four in the WXYZ and one is in the same box and the other is elsewhere along the row (or column), we can make multiple eliminations in many places.

Shown in the diagram is the fact that candidates XZ in the row eliminates everywhere else in the row. And Candidates WY can eliminate in the two rows not shared by our hinge.

Type 2 Example 1
Type 2 Example 1 : Load Example or : From the Start
From my stock I've picked a nice puzzle with two consecutive Type 2 WXYZ-wings.

Cells D12 contain {5,7,8,9} between them both. These cells can see D9 (the XZ cell) which contains {5,8} and F3 which contains {7,9}. So 8 can be taken off D5, 9 can be taken off E1 and 9 can be taken off F1.

So what about all that 'non-restricted candidate' stuff? In this pattern all the common
digits are restricted. As David reports "every candidate in a cell that is outside a Type 2 and that can see the occurrences of its digit in the WXYZ Wing can be eliminated"

In the second example we'll reason through a proof.

Type 2 Example 2
Type 2 Example 2 : Load Example or : From the Start

In this puzzle all the WXYZ digits {1,7,8,9} are restricted (i.e., all occurrences of each digit occur only in the same row, the same column, or the same box).
So all the 1 values in the wing can see each other and the same is true for the 7 values, 8 values, and 9 values. Now take a cell outside the WXYZ Wing, for example F5 that has 9 as a possible candidate. Let's assume that 9 is the solution for that cell. Since it can see all of the 9 values in the wing (D5 and E6), they would be eliminated.

We would then have a wing with 4 cells but only 3 possible candidates (1, 7, and 8). So by
the Pigeonhole Principal one of these digits must appear in more than one cell of the wing.
But this is impossible, since each digit is restricted so we would have (for example) two 1 values in the same row, column or box. So our original assumption that 9 is the solution for the cell outside the wing must be wrong and it can be eliminated as a candidate in that cell.

How common is Type compared to Type 1?
I've only tested this on about 300 puzzles known to have an WXYZ-wing and it found 58 type 2s and 675 Type 1, so about 8%. And this was with checking for Type 2 first.

Go back to XYZ-WingsContinue to Y-Wing Chains


Article created on 11-April-2008. Views: 232364
This page was last modified on 10-February-2025.
All text is copyright and for personal use only but may be reproduced with the permission of the author.
Copyright Andrew Stuart @ Syndicated Puzzles, Privacy, 2007-2025