Sudoku Assistant - The Sudoku Trainer and Solver

X-Wing Solving

The X-Wing technique involves looking at the candidate cells for a particular value, and spotting rows where there are just two available placements - where the two possible locations are on the same columns in both rows. The logic can work the other way too... swapping 'columns' and 'rows' in the description above.

In the following puzzle, note how the candidate positions for 4 have just two possible locations on columns 2 and 7 - the cells are highlighted in green. The candidate cells on each column are tightly linked, and we indicate that here with the arrows. Importantly, the candidate cells are on the same rows.

  4 2 8 5 1 4 7 4x
  7 4 3 2 9 5 1 4
      6 4 7     3
4   9 1 8 6      
    7 5 9 3 8 4 4
      2 7 4     9
2 4 4x 7 1 8 4 4x 4x
  9 6 4 3 2      
  8 4 9 6 5 3 4 4

Now, follow the logic of how these four (green) cells relate to each other for the value 4. If the top-left cell is 4, the cells on the same column and the same row can not be 4... so the bottom-left cell can't be 4 and neither can the top-right. As the only other possible location for value 4 on column 7 is the bottom-right green cell, the bottom right cell must be 4 if the top-left cell is 4.

What if the top-left cell is not 4, however? Well, the only other place it could be on the column is the bottom-left green cell, at [2,7]. Therefore, the bottom-right green cell on the same row can't be 4, so the top-right cell must be 4... again, because it is the only other possible location on column 7.

How has this helped us? Let us consider the points above again, but specifically focussing on the rows that the green cells are on (row 1 and 7). If the top-left cell is 4, the bottom-right is 4. Therefore, 4 is taken in both rows, using only the green cells. Conversely, if the top-right and bottom-left cells are 4, then again, 4 will have been set on both rows, using only the green cells.

So: although we do not yet know which pair of cells will take the value 4, we do know that on the connecting rows, no other location will take the value 4 than the constituent cells of the X-Wing itself. Therefore, all other cells on the two rows can have the 4 removed from the candidates / pencil-marks... in this case the effected cells are highlighted red, and with an 'x'.

It is the strong relationship between diagonally opposite corners of the rectangle that give us the 'X' of the technique name, X-Wing.


If you are unsure of any of the terminology we use, you may find it helpful to refer to our Glossary.

Want to Print pages in this section? You may need to select 'Print Background Colours and Images' in your browser's Page Setup dialog before you will see all the images and shading in the example grids.