7
$\begingroup$

I have a sudoku puzzle seen below that I am trying to solve. I know I can punch this into some sudoku solver and get the answer but I am looking for techniques I can use to solve this. Any advice?

Sudoku board

$\endgroup$
15
  • $\begingroup$ You've got some major errors there. Bottom right corner is unsolvable (Select 1 and 5 squares, makes 2 remaining squares both 4). I find sudokos to be nearly impossible to fix after a couple of mistakes, so I'd erase and start fresh $\endgroup$ Apr 7, 2016 at 15:44
  • $\begingroup$ @ChrisCudmore You're missing the fact that the 2's aren't marked. Those cells could also be 2. $\endgroup$
    – f''
    Apr 7, 2016 at 15:46
  • 2
    $\begingroup$ it would be a lot more helpful to see the 2s, at least for me $\endgroup$
    – Matt
    Apr 7, 2016 at 15:47
  • 1
    $\begingroup$ Looks like on first pass, the two's would be everywhere except Row 6, Column 5 and center box. $\endgroup$ Apr 7, 2016 at 15:52
  • 1
    $\begingroup$ The total amount of time wasted by everyone who was confused by the lack of twos was almost certainly less than it took me to edit the image in the GIMP and add them. I did it because I felt generous: I could as easily have said "If it's too much work for you to put effort into asking your question clearly, it's too much work for anyone else to put effort into answering it". $\endgroup$ Apr 7, 2016 at 19:45

2 Answers 2

29
$\begingroup$

I'll just state some sudoku solving strategies in general, so not for the sudoku posted by you in particular. (NOTE: You probably know the first few, but I just state all of them for completeness.)

1. Naked Single

Probably the easiest one that everyone knows: When there is only one candidate available, you can simply fill it in. For example:

enter image description here

We can only fill in a 6 at the marked cell, since any of the other numbers would conflict.

2. Hidden Single

Again, a pretty easy one that everyone knows: When there is only one place in a particular row, column or block for a specific number to go, we can just fill it in. For example:

enter image description here

Here there is only one place for the 2 to go, and that is the marked cell.

3. Block / Column / Row Interactions

Now we go to some strategies to remove potential candidates for cells.

enter image description here

Here we know the 7 can't be on the same row as the 7 displayed, so it must be at either of the green marked cells. At the same time, we can dismiss the 7 as candidate from all the purple marked cells.

4. Block / Block Interactions

If a number only has two candidates for two cells in two different blocks AND both cells are in the same column or row, we can remove that number as candidate in all other columns or rows. For example:

enter image description here

Here the 3 can only be in one of the green marked cells. Since there are only two candidates per block, we can dismiss all the purple marked cells to contain a 3.

enter image description here

Same principle. We know the 2 has to be in two of the green marked cells. Because it can only be in the green cells in the two blocks, we can dismiss it as candidates in the purple cells of the third block.

5. Naked Pair, Triplet, Quad

If two cells in the same row, column or block have only the same two candidates, we can dismiss them from all the other cells in the same row, column or block.

enter image description here

Let's look at the green marked cells. Here we see a 2 and 3. Because in one of the two green cells we must have a 2, and in the other a 3 (or vice-versa), we know there can't be any 2s or 3s in the same column, so we can dismiss the 2s and 3s from the purple marked cells.

In addition. The same two green cells are also in the same block, so we can also dismiss the 2s and 3s from the yellow marked cells.

The same strategy can be used with three or even four cells.

6. Hidden Pair, Triplet, Quad

Hidden Pair is pretty similar to Naked Pair, but instead of dismissing numbers from other cells, it dismisses other numbers from the paired cells themselves.

enter image description here

Look at the two green cells. They are both in the same row, and both have the numbers 3 and 5 as potential candidates, AND the other empty cells in the same row doesn't have the 3 and 5 as potential candidates. So we know the 3 and 5 have to be in the green cells. Because of that, we can dismiss all other candidates in the green cells, so only the 3s and 5s are left.

7. X-Wing

enter image description here

If we look at the green cells we see two rows each containing two possible candidate cells for the number 9. For both of these rows, the two possible cells are in the same column. If we put a 9 in the top-right green cell, we know the top-left and bottom-right green cells are dismissed and the other 9 has to be in the bottom-left green cell. Because of that, we can dismiss the 9 from all the purple cells since they are in the same column.

8. Swordfish

Now we get into pretty obscure strategies in my personal opinion. Swordfish states that three columns can each have two or three candidates for the given number, as long as they fall on three common rows (or column & row vice-versa of course). It's pretty similar to X-Wing, but with a three times three net, instead of a two times two net. For example:

enter image description here

If we look at the green cells we see that in the three columns they only have two possible candidates for the number 1. Because each of those columns must contain one 1, and they also share three of the same rows, it means we can eliminate the 1 from the purple marked cells.

9. XY-Wing

enter image description here

Let's say we have the candidates distributed like above. We can dismiss Z from the marked cell because of the following rules:

  • If XY becomes number X, then XZ must be number Z, so * cannot be number Z
  • If XY becomes number Y, then YZ must be number Z, so * cannot be number Z

enter image description here

Same rule applies for the image above.

enter image description here

In the above image we can dismiss the 7s from the purple cells. Because:

  • If row4-column4 (containing 57) becomes 5,
    • then row4-column7 (containing 25) must be 2,
    • then row6-column8 (containing 27) must be 7 (because they are in the same block),
    • then the purple cells can't be 7 anymore.
  • If row4-column4 (containing 57) becomes 7,
    • then the purple cells can't be 7 anymore.

Both paths lead to the same conclusion, so we can dismiss 7 from the purple marked cells.

10. Colouring

With colouring we look for chains, and based on that we can eliminate candidates. For example:

enter image description here

  • If row8-column3 (green cell containing 12) is a 1, the red marked cell cannot be 1.
  • If row8-column3 is not a 1,
    • then row4-column3 (orange cell containing 12) must be a 1,
    • then row5-column1 (green cell containing 19) can't be a 1 (because they are in the same block),
    • then row5-column4 (orange cell containing 17) must be a 1,
    • so the red marked cell cannot be a 1.

Because both chains come to the same conclusion, we can eliminate candidate 1 from the red marked cell.

11. Remote Pairs

This is a combination of Naked Pairs and Colouring.

enter image description here

Let's look at cell row2-column6:

  • If row2-column6 is a 1,
    • then row2-column8 must be a 2,
    • then row3-column7 must be a 1,
    • then row4-column7 must be a 2
  • If row2-column6 is a 2,
    • then row2-column must be a 1,
    • then row3-column7 must be a 2,
    • then row4-column7 must be a 1

Either way of the other, in case of both chains, there can't be any 1s or 2s in the purple marked cell, so we can dismiss those as candidates.

NOTE: There must be an even number of cells in the chain to dismiss. For example, if the chain would only be row2-column8 -> row3-column7 -> row4-column7, then if row2-column8 is a 1, so must row4-column7; and if row2-column8 is a 2, so must row4-column7. All we know is that both cells contain the same number, but we don't know which of the two, so we cannot dismiss the 1s and 2s from row5-column8.

12. XY-Chain

Let's say we have the following cells:

enter image description here

The numbers displayed are the ONLY candidates. We can build a chain like this:

  • If row1-column1 is a 3,
    • then row1-column5 must be 7,
    • then row2-column6 must be 6,
    • then row2-column8 must be 8,
    • then row3-column9 must be 1

So, we know that either row1-column1 or row3-column9 must be a 1. Because of that, we can dismiss the 1s from the marked cells.

enter image description here

  • If row1-column2 is a 5,
    • then row6-column2 must be 4,
    • then row6-column8 must be 7,
    • then row6-column1 must be 1

So we know that either row1-column2 or row6-column1 must be a 1. Because of that, we can dismiss the 1s from the purple marked cells.

13. Forcing Chains

enter image description here

  • If row2-column1 is a 2,
    • then row1-column2 must be a 7
  • If row2-column1 is a 1,
    • then row5-column1 must be a 2,
    • then row6-column2 must be a 1,
    • then row6-column8 must be a 3,
    • then row1-column8 must be a 2,
    • then row1-column2 must be a 7

Both chains lead to the same conclusion: row1-column2 must be a 7, so we can fill it in.

14. Trial and Error

If all hope fails, you can always just guess. Just store your current state somewhere, pick an empty cell (preferably one with only two possible candidates) and fill one in. Then continue with the strategies above and see if you can solve it completely. If you can, congrats. If you cannot, try the other one. (If you still can't solve it, guess another starting cell with two possible candidates and repeat.)


So, I hope these solving strategies will help you solve your sudoku.

Sorry all for the long post, but I wanted to include all strategies.

$\endgroup$
5
  • 2
    $\begingroup$ Best explanation of these strategies I've seen. Well done and thank you. $\endgroup$
    – Wildcard
    Apr 7, 2016 at 21:08
  • 1
    $\begingroup$ Thank you so much for this post! A lot of these I didn't know about (I think I'm only up to #6). This is a real great resource so I'll mark this the answer for anyone else to see. $\endgroup$
    – Plinth
    Apr 8, 2016 at 17:08
  • 1
    $\begingroup$ Being a beginner in sudoku I've some very basic questions. Do you mind sparing you time answering? $\endgroup$
    – Tyto alba
    Nov 5, 2016 at 9:42
  • $\begingroup$ What about XYZ-Wing and Nishio? Could you add them? $\endgroup$ Dec 10, 2018 at 17:55
  • $\begingroup$ @VictorStafusa Didn't even knew about Nishio before. I'll see if I have some time to edit it in in the near future. $\endgroup$ Dec 10, 2018 at 18:05
10
$\begingroup$

I don’t know whether there’s a standard, concise method for discussing Sudoku puzzles, so I’ll use Excel notation:

legend

(Unfortunately, Excel wouldn’t let me draw borders to the left of Column A or above Row 1, so I just left off all the outside borders.)

$\color{red}{\text{First,}}$ the only cells in the DEF/123 box where 4 and 7 can go are cells D3 and E3.  Therefore, those two values, and no others, must go into those two cells:

That may be the breakthrough you needed.  I’ll take you through the next few steps, anyway.

$\color{orange}{\text{Second,}}$ that means that the only cell in the DEF/123 box where 1 can go is cell D2:
$\color{green}{\text{Third,}}$ that means that cells H2 and I2 cannot contain 1, so it must go into G1 or G3:
$\color{blue}{\text{Fourth,}}$ cell G6 must contain 5, because every other digit appears somewhere else in Column G and/or Row 6.  And then cell G9 must contain 2, by the same argument:

It seems to be fairly straightforward from there.  Here’s the final answer:

$\endgroup$
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.