Sudoku

Sudoku technique

The X-Wing

The X-Wing is the best-known advanced technique in Sudoku, and it is simpler than its name suggests. It concerns one digit and four cells at the corners of a rectangle. Hard puzzles sometimes need one. Easy and medium puzzles never do.

One digit, two rows, two columns

Pick a digit, and suppose there are two rows in which it can go in exactly two cells each. Suppose also that those cells line up: they are in the same two columns in both rows. The four cells are the corners of a rectangle.

Each row needs the digit once. If the top row has it on the left, the bottom row can’t have it on the left as well, because they would share a column, so the bottom row has it on the right. If the top row has it on the right, the bottom row has it on the left.

Either way, the digit ends up on one diagonal of the rectangle or the other, which is the X in the name. And either way, each of the two columns gets its copy of the digit from one of the corners. No other cell in those two columns can hold it.

A worked example

In this position the digit is 7. Row 4 has two empty cells, in columns 1 and 5, and 7 is among the notes of both. Row 8 also has two empty cells, in columns 1 and 5, and 7 is among the notes of both.

That is an X-Wing: two rows, with the 7 limited to the same two columns in each. So the 7s for columns 1 and 5 will both come from these four corners.

Three other cells in those columns have a 7 among their notes, and each loses it. In row 2, column 1, the notes were 1 and 7, so the cell is now a 1. The cells in row 5, column 5 and row 9, column 1 are left with fewer candidates.

In the shaded rows, 7 can only go in the outlined corners. The red cells in columns 1 and 5 lose their 7, and the one in row 2 becomes a 1.

The same pattern on its side

Rows and columns can swap roles. If a digit has exactly two possible cells in each of two columns, and those cells sit in the same two rows, the digit can be removed from the rest of those two rows.

The rule to remember is that you search in one direction and erase in the other. Find the pattern in rows, erase in columns. Find it in columns, erase in rows.

How to find one

  • You need notes, at least for the digit you are checking.
  • Take one digit and go down the rows. Mark each row where the digit has exactly two possible cells.
  • Compare the marked rows. Two of them with the digit in the same two columns make an X-Wing.
  • Repeat for columns, then move to the next digit.

Digits that are about half placed are the best ones to check. A digit with seven copies on the board has no room for an X-Wing, and a digit with one copy has too many candidates.

Common mistakes

  • A row with three possible cells for the digit. Both rows must have exactly two. Extra candidates elsewhere in the columns are fine, and they are the ones you erase.
  • Erasing along the rows. The rows are where you found the pattern. The eliminations are in the columns.
  • Corners that don’t line up. All four cells must share two rows and two columns.

An X-Wing is two locked rows working together, which is why it comes after pointing pairs and box-line reduction in most guides. The same idea with three rows and three columns is called a Swordfish, part of a family that solvers call fish.