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 picture on the right shows a classic X-Wing, this example being based on the number seven. 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 7's. So is C and D. They are locked because they are the only 7's in rows B and F. We know therefore that if A turns out to be a 7 then B cannot be a 7, and vice versa. Likewise if C turns out to be a 7 then D cannot be, and vice versa.
What is interesting is the 7's present elsewhere in the fourth and eighth columns. These have been highlighted with green boxes.
Think about the example this way. A, B, C and D form a rectangle. If A turns out to be a 7 then it rules out a 7 at C as well as B. Because A and CD are 'locked' then D must be a 7 if A is. Or vice versa. So a 7 MUST be present at AD or BC. If this is the case then any other 7's along the edge of our rectangle are redundant. We can remove the 7's marked in the green squares.
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. Since this strategy works in the other direction as well, we will look at an example next.
In this second example I've chosen a Sudoku puzzle where an enormous number of candidates can be removed using two X-Wings. The first is a '2-Wing'. The yellow high lighted cells show the X-Wing formation. Note that the orientation is in the columns this time, as opposed to rows as above. Looking at columns we can see that candidate 2 only occurs twice - in the yellow cells. Which ever way the 2s could be placed (E5/J8 or E8/J5) six other 2s in the rows can be removed - the green highlighted cells.
A few steps later the second X-Wing is found on candidate 3 in the same rows. Whichever way round the 3 can be placed in those rows (E2/J8 or E8/J2) there can be no other 3 in rows E and J except in those yellow cells.
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:
Starting from 2 rows and eliminating in 2 columns
Starting from 2 columns and eliminating in 2 rows
Starting from 2 boxes and eliminating in 2 rows
Starting from 2 boxes and eliminating in 2 columns
Starting from 2 rows and eliminating in 2 boxes
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 trapezoid but the logic is the same. We can be certain that 7 can be eliminated at X, Y and Z
But HOLD UP one moment. There is a simpler strategy that does the same job!
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 generalisation of X-Wing to boxes hasn't profited us at all. We learn that
In the second example above, showing the 2-Wing, why has column 8 been selected , and not column 9?. Why is X -wing not between E5/J9 and E9/J5 ? Similarly, in the next example, that of the 3-wing, whu again column 8 in preference to column 9? Thanks Sajan
Andrew Stuart writes:
E9 and J9 on 2 can't be part of an X-Wing since 2s occur four times in the column. We're looking for pairs in one direction (in this case columns) so we can eliminate in the other direction (rows)
Saturday 13-Apr-2013
... by: Trophy
I've been doing sudoku for years and still having trouble with the most difficult ones. After using many of the "hint" I still get to a point where I'm stymied. I end up having to guess at the right # for a box in some cases (usually where there are two #s the same in 2 boxes in a row or a colume ) If I guess wrong I have to go back and use the other # and it then usually works to solve the puzzle. Is this a common thing, or should there always be a way to solve the pussle without guessing?
Andrew Stuart writes:
The reason I got into Sudoku strategies was because I was unsatisfied with having to guess and I thought there must be some underlying rule that I was missing. However, Sudoku has proved to be extremely deep and there are still examples which even the most advanced strategies cannot crack with logic alone. I publish these here.
Now, people do come up with logical methods and it's usually by combining several ideas in one go. This is the coal face I'm picking at now, trying to generalise these ideas and get them into code.
However, it will be a rare puzzle in the newspapers that can't be solved logically. We really have to search for a long time to find unsolvables (currently they are 1/10,000) from my generator.
Computers can't mimic inspiration and there's still a place for that in Sudoku, if you get stuck
Wednesday 13-Mar-2013
... by: Daran
sir can i apply the same strategies for 16X16 and 25X25 grid sudokus...or i need to change any conditions to select the possibilites for the strategies
Andrew Stuart writes:
Yes, exactly the same strategies, although some need to scale differently. I’m pretty sure there are no specific strategies for higher order Sudoku the don’t occur for 9x9.
Saturday 16-Feb-2013
... by: Complex sudoku newbie
Loved your explanations! The illustrations make it especially easy and simple to follow for a non-mathematician but a sudoko fan. It is nice to find methods to improve my game that I can follow and use. Thank you!
Friday 4-Jan-2013
... by: Mbakhtian@gmail.com
Great site for technique. But choice of black as a background color and the size of print for this venue is compromising the quality of reading about these lovely intricacies!
Tuesday 28-Aug-2012
... by: RLets
Should "...the only 7's in the first and last rows" in paragraph 3 be "...the only 7's in the 2nd and 6th rows"? Great web site. Love the solver. Now, I need to read your book!
Andrew Stuart writes:
Typo fixed, thanks! Textual hangover from old diagram
Friday 20-Apr-2012
... by: Dino Hsu
To further Konrad's study of single column (or a single row) scenario, the problem is that the two X-wing locations in the 'single column' can be both non-X, without the 'other column' also aligned, resulting in failure to lock in the two locaitons for X in the 'single column'.
Tuesday 7-Feb-2012
... by: Konrad M Kritzinger
It seems that I was over-hasty with my comment on 2-Feb-2012. The proposition works in some cases but not others.
Thursday 2-Feb-2012
... by: Konrad M Kritzinger
X-Wing doesn't seem to require an X. The same principle seems applicable to a single column (or a single row). If there is a locked pair in one row, and the same locked pair occurs in another row, then, if at least one cell from each locked pair is in the same column, all other occurrences of that number in that column can be eliminated. The same principle applies if rows and columns are exchanged.
Saturday 26-Mar-2011
... by: Yves Sioui
In X-wing example 2, using cells CJ59 instead CJ58 would 'erased' the 2's in column 8. Since that new choice respect the same conditions as the one you choose, the results are in conflict with each other. In one instance the value 2 in column 8 is possible and the other decline that. I find it disturbing.
Andrew Stuart writes:
CJ59 is not a valid X-Wing since column 9 contains more than two 2s - so the conflict you highlight does not arise
Thursday 30-Dec-2010
... by: Ted L
In X Wing example 1, you state that after elimination only a 9 remains in cell G9. Is this incorrect, for it looks that a 2 and a 9 remain in this cell. I loaded the example to confirm this, and found that simple colouring is still required before the puzzle can be completed. A wonderful site which gives great pleasure and instruction - thank you very much.
Andrew Stuart writes:
Thx for this prompt. I believe I left a sentence about a completed cell in the paragraph because of the old diagram. You are correct a 2 remains in G9 so I've removed that sentence.
Sunday 19-Dec-2010
... by: William Mann
Your answer to Colin Pearce, June 30, doesn't make sense. It isn't because "the blue boxes contain other 6s in the row". I think what you should have told him is that both pairs (A/B and C/D) are the only two squares with sixes in their rows (locked pairs), therefore, either A or B must be a six, and either C or D must be a six. All other sixes in those columns can be eliminated.
Saturday 16-Oct-2010
... by: Harold Binley
Marv Rowe, 9th April, has made the same mistake as I used to. The X-wing only works as a trapezoid if each pair of the four cells share the same units; they share columns 3 and 4, but although r8c3 & r8c4 share the same row r5c4 & r6c3 have nothing in common. H
Friday 6-Aug-2010
... by: Rohan
As a complete beginner and coming to grasp with the logic of X-Wing, it seems there are certain conditions that need to apply before this strategy can be applied. Amongst which are: 1. No occurrence of the number (in this case 6) can occur in the rows between A and B or C and D; 2. the classic X-Wing uses only the extreme boxes at the edges of the puzzle since otherwise, as Colin Pierce pointed out why could one not use the blue boxes above C and D? Because if one did there would be a very different result. Whatever, thanks for your very useful site, it has helped me greatly!
Andrew Stuart writes:
Your condition 2 is false. I've added another example - which I hope is very illustrative of the strategy.
Tuesday 3-Aug-2010
... by: Elmer Schartow
Regarding X-Wing Strategy: I'm being picky but the second para after the first illus points out the boxes BETWEEN AB and CD which are highlighted in yellow. On my computer the boxes ABCD themselves are yellow and the boxes BETWEEN ABCD are highlighted in cyan.
I believe the first question posed by colin pearce is a valid one and needs to be answered. Also the situation regarding the 7 in cell X posed by CS Vidyasager appears to be completely valid IF there are no 7's in A and B.
Andrew Stuart writes:
Fixed the 'yellow' word in the second para. thx (refered to an old diagram)
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
Andrew Stuart writes:
because the blue boxes contain other 6s in the row
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.
Wednesday 2-Dec-2009
... by: Faris
I love your graphics though I do agree with Pannel that the explnations are not easy to follow at times. Keep the nice work!
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
Comments
Comments TalkWednesday 28-Aug-2013
... by: fdan
Thanks, trying to work at creating suduko puzzlesSunday 28-Jul-2013
... by: Lydia
Best explanation ever of x-wing!Wednesday 24-Jul-2013
... by: sajan
In the second example above, showing the 2-Wing, why has column 8 been selected , and not column 9?. Why is X -wing not between E5/J9 and E9/J5 ? Similarly, in the next example, that of the 3-wing, whu again column 8 in preference to column 9?Thanks
Sajan
Saturday 13-Apr-2013
... by: Trophy
I've been doing sudoku for years and still having trouble with the most difficult ones. After using many of the "hint" I still get to a point where I'm stymied. I end up having to guess at the right # for a box in some cases (usually where there are two #s the same in 2 boxes in a row or a colume ) If I guess wrong I have to go back and use the other # and it then usually works to solve the puzzle. Is this a common thing, or should there always be a way to solve the pussle without guessing?Now, people do come up with logical methods and it's usually by combining several ideas in one go. This is the coal face I'm picking at now, trying to generalise these ideas and get them into code.
However, it will be a rare puzzle in the newspapers that can't be solved logically. We really have to search for a long time to find unsolvables (currently they are 1/10,000) from my generator.
Computers can't mimic inspiration and there's still a place for that in Sudoku, if you get stuck
Wednesday 13-Mar-2013
... by: Daran
sir can i apply the same strategies for 16X16 and 25X25 grid sudokus...or i need to change any conditions to select the possibilites for the strategiesSaturday 16-Feb-2013
... by: Complex sudoku newbie
Loved your explanations! The illustrations make it especially easy and simple to follow for a non-mathematician but a sudoko fan. It is nice to find methods to improve my game that I can follow and use. Thank you!Friday 4-Jan-2013
... by: Mbakhtian@gmail.com
Great site for technique. But choice of black as a background color and the size of print for this venue is compromising the quality of reading about these lovely intricacies!Tuesday 28-Aug-2012
... by: RLets
Should "...the only 7's in the first and last rows" in paragraph 3 be "...the only 7's in the 2nd and 6th rows"? Great web site. Love the solver. Now, I need to read your book!Friday 20-Apr-2012
... by: Dino Hsu
To further Konrad's study of single column (or a single row) scenario, the problem is that the two X-wing locations in the 'single column' can be both non-X, without the 'other column' also aligned, resulting in failure to lock in the two locaitons for X in the 'single column'.Tuesday 7-Feb-2012
... by: Konrad M Kritzinger
It seems that I was over-hasty with my comment on 2-Feb-2012. The proposition works in some cases but not others.Thursday 2-Feb-2012
... by: Konrad M Kritzinger
X-Wing doesn't seem to require an X. The same principle seems applicable to a single column (or a single row). If there is a locked pair in one row, and the same locked pair occurs in another row, then, if at least one cell from each locked pair is in the same column, all other occurrences of that number in that column can be eliminated. The same principle applies if rows and columns are exchanged.Saturday 26-Mar-2011
... by: Yves Sioui
In X-wing example 2, using cells CJ59 instead CJ58 would 'erased' the 2's in column 8. Since that new choice respect the same conditions as the one you choose, the results are in conflict with each other. In one instance the value 2 in column 8 is possible and the other decline that. I find it disturbing.Thursday 30-Dec-2010
... by: Ted L
In X Wing example 1, you state that after elimination only a 9 remains in cell G9. Is this incorrect, for it looks that a 2 and a 9 remain in this cell. I loaded the example to confirm this, and found that simple colouring is still required before the puzzle can be completed.A wonderful site which gives great pleasure and instruction - thank you very much.
Sunday 19-Dec-2010
... by: William Mann
Your answer to Colin Pearce, June 30, doesn't make sense. It isn't because "the blue boxes contain other 6s in the row". I think what you should have told him is that both pairs (A/B and C/D) are the only two squares with sixes in their rows (locked pairs), therefore, either A or B must be a six, and either C or D must be a six. All other sixes in those columns can be eliminated.Saturday 16-Oct-2010
... by: Harold Binley
Marv Rowe, 9th April, has made the same mistake as I used to. The X-wing only works as a trapezoid if each pair of the four cells share the same units; they share columns 3 and 4, but although r8c3 & r8c4 share the same row r5c4 & r6c3 have nothing in common.H
Friday 6-Aug-2010
... by: Rohan
As a complete beginner and coming to grasp with the logic of X-Wing, it seems there are certain conditions that need to apply before this strategy can be applied. Amongst which are:1. No occurrence of the number (in this case 6) can occur in the rows between A and B or C and D;
2. the classic X-Wing uses only the extreme boxes at the edges of the puzzle since otherwise, as Colin Pierce pointed out why could one not use the blue boxes above C and D? Because if one did there would be a very different result.
Whatever, thanks for your very useful site, it has helped me greatly!
Tuesday 3-Aug-2010
... by: Elmer Schartow
Regarding X-Wing Strategy:I'm being picky but the second para after the first illus points out the boxes BETWEEN AB and CD which are highlighted in yellow. On my computer the boxes ABCD themselves are yellow and the boxes BETWEEN ABCD are highlighted in cyan.
I believe the first question posed by colin pearce is a valid one and needs to be answered. Also the situation regarding the 7 in cell X posed by CS Vidyasager appears to be completely valid IF there are no 7's in A and B.
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 caseThursday 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?Wednesday 2-Dec-2009
... by: Faris
I love your graphics though I do agree with Pannel that the explnations are not easy to follow at times. Keep the nice work!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