Main Page - Back
 
X-Wing Strategy
From sudokuwiki.com, the puzzle solver's site
breakline
This strategy is looking at single numbers in rows and columns. It should be easier to spot in a game as we can concentrate on just one number at a time. The rule is

When there are
  • only two possible cells for a value in each of two different rows,

  • and these candidates lie also in the same columns,

then all other candidates for this value in the columns can be eliminated.


The reverse is also true for 2 columns with 2 common rows.

X-Wing Example


The above picture shows a classic x-wing, this example being based on the number six. The X is formed from the diagonal correspondence of squares marked A, B, C and D. What's special about them?
Well, A and B are a locked pair of 6's. So is C and D. They are locked because they are the only 6's in the first and last rows. We know therefore that if A turns out to be a 6 then B cannot be a 6, and vice versa. Likewise if C turns out to be a 6 then D cannot be, and vice versa.

What is interesting is the 6's present in the two columns 6 and 9 directly between A and C and B and D. These have been highlighted with yellow boxes. Think about the example this way. A, B, C and D form a rectangle. If A turns out to be a 6 then it rules out a 6 at C as well as B. Because A and CD are 'locked' then D must be a 6 if A is. Or vice versa. So a 6 MUST be present at AD or BC. If this is the case then any other 6's along the edge of our rectangle are redundant.

We can remove the 6's marked in the cyan squares. This is good news because this leaves only a 9 at G9 and we can complete.

This strategy works in the other direction as well. If we had two pairs in two columns and those four numbers shared two rows, then we can eliminate any other occurrences of those numbers on the same rows.
Generalising X-Wing

X-Wing is not restricted to rows and columns. We can also extend the idea to boxes as well.
If we generalise the rule above we get:

When there are
  • only 2 candidates for a value, in each of 2 different units of the same kind,

  • and these candidates lie also on 2 other units of the same kind,

then all other candidates for that value can be eliminated from the latter two units.


Now we have 6 combinations:
  1. Starting from 2 rows and eliminating in 2 columns
  2. Starting from 2 columns and eliminating in 2 rows
  3. Starting from 2 boxes and eliminating in 2 rows
  4. Starting from 2 boxes and eliminating in 2 columns
  5. Starting from 2 rows and eliminating in 2 boxes
  6. Starting from 2 columns and eliminating in 2 boxes


Here is an example of combination 5. Starting from 2 rows and eliminating in 2 boxes, in this case the last two boxes in the Sudoku. The rows are 7 and 8 and they each have two 7s. Our x-Wing is now a trapeziod but the logic is the same. We can be certain that 7 can be eliminated at X, Y and Z

X-Wing Example

But HOLD UP one moment. There is a simpler strategy that does the same job!

X-Wing Example

A and B above are a pointing pair. This removes the same 7s in the same place. Combination 6 is also the complement of a pointing pair. Combinations 3 and 4 are also complements of the Line/Box Reduction. Our generalization of X-Wing to boxes hasn't profited us at all. We learn that

X-Wings containing boxes are the inverse of the Intersection Removal strategies


breakline

Comments...

Wednesday 30-Jun-2010

... by: colin pearce

Hi Andrew,
thank you for this extraordinary and marvellous site.
I have a question on your X-wing principle. The top diagram with the yellow boxes ABCD... (and I hope I;m not being obtuse here), but why couldn't the four yellow boxes include, instead of C and D, the two blue boxes above them, this eliminating C and D as options?

Thanks again.. I love this resource,
cheers
colin

Friday 9-Apr-2010

... by: Marv Rowe

Stopped using X-Wing on anything but squares and rectangles after I did www.websudoku.com Extreme Puzzle 80,052,202,927 - Had only two instances of 7's in Columns 3 & 4 - Cells r5c4, r6c3, r8c3 & r8c4 --> thought I could eliminate all other 7's from row 8 - wrong assumption - 7 in r8c7 was the correct answer - at lower levels (easy, medium, hard and evil) could always eliminate numbers is cells if the x-wing was a trapizoid - not so in this case

Thursday 25-Feb-2010

... by: CS Vidyasagar

X wing is traditionally diaognal. In the trapezoidal like you explained, If 7 is present in cell A, then it can not be in cell B and vice versa. So any other 7 under the influence of cell A or B can be eliminated. Same logic applies to C and D. That way 7 in cells Y and Z can be eliminated by this logic. But 7 in Cell X can not be eliminated as it it not controlled by A or B or C or D.
thanks

Wednesday 3-Feb-2010

... by: Kantilal M Mane

Excellent technique !!!

Friday 18-Dec-2009

... by: John Mathews

If I am understanding this right, then the pattern can only be a square, rectangle, or trapezoid shape for any of these X-wing solutions. Is that correct?

Andrew Stuart writes:
Correct. To be trapizoid the connections between the cells are through the box they share - not just the rows and columns - which alone would produce a rectangulat pattern.

Sunday 4-Oct-2009

... by: Nick Pannell

I'm a mathematician and I'm really intrigued at the setting of patterned sudokus and the decision as to what makes one easy, medium or hard. Your soultion strategies are very interesting, although the explanations are a bit difficult to follow: but your graphics are excellent. Thank you

Saturday 8-Aug-2009

... by: Kim Sidey

Andrew,

The margin of the left column in the first figure contains numbers. You likely meant to use alphanumerics (A-I).

Great web page. You've helped me tremendously!

-Kim

Andrew Stuart writes:
Yes, thats an old snap shot. needs to be redone

Add your comments

A confirmation email will be sent to you after submitting.

Your Name

Email Address - required for confirmation (it will not be displayed here)

Your comment or question

Remember me


Please keep your comments relevant to this article. Email addresses are never displayed, but they are required to confirm your comments.

When you enter your name and email address, you'll be sent a link to confirm your comment. If you want to be remembered, the check box above will store a cookie with your name and email address on your computer.

Line breaks and paragraphs are automatically converted — no need to use <p> or <br> tags.



Article created on 10-April-2008. Views: 87574
This page was last modified on 12-April-2008, at 10:10.
All text is copyright and for personal use only but may be reproduced with the permission of the author.
Copyright Andrew Stuart @ Scanraid Ltd, 2008