How to solve a Sudoku puzzle

NOTE: For great Sudoku strategies see Sudoku Strategies.

Here is an example of how to solve a moderately hard Sudoku puzzle.

Here is the puzzle. The numbers on the side and top relate to the cell numbering that will be used here. For example the cell (4,3), which contains a 2, refers to the cell that is 4th column from the top left that intersects with the 3rd row from the top left.

sud1

  1. Make a frequency list

  2. The first thing I do is to make a "frequency list". This is a list of the quanity of the 9 numbers. For this puzzle it's:

    Number Occurances
    1 2
    2 3
    3 4
    4 0
    5 4
    6 5
    7 2
    8 3
    9 3


    Now order the list by highest to lowest quantity, we'll use this list to attack the highest quantity numbers first. For this puzzle the order is 6, 3, 5, 2, 8, 9, 1, 7, 4
  3. Solve the 6's.

  4. One of the issues in solving a Sudoku is the clutter caused by writting down all of the possibilities in a cell. I only write down possibilities if they only occur in two cells in a 3x3 block. For example, because of the 6 in (5,3), the 6 in (2,6), and the 6 in (1,8), a 6 can only occur in (3,1) or (3,2) as shown here. Another "rule" I use is this: once a row, column, or box has 3 or less unfilled numbers, fill in all of the possiblities in small numbers.

    sud2

  5. Solve the 3's.



  6. sud3

  7. Solve the 5's. It's important to notice the occurances of the "65" (see (3,1) and (3,2)) pair combinations in two places in the puzzle. Those pairs can only be either 6/5 or 5/6 combinations.



  8. sud4

  9. Solve the 2's. Notice that we get to put the 2 in cell (3,9) because of the fact that a 2 can't go in either (7,9) or (8,9).



  10. sud5

  11. Solve the 8's, (3,3) gets placed first because of the little red 8's in (7,1) and (9,1), the 8 in (1,5) and the 8 in (6,2). Then the 8 in (2,8) get's placed. When one of the 2 little "3" numbers gets covered with an 8 then the other one has to be a 3 as in (2,7). When you discover a number (like 3 here) that's not the current number were solving at the moment then we need to re-solve for the new number (3). This yields 3 in (4,6) and (6,8) as shown here.



  12. sud6

  13. Solve the 9's. So far we have just used the "elimination" strategy. Another strategy that I use is: If a column, row, or block has 3 or less empty cells then try to solve each of those empty cells. At this point in the puzzle column 3 has only 3 empty cells so try to see if 1, 4, or 9 can go into one. For this puzzle it doesn't yield any results but for many puzzles it does.



  14. sud7

  15. Solve the 1's, 7's, and 4's.



  16. sud8

  17. Now we're done with the first pass. Next quickly go through all numbers looking for any more cells or pairs of possibilities.



  18. sud8

  19. Ok, now comes a not so easy step. We're going to look for blocked columns or rows. Start with column 1 of blocks (a block is a group of 9 cells) and check for the existence of a particular number (I'm cheating on my rule of only writting down pair possibilities to show you what's happening by putting the little 1's in the top block). If the number exists anywhere in the column, go to the next number.

    The number 1 does not exist anywhere in column 1 of blocks. Notice that in the top block, 1 can only occur in column 1 or 2 of cells and also that in the bottom block 1 can only occur in column 1 or 2 of cells. This means that in the middle block a 1 can't occur in (2,5) as shown in the X'd out 1. This means (3,6) has to be a 1.



  20. sud10

  21. After we put the 1 in, lots of things happen. Here is the order: 1 in (3,6), 1 in (6,5), 2 in (6,4), 2 in (8,5), 5 in (7,6), 2 in (9,8), 6 in (7,9), 5 in (8,9), 5 in (4,5), 4 in (2,5),



  22. sud12

  23. Let's do some more. Here is the order: 1 in (5,1), 5 in (6,1), 6 in (3,1), 5 in (3,2), 6 in (8,2), 1 in (8,3), 7 in (4,2),



  24. sud15

  25. Now we're at another impasse. So we look for blocked columns or rows. Notice that there are no 4's in the bottom row of blocks. 4's are in the top two rows only of cells of the left and right blocks, so (4,7) can't be a 4 so has to be a 9.



  26. sud16

  27. Let's finish up. Here is the order: 4 in (4,1), 4 in (7,2), 4 in (9,6), 7 in (9,7), 4 in (8,8), 4 in (3,7), 8 in (9,1), 7 in (8,1), 2 in (7,1), 8 in (7,4), 7 in (3,8), 9 in (2,1), 9 in (6,3), 4 in (1,3). 7 in (6,6), 8 in (5,6), 4 in (6,9), 4 in (5,4), 7 in (5,9), 7 in (1,4), 9 in (3,4), 2 in (2,2), 1 in (1,2), 1 in (2,9), 9 in (1,9).



  28. sud18

    Here is a really strange Sudoku, it looks so easy but try to solve it without a guess!

    sud20

    Go here and keep pressing "Take Step", it will show you how it's solved.


© Rick Bronson