X-Wing: the first fish pattern in sudoku
X-Wing lets you remove a candidate from two columns by looking at two rows at the same time. It is one of the techniques Hard puzzles need, and the first step into the family of fish patterns.
X-Wing is the first technique in this series that links two rows and two columns at once. When one digit can go in only two places in each of two rows, and those places line up in the same columns, the digit can be cleared from the rest of those columns. You will need it when singles, pairs and locked candidates no longer move the puzzle forward.
What is an X-Wing?
An X-Wing is a pattern made by one candidate digit in four cells. In two different rows, the digit can go only in the same two columns, so the four cells form a rectangle. Each of those two columns must contain the digit exactly once, and the pattern already places it inside the two rows. So the digit can be removed from every other cell in those two columns.
How it works
Cells are written as r#c#, row first and then column, as in the previous guides. So r2c3 is row 2, column 3.
Here is the logic with the digit 7. In row 2, the 7 can go only in r2c3 or r2c8. In row 6, it can go only in r6c3 or r6c8. If the 7 in row 2 is in column 3, then column 3 is used up in row 2, so the 7 in row 6 must be in column 8. If the 7 in row 2 is in column 8, the 7 in row 6 must be in column 3. Either way, columns 3 and 8 each hold the 7 in row 2 or row 6, and nowhere else.
The method has three steps:
- Find a digit with two candidate cells in a row. Do this for every row and for the digit you are checking.
- Find a second row with the same two columns. Two rows form an X-Wing only if their two cells sit in exactly the same two columns.
- Remove the digit from the rest of those columns. Every other cell in the two columns, outside the two rows, loses that digit.
The diagram below shows candidate 7 in rows 2 and 6, limited to columns 3 and 8. The cells marked x are the four corners of the pattern. The cells marked - are r4c3, r8c3 and r5c8, where 7 is removed.
The column-based version
The same logic works with rows and columns swapped. If candidate 4 appears in only two cells of column 2 and only two cells of column 7, and those four cells sit in rows 3 and 8, then the 4 can be removed from the other cells in rows 3 and 8. The next diagram shows this case. The cells marked x are r3c2, r8c2, r3c7 and r8c7, and the cells marked - are r3c5, r3c9 and r8c4.
How to spot it
- Mark every row where a digit has exactly two candidates. Go through the digit row by row. Two cells in a row is the starting point for an X-Wing.
- Compare the column numbers. Two such rows form an X-Wing only when their cells share the same two columns. Two rows with different columns do not match.
- Check the columns that remain. Once you have an X-Wing, look at the other cells in its two columns that still hold the digit. Those are the cells you can clear.
- Look in both directions. Patterns appear in rows and in columns. Checking both gives you twice as many chances to find one.
- Complete your pencil marks first. A missing candidate in one of the corner cells hides the pattern. Make sure every possible digit is written in before you search for an X-Wing.
A worked example
Take the column-based diagram above and follow the reasoning for candidate 4.
Column 2 has 4 only in r3c2 and r8c2. Column 7 has 4 only in r3c7 and r8c7. Suppose the candidate lists in these rows are r3c2 {4,6}, r8c2 {2,4}, r3c7 {4,9} and r8c7 {4,5}. The 4 in column 2 is in row 3 or row 8, and so is the 4 in column 7. Therefore rows 3 and 8 each hold their 4 inside columns 2 and 7. No other cell in row 3 or row 8 can be 4.
That removes 4 from three other cells:
- r3c5 {1,4,5} loses the 4 and becomes {1,5}.
- r3c9 {3,4,8} loses the 4 and becomes {3,8}.
- r8c4 {4,7,9} loses the 4 and becomes {7,9}.
The four corners keep their candidates, and nothing changes in the rest of columns 2 and 7 outside rows 3 and 8, because the pattern does not reach those cells. The X-Wing has done its job when the 4 is gone from the rows that it controls.
Common mistakes
- Accepting a third candidate in one row. If one of the rows has a third cell with the digit, the pattern does not hold. That third cell could be the digit, so nothing can be removed.
- Removing from the corners. The four cells of the pattern keep the digit. Only the other cells in the two columns, or in the two rows for the column version, lose it.
- Removing from the wrong place. For a row-based X-Wing, the cells that change are in the two columns, outside the two rows. A cell inside one of the rows of the pattern is not affected.
- Checking only one direction. Many players search rows and forget columns. Both are valid.
- Overlooking an old candidate. A digit that you did not write in a cell cannot be used. Check the pencil marks again before giving up.
Practice X-Wing in Hush
Hush rates X-Wing as a Hard technique. The first 10 solved Hard or Expert puzzles are free, and Hush Plus, a one-time purchase at $4.99 with no subscription, unlocks unlimited Hard and Expert puzzles. Highlights for the row, column, box and matching numbers make it easier to see where a digit still appears, which is exactly what an X-Wing search needs. Notes also clean themselves up after you place a number, so the candidate lists stay accurate while you look.
Start by reviewing locked candidates and naked triples and quads, which often clear the candidates that make an X-Wing possible. After you are comfortable with two rows and two columns, move on to Swordfish, which extends the same idea to three rows. You can see the whole Hard and Expert picture in the technique guides or read more about Expert sudoku.
Frequently asked questions
What is an X-Wing in sudoku?
An X-Wing is a pattern in which one digit can go in only two cells in each of two rows, and those four cells sit in the same two columns. The digit can then be removed from the other cells in those two columns.
Does X-Wing also work with columns?
Yes. The column-based version works the same way with rows and columns swapped. The digit is confined to two rows in two columns, and it is removed from the other cells in those two rows.
How is X-Wing related to Swordfish?
Swordfish is the three-row version of the same idea. Three rows hold one digit in three columns, and each row uses two or three of those columns.
Which Hush level includes X-Wing?
Hard. Hush rates difficulty by the techniques a puzzle needs, and X-Wing is one of them. The first 10 solved Hard or Expert puzzles are free, and Hush Plus unlocks unlimited Hard and Expert puzzles.