Man, have y’all seen this sudoku puzzle? It’s no joke, but lucky for me, I know a few tricks to solve it. Check out this image:
Image 1:
Now, let me break down a few algorithms to solve this puzzle like a pro.
Algorithm 1:
The first algorithm is the naked single. This one is simple: you find any square on the grid that only has one possibility left and fill it in. Check out the image below:
As you can see, the fourth square on the top row only had one possibility left: a 5. So we filled it in, and that helped us solve more squares throughout the puzzle.
Algorithm 2:
The next algorithm is hidden singles. This one is tricky, but basically, you look for a group of squares (a row, column, or box) where there’s only one open slot for a number. If there’s only one number that fits that slot, you know it goes there. Take a look:
In this example, we’re looking at the bottom row. The only slot open is the one in the middle of the row. If you look at the possibilities for that slot, you can see that 1, 3, and 9 are already accounted for in that row. So that means the missing number must be a 2. Boom, we’ve filled in another square.
Algorithm 3:
The third algorithm is called naked pairs. This one is similar to the naked single, but instead of looking for squares with only one possibility left, you look for pairs of squares in a group that only have two possibilities left, and those possibilities are the same for both squares. Take a look:
In this image, we’re looking at the middle row. There are two boxes with only two possibilities left: (7, 8) and (8, 9). But in the first box, we already know that the 7 goes in the top slot, so we can eliminate the 7 as a possibility in the other box. That means the 8 and 9 must go in that box, and we can fill them in. Easy peasy.
Algorithm 4:
The fourth algorithm is called hidden pairs. This one is similar to hidden singles, but instead of looking for a group of squares with only one open slot, you look for a group where there are two slots with only two possibilities left, and those possibilities are the same in both slots. Check it out:
In this image, we’re looking at the middle row again. There are two pairs of squares: (1, 8) and (1, 9). We can eliminate the 8 and 9 from the other squares in that group, which means the 1 must go in one of those squares. We don’t know which one, but we know it must be one of them. So we can eliminate the 1 as a possibility in the other squares in that group, and that gives us more information to work with.
Algorithm 5:
The final algorithm is called X-wing. This one is a little more advanced, but it’s really cool. Basically, you look for a pattern in the puzzle where there are two rows that each have two identical possibilities in identical positions, and those positions form the corners of a rectangle. When you find that pattern, you can eliminate those possibilities in any squares that lie on the same columns as the corners of the rectangle. Here’s an example:
In this image, we’re looking at the leftmost two columns. The 3 and 9 in the top row are in the same positions as the 3 and 9 in the second row. That means they form the corners of a rectangle. So we can eliminate the 3 and 9 as possibilities in any other squares in those two columns. That gives us more information to work with, and we can keep solving the puzzle from there.
Whew! That was a lot of information to take in, but I hope it helps you solve that pesky sudoku puzzle. Remember, just take it one algorithm at a time, and you’ll get there eventually.