3 ms·
Solving sudoku by brute force isn't much of a trick. Solving it using non-guessing techniques is the tricky bit.
by wccrawford 16y ago
Solving sudoku by brute force isn't much of a trick. Solving it using non-guessing techniques is the tricky bit.
- StrawberryFrog 16y agoWhen the brute-force method is a simple algorithm and executes very quickly, why bother using other methods?
- alienDeveloper 16y agobecause brute-force executes very quickly for easy sudoku's but as it gets harder and lesser values are provided it takes too much time.
- StrawberryFrog 16y agoI have a suduko solver. It is what I consider "brute force", though it does not look any further down boards that do not satisfy the constraints of the game (i.e. values unique in rows, columns, 9-cells). Typically it executes in < 0.5 seconds. Can you supply a "hard" puzzle that will take too much time? A legal puzzle must have only one valid solution. Update: I googled for a hard sudoku board, got http://www.forbeginners.info/sudoku-puzzles/hard-1.htm http://www.forbeginners.info/sudoku-puzzles/hard-1.htm It was brute-forced in 0.038 seconds on my laptop. Code is here: http://github.com/AnthonySteele/SudokuSolver/commit/b953ef9767e598d8c24940402b4276be837972e4 http://github.com/AnthonySteele/SudokuSolver/commit/b953ef97...
- alienDeveloper 16y agothis is not a brute force trick.. it calculate all possibilities and eliminate others using constraint theories.