I use a staged search for xy-wings.
First search for two cells of an xy-wing in each box. If your two cells do not share a row or column, then this tends to be your most fruitful pairing since it maximizes your opportunities for completing the xy-wing (24 cells) and it has the maximum number of cells where a reduction can take place once the xy-wing is completed(5).
In the grids below, the starred cells in the first grid indicate where you can search for a cell containing (ac) which would complete the xy-wing, and the minus signs in the next grid indicate cells where a reduction caused by the completed xy-wing can take place.
- Code: Select all
+----------+----------+----------+ +----------+----------+----------+
| * * . | . . . | . . . | | . . . | . . . | . . . |
| * * . | . . . | . . . | | . . . | . . . | . . . |
| * * . | . . . | . . . | | . . . | . . . | . . . |
+----------+----------+----------+ +----------+----------+----------+
| ab . . | * * * | * * * | | ab - - | . ac . | . . . |
| . . . | . . . | . . . | | . . . | . . . | . . . |
| . bc . | * * * | * * * | | . bc . | - - - | . . . |
+----------+----------+----------+ +----------+----------+----------+
| * * . | . . . | . . . | | . . . | . . . | . . . |
| * * . | . . . | . . . | | . . . | . . . | . . . |
| * * . | . . . | . . . | | . . . | . . . | . . . |
+----------+----------+----------+ +----------+----------+----------+
If the first two xy-wing cells in a box share a row or column, then you only have the 12 cells perpendicular to your pair to complete the xy-wing, but you still retain 5 cells where a reduction could take place
- Code: Select all
+----------+----------+----------+ +----------+----------+----------+
| . . . | . . . | . . . | | . . . | . . . | . . . |
| . . . | . . . | . . . | | . . . | . . . | . . . |
| . . . | . . . | . . . | | . . . | . . . | . . . |
+----------+----------+----------+ +----------+----------+----------+
| ab . . | * * * | * * * | | ab . . | - - - | . . . |
| . . . | . . . | . . . | | . . . | . . . | . . . |
| bc . . | * * * | * * * | | bc - - | . . ac | . . . |
+----------+----------+----------+ +----------+----------+----------+
| . . . | . . . | . . . | | . . . | . . . | . . . |
| . . . | . . . | . . . | | . . . | . . . | . . . |
| . . . | . . . | . . . | | . . . | . . . | . . . |
+----------+----------+----------+ +----------+----------+----------+
The least fruitful three-box xy-wings should be scanned for last. These xy-wings start with one bivalue cell in a box. Assuming you have already scanned for the above two types, there are 12 cells where you can find the second leg of the xy-wing, and, from there, 12 more cells where you can find the completion. From the completed xy-wing of this type there is only a single cell where a deduction might be made.
- Code: Select all
+----------+----------+----------+ +----------+----------+----------+
| ab . . | * * * | * * * | | ab . . | . . - | . . . |
| . . . | . . . | . . . | | . . . | . . . | . . . |
| . . . | . . . | . . . | | . . . | . . . | . . . |
+----------+----------+----------+ +----------+----------+----------+
| . . . | . . . | . . . | | . . . | . . . | . . . |
| . . . | . . . | . . . | | . . . | . . . | . . . |
| bc . . | * * * | * * * | | bc . . | . . ac | . . . |
+----------+----------+----------+ +----------+----------+----------+
| . . . | . . . | . . . | | . . . | . . . | . . . |
| . . . | . . . | . . . | | . . . | . . . | . . . |
| . . . | . . . | . . . | | . . . | . . . | . . . |
+----------+----------+----------+ +----------+----------+----------+
Note that the three-box xy-wing must have at least one cell in boxes 1, 3, 5, 7, or 9. Thus you can restrict your initial cell searches for this final case to those five boxes (or five similarly oriented ones such as 1, 2, 4, 5, 9). You can use this limiting feature to minimize the number of starting cells you have to consider.
In all cases, as you are scanning for the completion of your xy-wing, it doesn't hurt to keep an eye open for an extra bivalue cell or an ALS which can also result in a deduction.