The number of boards that would be presented as possible solutions will almost definitely exceed the memory delegated to your solver program. While this approach is a mathematical possibility, it is not a viable solution. The answer to this is-perhaps using a brute force algorithm, try every possible combination of number substitution in the board? Then, using a checking algorithm, check which of the combinations follow the rules of the puzzle, select that puzzle, and return it. Now the question is: How would a computer solve this puzzle? Considering programmers who solve sudoku puzzles regularly themselves, they would probably add in extra functions and subprocesses which streamline which numbers are chosen to fill in a particular grid box, but what if you know absolutely nothing about solving a sudoku puzzle, what if you've never solved a puzzle in your whole life? You're simply given the rules for filling a number into a particular grid box, How would the computer decide which number is correct? The puzzle provides a partially completed grid, which for most puzzles has a single solution. Up the grid contain all of the digits from 1 to 9. The objective is to fill the 9×9 grid with digits so that each column, each row, and each of the nine 3×3 subgrids that make Let's talk about the way a brute force algorithm would solve a sudoku puzzle.īrute Force Algorithm for Solving a Sudoku puzzle:įor those readers unfamiliar with the working principle of a sudoku puzzle, here's a well-paced explanation of the Board:Ī Sudoku Board consists of a 9 9 grid, divided into 33 regions or blocks.
0 Comments
Leave a Reply. |