raconteuring.com | being a storyteller in the present progressive About the Sudoku Solver About this code

Sudoku Puzzle Solver

Diagnostic: Populate Sample - ToString()

How I did it

I wrote this solver in the hopes that it would purge my sudoku habit.

The solver is not a brute force algorithm. It solves using the rules of sudoku. All squares have an equal probability of containing every number. As the initial puzzle numbers are input, their probability is removed from all other squares in that row, column, and quadrant. Another pass is made to check if there is only one probable number in any given square. If there is, that value is set and the process repeats.

This algorithm was tested against multiple sudoku puzzles. Solution time is calculated at the server (network delay doesn't count). The solver was implemented using C# for the solver classes, asp.net (with VB.net as the code-behind) for the web page, and AJAX.net for communicating with the backend and making that sexy, no-postback interface.

- D