Using Brute Force

Brute Force is a sudoku solving algorithm.  Basically it resorts to trying a number, if it doesn't work, try another number, and repeating until you solve the puzzle.  It is best suited for computer use.  Performing Brute Force manually would be very tedious.  Its something to resort to when all else fails.  

More practically,
Brute Force is useful for verifying puzzle validity.  If Brute Force can't find a solution, then the puzzle in insolvable.    Brute Force can also be used to prove that a puzzle has only one unique solution.   It does this by running Brute Force twice, once foreward and once backwards and comparing results.

Brute Force looks at one cell at a time.  It starts in the upper leftmost cell, then moves left to right for each row until reaching the last cell on the bottom right of the puzzle.  

Remember that GIVENS are fixed cells present in the puzzle grid.  GIVENS are ignored.   The algorithm is then:
  1. The next available empty cell is located and it is given a value of 1.
  2. If the cell's value conflicts with any related cell (row, column, or box), the cell's value is incremented until a non  conflicting value is found. Then return to step 1 to locate a new cell.
  3. When a dead end is encountered (cell value of 9 has a conflict) that cell is blanked and focus moves to the previous cell (ignoring givens).  The value of the cell is incremented.  Then return to step 2.  If the new cell cannot be incremented, return to step 3 (dead end)  
  4. Repeat until the grid is filled (proving validity) or a dead end is encountered in the first available cell.
Once a valid solution is found, the Brute Force method is run again backwards (from 9 to 1).  The backwards
Brute Force method still starts at the top left and progesses to the bottom right.

The two solutions should be identical.  If  not, then the puzzle has multiple solutions.



(home)