Sudoku Solver

Sudoku Solver

Download...

I wrote this as a personal project to scratch an itch of my own. I know that there are other solutions to this problem, but I wanted to write my own.

I had been thinking of solving Sudoku puzzles using a tree of permutations for a while before I actually wrote any code. I wanted a permutation algorithm that:

  • Could start in any state
  • Kept the minimum amount of data
  • Could be tailored to ignore Sudoku fixed cells

I tried a couple of different permutation algorithms, but they fell short in one way or another.

What I found and used instead was the Johnson Trotter Algorithm. It met all of my criteria, is fast, and has very little overhead.

http://www.cut-the-knot.org/Curriculum/Combinatorics/JohnsonTrotter.shtml http://www.nist.gov/dads/HTML/johnsonTrotter.html

Popular Tags

Archives