y-wing - how to apply

Post the puzzle or solving technique that's causing you trouble and someone will help

y-wing - how to apply

Postby Steerpike58 » Sat Sep 10, 2022 8:04 pm

Thanks to user Leren, I found Andrew Stuart's 'Sudoku Solver' https://www.sudokuwiki.org/sudoku.htm .

I imported a puzzle that has a specific example of a 'Y-Wing' -

85.317.6434.6591.861.2483..7.89..4.15.48.1...93147.68.1765238492837945164951867..

If I go step by step through the solver, after several easy steps, it tells me that we have a Y-Wing 'hinge' at C9, with wings B8 and F9. As a result, we can take off the '2' at D8 and E8. That seems reasonable, but - when looking at the puzzle without the benefit of the solver, what exactly am I looking for?

I believe the criteria is to find three candidates 'A, B, C' in three cells in some pattern. Clearly C9, B8, and F9 fit that bill. But - could I have also chosen B3, which contains 2,7 (just like B8) instead of B8? Maybe not, because B8 is 'valid' because it's in the same square as the 'hinge' (C9) while B3 is neither in the same square nor in the same row as C9? Had C3 contained the 2,7 instead of B3, would C3 have been a possible 'wing' as it is in the same row as the hinge?

So is the generalized 'search' to find 3 cells, each containing a permutation of 3 candidates (as pairs only), linked by either row, column, or square?

Next, looking at the solver again, it's telling me that I can remove the '2's in D8 and E8 (because of the '2' in the wing B8). But why can't I also remove the '2's in E9 and J9? (because of the '2' in wing F9)? If the answer to that is something to do with columns vs rows, why can't I remove the '2' in F6, because of the '2' in wing F9? I am guessing the answer is (or 'process' is) - start with a potential elimination candidate (a '2'). What can 'it' see? Can it 'see' both the two 'wings', by virtue of either row, column, or square? if so, it can be eliminated; otherwise not. I "THINK" I've got it, but when faced with a real life example, I struggle to know which candidates can be eliminated! More practice, I guess!
Steerpike58
 
Posts: 16
Joined: 05 September 2022

Re: y-wing - how to apply

Postby Leren » Sat Sep 10, 2022 8:40 pm

Code: Select all
*------------------------------------*
| 8 5  29 | 3 1  7  | 29  6     *4   |
| 3 4  27 | 6 5  9  | 1  a27    *8   |
| 6 1  79 | 2 4  8  | 3   579  *b57  |
|---------+---------+----------------|
| 7 26 8  | 9 36 25 | 4  *35-2   1   |
| 5 26 4  | 8 36 1  | 29 *379-2  237 |
| 9 3  1  | 4 7  25 | 6  *8     c25  |
|---------+---------+----------------|
| 1 7  6  | 5 2  3  | 8   4      9   |
| 2 8  3  | 7 9  4  | 5   1      6   |
| 4 9  5  | 1 8  6  | 7   23     23  |
*------------------------------------*

We would call this move an XY Wing. What you are looking for is 3 bi-value cells, which I've labelled here a-b-c. Cell a can see Cell b and Cell b can see Cell c.

Also Cells a and c are what Andrew calls the "Wing" cells and contain a common digit, here it's 2. The other two values in the Wing cells are present in the so-called "Hinge" Cell b.

So, in words, if Cell a is not 2 it must be 7, so Cell b is not 7 so it must be 5, so Cell c is not 5 so it must be 2. Going the other way if Cell c is not 2 then Cell a must be 2.

So at least one of Cells a and c must be 2, and you can eliminate 2' from all cells that they can both see.

If you go to Andrew's Strategy Family page here he gives worked examples for all of his implemented moves. Y Wing is under "Tough" strategies on the left. On the Hodoku site you can read about XY Wings here.

Leren

<Edit> I've marked the digram showing the six cells seen by Cells a and c. Of course Cell b can't have a 2.
Last edited by Leren on Sun Sep 11, 2022 6:15 am, edited 4 times in total.
Leren
 
Posts: 5124
Joined: 03 June 2012

Re: y-wing - how to apply

Postby Steerpike58 » Sun Sep 11, 2022 1:54 am

Leren wrote:...

So, in words, if Cell a is not 2 it must be 7, so Cell b is not 7 so it must be 5, so Cell c is not 5 so it must be 2. Going the other way if Cell c is not 2 then Cell a must be 2.

So at least one of Cells a and c must be 2, and you can eliminate 2' from all cells that they can both see.
...

I greatly appreciate your patience in spelling this out for me.

Where I think I'm getting confused is because in this example, both the 'hinge' (b) and one of the 'wings' (a) are in the same box, so it's harder to see overlap of box and row affinities going on. I think I understand now, that the two removal cells D8 and E8 are chosen because they represent the intersection of the COLUMN associated with wing (a), and the BOX associated with wing (c).

I presume there could also be removal candidates in the intersection of the COLUMN associated with wing (c) and the BOX associated with wing (a), but there are no '2's for removal there (that would be cells A9, B9).

Looking at Andrew's Y-Wing strategy explanation page that you refer to, he shows a cool diagram with X and Z, and with red and blue 'spheres of influence'. On that page, his THIRD example shows a situation where the three cells are all located in different boxes, and I think that's easier to see the concept. In this third example, ONLY the one '4' at D1 can be eliminated because only that one cell is 'seen' by both wings (column / row intersection). But in his examples 1 and 2, the 'removal' targets are chosen by virtue of their 'box' presence, not row/column presence ... I THINK !!!!
Steerpike58
 
Posts: 16
Joined: 05 September 2022

Re: y-wing - how to apply

Postby Leren » Sun Sep 11, 2022 4:11 am

.1....5.8...4.3....567.........2..8.4.....3.22..376..19.8...254.....7...........3

Code: Select all
*---------------------------------------------*
| 7    1    4     | 29    6   29  | 5   3   8 |
| 8    29   29    | 4     5   3   | 16  16  7 |
| 3    5    6     | 7     1   8   | 4   2   9 |
|-----------------+---------------+-----------|
|b16   36-9 137-9 |a19    2   4   | 67  8   5 |
| 4   c69   179   | 158-9 8-9 5-9 | 3   67  2 |
| 2    8    5     | 3     7   6   | 9   4   1 |
|-----------------+---------------+-----------|
| 9    7    8     | 6     3   1   | 2   5   4 |
| 15   234  123   | 2589  489 7   | 18  19  6 |
| 156  246  12    | 2589  489 259 | 178 179 3 |
*---------------------------------------------*

XY Wing - Base Cell r4c1 {16} Pincer Cells r4c4 {19} and r5c2 {69}. Eliminate 9's seen by both Pincer cells.

Here is an example puzzle from Hodoku that shows the maximum of 5 eliminations that can be made by an XY Wing. You can import the puzzle into Andrew's solver by clicking on the blue "Import a Sudoku" button at the top.

Leren
Leren
 
Posts: 5124
Joined: 03 June 2012

Re: y-wing - how to apply

Postby Steerpike58 » Sun Sep 11, 2022 8:01 pm

Leren wrote:.1....5.8...4.3....567.........2..8.4.....3.22..376..19.8...254.....7...........3

Code: Select all
*---------------------------------------------*
| 7    1    4     | 29    6   29  | 5   3   8 |
| 8    29   29    | 4     5   3   | 16  16  7 |
| 3    5    6     | 7     1   8   | 4   2   9 |
|-----------------+---------------+-----------|
|b16   36-9 137-9 |a19    2   4   | 67  8   5 |
| 4   c69   179   | 158-9 8-9 5-9 | 3   67  2 |
| 2    8    5     | 3     7   6   | 9   4   1 |
|-----------------+---------------+-----------|
| 9    7    8     | 6     3   1   | 2   5   4 |
| 15   234  123   | 2589  489 7   | 18  19  6 |
| 156  246  12    | 2589  489 259 | 178 179 3 |
*---------------------------------------------*

XY Wing - Base Cell r4c1 {16} Pincer Cells r4c4 {19} and r5c2 {69}. Eliminate 9's seen by both Pincer cells.

Here is an example puzzle from Hodoku that shows the maximum of 5 eliminations that can be made by an XY Wing. You can import the puzzle into Andrew's solver by clicking on the blue "Import a Sudoku" button at the top.

Leren

Fantastic example! Made simple mistakes twice, but got it on third attempt! Thanks!
Steerpike58
 
Posts: 16
Joined: 05 September 2022

Re: y-wing - how to apply

Postby Steerpike58 » Wed Sep 14, 2022 4:34 am

Leren (or anyone!) ... I've been playing with Y-wings, and getting the hang of them. I have a question. The Y-wing is made up of three cells, comprising pairs AB, AC, BC.

Is there any definitive way that the 'Hinge' is identified, to distinguish it from the two 'wings' or 'pincers'?

In other words - for pairs AB, AC, BC;
AB could be the hinge, with pincers AC, BC (with 'C' being the elimination number)
AC could be the hinge, with pincers AB, BC (with 'B' being the elimination number)
BC could be the hinge, with pincers AB, AC (with 'A' being the elimination number).

Is the hinge always 'in the middle', between the other two?

Hopefully I'm explaining this clearly!
Steerpike58
 
Posts: 16
Joined: 05 September 2022

Re: y-wing - how to apply

Postby Leren » Wed Sep 14, 2022 9:17 pm

That looks OK, except the "Hinge" to use your term, must share a house (see) both wing cells. The wing cells don't have to see each other (and in an XY wing they never do) but they should see some common cells that contain the elimination digit.

Leren
Leren
 
Posts: 5124
Joined: 03 June 2012

Re: y-wing - how to apply

Postby StrmCkr » Thu Sep 15, 2022 5:36 am

Three ways to view an xy wing

It's an AIC chain composed of all bivavles
So that the start and end cell has the same digit expressed.

(1=2) - (2=3) - (3=1)
Eliminate 1 from any cell that sees start and end 1.

almost locked set rules (xy rule)
Als a) 12 @...
Als b) 23 @...
Als c) 13 @...
RC of ab) 2
Rc of bc) 3
Non rc of ac) 1 eliminate peers of all digit 1 cells.

Als(xz rules)
a) 12 @...
B)123@...
Rc) 2
Non rc of Àb) 1

Hinge is deserinable if you use chain rules or xy als rules.
As it's the connecting cell between 2 points.
Some do, some teach, the rest look it up.
stormdoku
User avatar
StrmCkr
 
Posts: 1433
Joined: 05 September 2006


Return to Help with puzzles and solving techniques