Just another tech blog.

A blog abt GNU/Linux, programming, hacking, and my life.

Archive for January, 2007

I love sudoku puzzles

Posted by ajay on January 16, 2007

I am writing a post again after a long time. Didn’t write one primarily due to the fact that I was very much busy these days due to Hectic schedule at college and ofcourse some other things ;). Anyway In vecations I wrote a kind of interesting c++ program to solve sudoku puzzles given in daily news papers. The program uses backtracking and thats why It’s complexity is exponential in general. But still on most of the puzzles that I tried; It works very fast ( almost negligable run time). You can download it or have a look at it here. If you find input puzzles where it doesn’t work ( bugs ) or you have better ideas to solve a sudoku puzzle ( in terms of run time ofcourse ), then please post it as a comment.

PS 1: The program is primarily written to solve puzzles of size 9 x 9. but can be easily modified to solve a bigger puzzle.

PS 2: I have been trying to solve this problem. But my idea doesn’t seem to run in time :(. If anybody solves it, please post a comment about the idea used to solve the problem.  ).


Posted in Programming | 14 Comments »