1. Introduction
  2. Sudoku Explained
  3. How to Think About It
  4. Getting Started
  5. A First Approach-
    Brute Force

  6. Brute Force in Action
  7. Improving on Brute Force
  8. Better Brute Force
  9. Backtracking Search
  10. Backtracking with MRV
  11. Attack of the Samurai
  12. Strategize
  13. Backtracking MRV with
    Unique Constraint

  14. Backtracking MRV with
    Unique Constraint part 2

  15. Conclusion
Previous Page A First Approach- Brute Force Next Page

The most basic way that I can think of is this: let's start with a Sudoku board, and the first blank cell we come across we assign the number 1. We do the same for the next cell, and so on, until we get to the last cell. We then check if the constraints are satisfied, and if so we are happy, and if not we go back and change the last number we assigned to the next value. If we run out of values we obviously made a mistake a bit earlier; we unassign that cells value and move to the cell before it. Going back and changing a value assigned is called Backtracking. This method can be called Brute Force.

(This is also called Depth First Search; but, then again, everything is search)(Inside joke, don't worry about it)

In case that wasn't clear, let's see this in action!

Previous Page A First Approach- Brute Force Next Page