


I enjoy trying to discover patterns like these in really tricky sudoku problems. Sudoku techniques that I would consider elegant are things like sashimi x-wings, XYZ-wings, the various type of unique rectangles, and such. Nishio, tables, all of those just make sudoko boring and feel like you're executing a computer program in your limited-RAM brain.īut those aren't the "clever" or "elegant" methods. Those are, by their very nature, annoying for people to do and thus attractive for computer solutions. They are often techniques that dive into deep "consequence" trees to find contradictions. There is only one method for solving sudoku puzzles, and it strongly resembles a computer doing brute force. Sudoku doesn't have clever logic and elegant methods. They look at a random cell, and ask if the value can be implied, and fill it in Most people do this, except out of order. Continue throughout all squares, and then start over.

If no, go onto the next square and ask the same question. You look at the first cell and say, "Can the value of this cell be implied by the values of the cells in the same row, column, and square?" If the answer is yes, then you write the value. But then again, many of those optimizations are similar to the "clever logic and elegant methods," especially those that perform propagation and follow implications.Īctually, that is exactly the method I was referring to.

However, I do not believe that the grandparent is correct in stating that these methods solve sudokus in a fraction of the time of the brute force method if you allow for standard optimizations of the brute force method as developed for constraint processing (CP) or Boolean satisfiability (SAT) solvers. This is essentially how people solve the puzzles, and I believe it is what the grandparent was describing. This is a basic example, but clearly more complex ones exist. The value of that unfilled cell is implied and can be filled in without having to try any other values. As a very simple example, consider a row that has all cells filled but one. Certain configurations of values in some cells can imply values in other cells. Most sudoku puzzles can be solved via implication, however. Continue using logic and deduction until you have filled in all of the empty squares.Sudoku can be solved by trying values in cells until a conflict is reached and backtracking to try other assignments. Every Sudoku has one solution, so double check by making sure each column, row and square contains the numbers 1-9 with no duplicates or omissions. Next, you can start scanning each row for a certain number, like 1, to see where it should go. Then look for single empty squares in each row and column that you can fill in. If you see a single empty space in a larger square, fill that in first. For example, if a square already has 7 out of the 9 spaces filled in, you can figure out which 2 numbers are missing and use the numbers in the correlating rows and columns to determine which of the two missing numbers belongs in each space. Some squares already have numbers filled in, so begin by look for missing numbers in a row, column or square. To complete the grid, every column, row and square (each containing 9 spaces) needs to be filled in with the numbers 1-9 without repeating any numbers within the row, column or square. The grid is divided into 9 separate 3 x 3 squares. Sudoku is a game played on a 9 x 9 grid where the object of the game is to fill every space with the correct number.
