Generalization of XYZ-wing

Advanced methods and approaches for solving Sudoku puzzles

Generalization of XYZ-wing

Postby vidarino » Wed Feb 08, 2006 3:36 pm

As I was adding XYZ-Wing to my solver I decided to aim for a more general approach, and came up with the following;

Assume there is a box B which contains a set of cells C that make up a naked subset V with exactly one extra candidate x in one of the cells. The cell with the extra candidate lies in a row or column R, which also contains a cell Z with exactly two candidates; one in V, and one x. You can then eliminate the common candidate from B & R - C (the box-row intersection minus the cells C).

In less techinical terms, find a bivalue cell where setting one candidate directly eliminates another, and setting the other unlocks a naked pair/triple/quad that does the same elimination. (If it unlocks a naked pair, it's an XYZ-Wing.)

An example:
Code: Select all
      3      5      4 |      68    689    689 |       2      7      1
      6      9      8 |      17     17      2 |       3      4      5
     27     27      1 |       5      3      4 |       8      6      9
----------------------+-----------------------+----------------------
     89     27*   279*|     127   1278      3 |       4      5      6
     58      1      3 |      68      4    568 |       7      9      2
      4      6    257-|       9     27     57 |       1      8      3
----------------------+-----------------------+----------------------
     27      8      6 |      27      5      1 |       9      3      4
      1      3     79^|       4    679    679 |       5      2      8
     59      4    259 |       3    289     89 |       6      1      7


This is just a typical XYZ-Wing:
C=R4C23, V=27, x=9, R=C3, Z=R8C3
-> Eliminate 7 from R6C3

Another one, slightly more interesting;
Code: Select all
      1      4      2 |       8     69    356 |      35     39      7
      9      7      3 |       1     24    245 |      58     48      6
      5      8      6 |      34     49      7 |       2    349      1
----------------------+-----------------------+----------------------
      7      3      8 |       2      5      9 |       1      6      4
      4      6      1 |       7      3      8 |       9      2      5
      2      9      5 |      46      1     46 |       7     38     38
----------------------+-----------------------+----------------------
      6      5     47^|       9    478*    34-|      38      1      2
      3      1     49 |       5    248*    24*|       6      7     89
      8      2     79 |      36     67      1 |       4      5     39


The XYZ-Wing's bigger brother.:)
C=R7C5+R8C5+R8C6, V=248, x=7, R=R7, Z=R7C3
-> Eliminate 4 from R7C6

I wouldn't be surprised if someone thought of this before, nor if there is another technique that can deduce the same eliminations, but I figured I should give it a quick writeup anyway. Hope it can be useful to someone.:)

Now, off to find a quad+x!:)
vidarino
 
Posts: 295
Joined: 02 January 2006

Postby TKiel » Wed Feb 08, 2006 4:21 pm

I'm trying to sort through the differences between an xy-wing and an xyz-wing. I use xy-wing but not xyz-wing and am always looking for things to add to the solving repertoire, provided my little brain can understand them.

Xy-wing--Even though there are three values (x,y,z) the 'stem' cell has only two (x,y), each 'wing' has only two (y,z) & (x,z) and the exclusion is only for the z value in any cell that shares a group with both 'wing' cells. The logic allowing the exclusion is that if the cell that shares a group with the 'wing' cells is assigned the z value, then the 'stem' will have no candidates.

Xyz-wing--There are three values (x,y,z), with the 'stem' cell having only three (x,y, z), the wing cells having (x,z) and (y, z) (but they can contain values unrelated to the xyz-wing) and the exclusion is made for the z value in any cell that shares a group with both 'wing' cells. The logic allowing the exclusion is the same as the xy-wing.

Tracy
TKiel
 
Posts: 209
Joined: 05 January 2006

Re: Generalization of XYZ-wing

Postby Jeff » Wed Feb 08, 2006 4:33 pm

vidarino wrote:I wouldn't be surprised if someone thought of this before, nor if there is another technique that can deduce the same eliminations, but I figured I should give it a quick writeup anyway. Hope it can be useful to someone.:)

Hi vidarino, This is called a wxyz-wing. Refer here.
Jeff
 
Posts: 708
Joined: 01 August 2005

Postby Myth Jellies » Wed Feb 08, 2006 4:56 pm

This is also a case of the Almost Locked Sets xz-rule. ^ and * represent almost locked sets. x = 7 is restricted to the same group (row 7) for both sets. z = 4 is in both sets as well, and cell r7c6 can see all the 4's in both sets, therefore r7c6 <> 4.

Always good to discover these things on your own, and have multiple ways of seeing them.
Myth Jellies
 
Posts: 593
Joined: 19 September 2005

Re: Generalization of XYZ-wing

Postby vidarino » Wed Feb 08, 2006 6:42 pm

Jeff wrote:Hi vidarino, This is called a wxyz-wing. Refer here.


Ah, thanks! I was pretty sure it wasn't a new discovery per se. I even thought I recalled the name, but I tried googling for "xyzw" (sic) with poor results, so I just figured what the heck...:)

There is one difference in the WXYZ-wing description vs mine, though. The WXYZ-wing apparently got its name due to the fact that the "pilot cell" has 4 candidates, but as I demonstrated above, that's not necessary at all. Two candidates can be enough, as long as one of them can participate in a naked pair, triple or quad, and the other has a "wing".

Vidar
vidarino
 
Posts: 295
Joined: 02 January 2006

Postby vidarino » Wed Feb 08, 2006 9:03 pm

Seems I found myself a VWXYZ-Wing.:)

Code: Select all
     25      1      3 |       7    249     49 |       8     45      6
     28     48      7 |       5     24      6 |       9      1      3
      9      6     45 |       8      3      1 |     245      7    245
----------------------+-----------------------+----------------------
      7     39    245 |       1      8     45 |    3456- 23456    459*
     58     39      1 |       6     45      2 |    3457*  3458   4579*
      6     48    245 |       9      7      3 |      45*  2458      1
----------------------+-----------------------+----------------------
      1      2      9 |       4      6      7 |      35^    35      8
      3     57      8 |       2    159     59 |    1467     46     47
      4     57      6 |       3     15      8 |     127      9     27


The "tail fin" is the 35 in R7C7, and the goodies are in box 6 ("pilot" in R5C7);

C=R5C7+R4C9+R5C9+R6C7, V=4579, x=3, R=C7, Z=R7C7

Or expressed as forcing chains;

R7C7=5 -> R4C7<>5
R7C7=3 -> reveal naked quad 4579 in box 6 -> R4C7<>5

These beasts are rarely too useful, though, since they typically only eliminate from cells that have a lot of other candidates.
vidarino
 
Posts: 295
Joined: 02 January 2006

Postby tarek » Wed Feb 08, 2006 9:40 pm

It seems that the generalisation is the ALS xz rule !!!
User avatar
tarek
 
Posts: 3762
Joined: 05 January 2006

Re: Generalization of XYZ-wing

Postby aeb » Thu Feb 09, 2006 12:01 am

vidarino wrote:As I was adding XYZ-Wing to my solver I decided to aim for a more general approach, and came up with the following; ...

All such arguments are special cases of the extended subset principle. Since I do not know of a reference, I just added some text to
http://homepages.cwi.nl/~aeb/games/sudoku/solving11.html
The idea is that a set of size n must have n digits, and if some assumption would leave fewer than n candidates then the assumption is wrong.
For example, in your wxyz-wing you have a set of size 4 (r7c3,r7c5,r8c5,r8c6) with possible digits 2,4,7,8 with max multiplicities 1,2,1,1 for a total of 5. So there is a margin of 1. If r7c6 is 4, that destroys both 4s, leaving only 3 digits for a set of size 4, contradiction.
On the page mentioned I show that Sue de Coq and ALS are special cases. But there are so many other special cases, some with the set scattered all about grid.
aeb
 
Posts: 83
Joined: 29 January 2006


Return to Advanced solving techniques

cron