Sudoku solver using recursive backtracking

Inspired by a video lecture from Stanford University about recursive backtracking and how it can be useful, I sat up all night to write my own recursive backtracker to solve Sudoku’s. You can see it here. The video lecture presents a pseudocode in C++, and there is little to no emphasis on the code itself. While writing the code in Java, I ended up having to make a lot of design decisions, and when it eventually ‘clicked’, I had an ‘aha’ moment. So you can try to download the code, follow the instructions, make it solve a Sudoku of any level of difficulty, and try to break it. Just a little caveat – if you give it an evil or diabolical Sudoku, you will have to increase the stack size of your JVM [up to 50m].

Have fun!


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s