

This means we can eliminate the candidates 1 and 9 from cells 7 and 8. The two possible solutions are:įrom this we can deduce that the digits 1 and 9 can never appear in any other cell in this row. The other cells contain remaining candidates as smaller digits.Ĭells 1 and 3 of the row can only contain the digits 1 and 9. The tuple techniqueĬonsider the following row of a Sudoku. In this post we'll discuss one technique that can be implemented using a fairly elegant graph algorithm. The more interesting task is to write a human-like Sudoku solver that uses human-possible techniques to identify the next move. Even though Sudokus are known to be NP-complete, because the n in a 9x9 Sudoku is fairly small, brute forcing a solution can be done in a few seconds. Programming a Sudoku solver is not very difficult.

However, harder variants require using more complicated techniques where you eliminate candidates from cells in multiple steps. all but one candidate are eliminated from a cell because the column, row or box already contains it. A game starts with a number of given digits in the grid, and the player can use multiple techniques to deduct the missing digits.Įasy variants can usually be completed by using simple eliminations, i.e. Each row, column and box must contain each digit exactly once. In a game of Sudoku you have to fill the numbers 1 to 9 in a 9x9 grid that is also divided into 3x3 boxes.
