X-Wing
An X-Wing happens when a digit can go in exactly two cells in each of two rows, and those four cells sit in the same two columns. The digit must fill one diagonal pair or the other, so it can be removed from every other cell in those two columns.
Whichever diagonal pair holds the digit, it is used up in both columns. The same pattern works with rows and columns swapped. On this site X-Wing is first needed in Hard puzzles.
Four cells that form a rectangle
Pick one digit, say 9. Find a row where 9 has exactly two possible cells, and a second row where 9 has exactly two possible cells in the same two columns. The four cells are the corners of a rectangle. The first row will take its 9 in one corner or the other, and the second row has to take its 9 in the opposite column, because the two rows cannot both use the same column. Either way, both columns end up holding their 9 inside the rectangle's corners. The rest of those two columns can therefore never hold a 9.
The diagram above is a real position from this site's Hard pool, drawn by the technique engine. The caption reads: in rows 4 and 8, the digit 9 can only go in columns 4 and 7, so those two rows must use 9 in those two columns, and 9 can be removed from the rest of columns 4 and 7. (The caption lists the rows as "4, 8" before naming the digit; the rows are 4 and 8 and the digit is 9.) Notation is row first, then column, counted from the top left.
Why the name
If you draw lines between the diagonal corners of the rectangle, they cross in an X. There are two ways to fill the corners: the 9 goes on one diagonal or on the other. Both ways put exactly one 9 in each of the two rows and one in each of the two columns, which is why the columns' other cells are cleared. You never need to know which diagonal is right.
How to find them
- Fill in candidate notes for the grid.
- Choose a digit and go through the rows, looking for rows in which the digit appears as a candidate in exactly two cells.
- Among those rows, find two whose pairs of columns match exactly.
- Remove the digit from every other cell in those two columns.
- Repeat with columns instead of rows: two columns where the digit has exactly two cells, in the same two rows, clear the digit from the rest of those rows.
It is easiest to look for X-Wings on digits that are already placed many times, since those have the fewest candidates left and the shortest candidate lists in each row.
Why it works
Each of the two rows needs a 9 and has only two places to put it, both in the same pair of columns. If row A puts its 9 in the left column, row B cannot use that column, so row B puts its 9 in the right column, and the reverse if row A takes the right. In both cases each column gets a 9 from the rectangle, so a column cannot take a second one elsewhere. Notice that this argument covers both cases, which is why it counts as a proof and not a guess.
Common mistakes
- Allowing a third candidate. If either row has the digit in three cells, even if two line up, it is not an X-Wing. The two cells must be the only places for the digit in that row.
- Eliminating inside the rectangle. The four corner cells keep their candidate; only the other cells in the two columns lose it.
- Mismatched columns. The two rows must use exactly the same pair of columns. One shared column is not enough.
- Looking at only one orientation. The row version and the column version are separate patterns. If rows give nothing, check columns.
Where the site's grading needs it
X-Wing is a third-tier technique, in the tier with naked triples. In the committed frequency data over 1,000 stored classic puzzles per tier, an X-Wing was used in 0 Easy and 0 Medium puzzles, 462 Hard, 168 Expert and 95 Evil puzzles. Each puzzle is solved cheapest technique first and a technique counts if used at least once, so the counts are what the engine reached for, not a ranking of how useful the pattern is. See how difficulty is graded and the frequency guide.
X-Wing as the first of a family
An X-Wing uses two rows and two columns. Extend the same idea to three rows and three columns and you get the Swordfish. Extend it to four and you get a Jellyfish, which this site's engine does not implement. All of them are cases of the same counting argument: n rows whose candidates for a digit are confined to the same n columns use up those columns completely. If an X-Wing is available, finding it is much cheaper than any chain-based technique.
In the variants
The method needs ordinary rows and columns, so it applies on the classic, diagonal, hyper, anti-knight and 16×16 boards. The extra constraints on those boards only reduce candidates, which can create X-Wings sooner. On the irregular board rows and columns are still ordinary, so the technique carries over unchanged even though the boxes are jigsaw shapes.
Check your understanding
- The digit 5 appears in exactly two cells in row 2 (columns 3 and 8) and in exactly two cells in row 6 (columns 3 and 8). What can you remove?
- Row 2 has 5 in columns 3 and 8, row 6 has 5 in columns 3 and 7. Is there an X-Wing?
- Can an X-Wing remove a candidate from one of its own corners?
The answers: 5 from every other cell in columns 3 and 8; no, because the columns differ; and no, the corners keep the candidate.
A worked example
Follow the diagram. Look first at row 4: the digit 9 is allowed in only two of its empty cells, one in column 4 and one in column 7. Look next at row 8: again 9 is allowed in exactly two cells, in the very same columns 4 and 7. That gives the four corners of the rectangle. Now suppose row 4 puts its 9 in column 4. Then row 8 cannot, so row 8's 9 goes in column 7. Suppose instead row 4 uses column 7; then row 8 uses column 4. Both stories finish with one 9 in column 4 and one in column 7, inside the rectangle. So every other empty cell in columns 4 and 7 loses its 9 candidate, whichever story is true.
After the eliminations, rescan the two columns. Removing a 9 from a handful of cells frequently leaves a column with a single place for another digit, or turns a cell into a naked single. An X-Wing seldom stands alone in a solve; it is a lever that opens a chain of simpler steps.
How the engine and the hints use it
The technique engine checks X-Wings only after all the cheaper techniques have failed. For each digit it collects the rows (and then the columns) in which the digit has exactly two candidates and looks for two that share the same columns. When it finds a match with something to remove, the level-three hint reports the rows, the digit, the columns and the cells that lose a candidate, in the wording of the diagram caption. As with every hint, the engine works from the digits you have placed rather than from your notes, so the pattern it shows is always real for your current board.
Practice
Play a Hard puzzle on the main board with notes on. When pairs and pointing patterns run out, pick the digit with the fewest candidates left and scan its rows for pairs. If you want a nudge, the level-two hint names the technique when an X-Wing is the cheapest step.
Previous: box/line reduction. Next: Swordfish. Back to the technique list.