Solving Tips

Sudoku X-Wing Technique: Advanced Cross-Row/Column Elimination

2025-01-24 · 9 min read

X-Wing is one of the most classic advanced Sudoku techniques and an essential skill for solving difficult and expert-level puzzles. Its name comes from the X-wing starfighter in "Star Wars" because the pattern formed by this technique visually resembles an X shape. The core idea is: when a candidate number appears in only two positions in two rows, and these positions are in the same two columns, the candidate can be eliminated from other cells in those two columns.

Core Principle:
If a number appears only in columns X and Y in row A, and also only in columns X and Y in row B, then this number must occupy one position in column X and one in column Y between rows A and B. Therefore, other cells in columns X and Y (not in rows A or B) cannot contain this number.

X-Wing Rule

If a candidate appears in only two positions in two rows, and these positions are in the same two columns,
Then this candidate can be deleted from other rows in those two columns (rows not in the X-Wing).

Before reading this article, it is recommended to master the Sudoku naming conventions for rows, columns, and boxes and intermediate techniques, which will help you understand the analysis examples below.

X-Wing principle diagram
X-Wing principle: four candidate 6s form rectangle vertices, X-shaped crossing lines show elimination logic

Example Analysis: Row-based X-Wing

Let's look at a classic X-Wing example involving candidate 6 in Row 3 and Row 9.

Sudoku X-Wing Example
Figure: Candidate 6 in Row 3 and Row 9 forms an X-Wing pattern
Open this example in solver

Current Board Data

Based on CSV81 format candidate data, we focus on the distribution of candidate 6 in Row 3 and Row 9:

Row 3 cells:

  • R3C1: Filled number 5
  • R3C2: Candidates {1, 2, 6}
  • R3C3: Filled number 4 (given)
  • R3C4: Filled number 3 (given)
  • R3C5: Candidates {1, 2}
  • R3C6: Candidates {1, 2, 9}
  • R3C7: Filled number 7 (given)
  • R3C8: Candidates {1, 6, 9}
  • R3C9: Filled number 8 (given)

Row 9 cells:

  • R9C1: Filled number 4 (given)
  • R9C2: Candidates {6, 9}
  • R9C3: Filled number 3 (given)
  • R9C4: Candidates {1, 2}
  • R9C5: Filled number 8
  • R9C6: Candidates {1, 2}
  • R9C7: Filled number 5
  • R9C8: Candidates {6, 9}
  • R9C9: Filled number 7

Column 2 cells to check (elimination targets):

  • R1C2: Candidates {1, 2, 3, 6}
  • R4C2: Candidates {2, 3, 4, 6}
  • R8C2: Candidates {1, 2, 6, 8, 9}

Column 8 cells to check (elimination targets):

  • R8C8: Candidates {1, 2, 6, 9}

Analysis Process

1 Observe Row 3: In Row 3, candidate 6 only appears in two positions: R3C2 (candidates 1,2,6) and R3C8 (candidates 1,6,9).
2 Observe Row 9: In Row 9, candidate 6 also only appears in two positions: R9C2 (candidates 6,9) and R9C8 (candidates 6,9).
3 Discover X-Wing pattern: Candidate 6 only appears in Column 2 and Column 8 in both Row 3 and Row 9, forming four vertices of a rectangle: R3C2, R3C8, R9C2, R9C8. This is the X-Wing pattern.
X-Wing Rectangle Pattern
X-Wing Pattern

Four 6s form rectangle vertices, X-shaped crossing lines show elimination logic, red arrows indicate elimination directions

4 Understand the logic: Since Row 3's 6 can only go in R3C2 or R3C8, and Row 9's 6 can only go in R9C2 or R9C8, there are two scenarios:
  • Case 1: R3C2 is 6, then Row 9 can only have 6 in R9C8
  • Case 2: R3C8 is 6, then Row 9 can only have 6 in R9C2

In either case, Column 2 and Column 8's 6s are occupied by Row 3 and Row 9.

5 Execute elimination: Therefore, cells in Column 2 except Row 3 and Row 9 cannot have 6, and cells in Column 8 except Row 3 and Row 9 also cannot have 6. Specifically:
  • R1C2: Delete candidate 6 (keep 1,2,3)
  • R4C2: Delete candidate 6 (keep 2,3,4)
  • R8C2: Delete candidate 6 (keep 1,2,8,9)
  • R8C8: Delete candidate 6 (keep 1,2,9)
Conclusion:
X-Wing: In Row 3 and Row 9, candidate 6 only appears in R3C2, R3C8, R9C2, R9C8 (all in Column 2 and Column 8).
Action: Delete candidate 6 from R1C2, R4C2, R8C2, R8C8.

Two Forms of X-Wing

X-Wing can have two symmetric forms:

1. Row-based X-Wing

This is the case in the example above:

  • Observation target: Two rows
  • Pattern feature: A candidate appears only in the same two columns in both rows
  • Elimination target: Delete the candidate from other rows in those two columns

2. Column-based X-Wing

The reverse form but same principle:

  • Observation target: Two columns
  • Pattern feature: A candidate appears only in the same two rows in both columns
  • Elimination target: Delete the candidate from other columns in those two rows
Memory Tip:
Row-based X-Wing eliminates from columns, Column-based X-Wing eliminates from rows.
If an X-Wing is found in two rows, eliminate from columns; if found in two columns, eliminate from rows. This is because once the candidate's position in rows (or columns) is fixed, the corresponding columns (or rows) are occupied.

How to Find X-Wing?

Finding X-Wing requires systematic observation:

1 Choose a candidate: Focus on one candidate number (1-9), analyze each one.
2 Find rows (or columns) with only two candidate positions: Find rows (or columns) where the candidate appears in only two cells.
3 Find a pair: See if another row (or column) also has the candidate in only two cells, and in the same two columns (or rows).
4 Confirm X-Wing pattern: If you find such two rows (or columns), an X-Wing pattern is formed, creating four vertices of a rectangle.
5 Execute elimination: Delete the candidate from other cells in the corresponding columns (or rows).
Important Notes:
  • X-Wing requires exactly two rows (or columns), with the candidate appearing in exactly two positions in each
  • The column (or row) positions of the candidate in both rows (or columns) must be exactly the same
  • If a candidate appears in 3 or more positions in a row, X-Wing cannot be formed
  • X-Wing is a cross-row/column technique, not involving the box concept
  • Finding X-Wing is time-consuming, recommended to try after all intermediate techniques are exhausted

X-Wing and Other Techniques

X-Wing vs Box-Line Reduction

Both involve row/column relationships, but at different levels:

  • Box-Line Reduction: Observes within a single unit (row/column/box), uses intersection of rows/columns with boxes
  • X-Wing: Observes across two units, uses symmetric relationship between two rows (or columns)

Extensions of X-Wing

X-Wing can be extended to more complex forms:

  • Swordfish: Extended version with three rows and three columns
  • Jellyfish: Extended version with four rows and four columns

These techniques have the same principle as X-Wing, just involving more rows and columns, making them harder to identify.

Technique Summary

Key points of the X-Wing technique:

  • Observation dimension: Cross-row/column observation, looking for rectangular symmetric patterns
  • Identification condition: A candidate appears in only the same two columns (or rows) in two rows (or columns)
  • Pattern formation: Four candidate positions form four vertices of a rectangle
  • Elimination rule: Row-based X-Wing eliminates from columns, Column-based X-Wing eliminates from rows
  • Application scenario: Advanced solving method when intermediate techniques cannot break through
  • Identification difficulty: Requires systematic analysis of each candidate's distribution, time-consuming
Practical Suggestions:
X-Wing is not common in practice, but often the key to breakthroughs in difficult puzzles. Suggestions:
  • Use all intermediate techniques first (naked pairs, triples, hidden pairs, etc.)
  • Analyze digits with fewer candidates (e.g., digits with only 5-6 candidate positions)
  • Use candidate marking feature to more easily see distribution patterns
  • Use notes or scratch paper to record each digit's distribution across rows and columns

Practice Suggestions

To master the X-Wing technique, suggestions:

  • Systematically check each candidate's distribution across rows and columns when solving
  • Use different colors to mark candidates, helping visual identification of symmetric patterns
  • For high difficulty puzzles, use intermediate techniques first, then actively look for X-Wing opportunities
  • Understanding the principle is more important than remembering terms, understand "why can we eliminate"
Practice Now:
Start a hard difficulty Sudoku game, specifically looking for and applying the X-Wing technique!