Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there any algorithm that can solve ANY traditional sudoku puzzles, WITHOUT guessing (or similar techniques)?

Tags:

sudoku

Is there any algorithm that solves ANY traditional sudoku puzzle, WITHOUT guessing?

Here Guessing means trying an candidate and see how far it goes, if a contradiction is found with the guess, backtracking to the guessing step and try another candidate; when all candidates are exhausted without success, backtracking to the previous guessing step (if there is one; otherwise the puzzle proofs invalid.), etc.

EDIT1: Thank you for your replies.

traditional sudoku means 81-box sudoku, without any other constraints. Let us say the we know the solution is unique, is there any algorithm that can GUARANTEE to solve it without backtracking? Backtracking is a universal tool, I have nothing wrong with it but, using a universal tool to solve sudoku decreases the value and fun in deciphering (manually, or by computer) sudoku puzzles.

How can a human being solve the so called "the hardest sudoku in the world", does he need to guess?

I heard some researcher accidentally found that their algorithm for some data analysis can solve all sudoku. Is that true, do they have to guess too?

like image 225
justin Avatar asked Aug 20 '11 23:08

justin


1 Answers

You can use the techniques that humans use to solve sudokus. Just keep track of every possible number in every square and place a number if there is only one possibility. Keep updating the possibilies until the sudoku is solved. You can exclude possibilities by using the rules or use some more complex reasoning. For example, if in one row two squares have the possibility 1 and 2, all other squares in that row can't be 1 or 2.

However, keep in mind that not every sudoku has a unique solution, and not every sudoku can be solved with this method.

Edit: More complicated human techniques can be found here:

http://www.sudokudragon.com/sudokustrategy.htm

like image 70
Patrik Avatar answered Jan 03 '23 13:01

Patrik