Solving Soduku

Posted on

Someone asked for my method, so here it is:

1) Get used to this idea: you first have to fill in every cell with information. After you’ve filled in every cell, you can start solving. Some of the time you can start solving with some cells left empty, but most of the time not. A game or game app is highly recommended, versus paper and pencil where you will have to erase alot.

2) The information in each cell is this: what are the possible numbers for that cell. What I do is go though each number 1-9 in order for each cell. If the number can go in the cell, I write it there. If not, I leave it out. (I play on the Sudoku 2 iPhone app. Every app has a way to do this). It might go like this:

Pick a cell with lots of numbers already in its 3×3 block (start easy). Start counting. 1 — can I put a 1 in the cell? No if that number is in the 3×3 block, or if its found along the row and column containing the number. Yes otherwise. Move on to number 2, etc.

Do this for every open cell. Some open cells will have 2 or a few possible numbers in them, up to nine (worst case).

3) Once every cell is filled out with all its possible numbers, it’s time to start solving. Here are a few of the key techniques I use. Let’s start with the block oriented ones:

• One number is alone in a 3×3 block. That cell is that number.
• Two pairs of the same numbers in a 3×3 block. Suppose a block has one cell with 1-8 as possible numbers, and another cell with 1-8 as possible numbers in the same 3×3 block. You can then remove all 1’s and 8’s from the remaining cells in that block, if any.
• You can also do the pairs thing for triplets. For example, three cells share the same three numbers, e.g. 4-7-9. You can remove 4,7,9 from all cells in that block that contain other numbers also.
• You will rarely need to go to quadrulets, but that would work also.

At this point, you might have some numbers solved. For example, if in a block you have the cells filled out this way: 1-8, 1-8-3, 1-8, 1-8,9-6-3 etc., then you know which cell is a 3. The other cell will be 9-6, etc.

4) Let’s move on to row oriented procedure. There are several possibilities:

• One number is alone along an entire row. That cell is that number.
• Similarly for the pairs strategy above, triplets also, etc. Look for two pairs of the same number along a row. Remove those numbers from all other cells that contain them, etc.

5) Do the same for columns.

6) Trickier stuff along columns and rows:

• Look along a row. A number can be in up to 3 blocks along the row. If a number exists only in one block along that row, then you can remove that number from all other positions in that block. The key thing is that the number is only in one block along that entire row.
• Applies to columns also.

7) Trickier block-oriented stuff.

• Focus on a particular number in a block. The number might be in one cell, a few cells, etc. The key thing to look for is if a number in a block lies along either a single row or column, and not elsewhere. If it does, it “clears out” that number from the other blocks along that row or column.
• For example, in one block there are two entries for the number “1”, but both entries lies along a single column. Then “1” can be removed from the other 3×3 blocks that have “1” in the same column. You cannot remove the number from other blocks if the number is in another column.
• Similarly for rows.

Keep in mind that the numbers I refer to here are the numbers you have written down as possible numbers in a cell. I am not referring to the solved numbers. Once cells are solved, you then have to clear out all the repeats of that number in a block/column/row. That leaves you with fewer possible numbers in each cell, and marches you towards a solution.

Once you’ve done all this elimination, the solution will present itself. If not, get back to me.

Happy Sodoku Solving!