views:

388

answers:

1

Hi,

I've been working on a Sudoku Solver, my current solver uses the backtracking algorithm but it still takes too long.

I'm hoping to get it down to less than a second for most cases. As such, I've decided to rewrite it with the dancing links algorithm, understanding it is one of the better bruteforce methods that works well especially with a constraint problem such as the Sudoku Puzzle.

I have tried to read the Wiki and Knuth's paper on it, however both of them are kinda hard to comprehend and extremely verbose.

I also read Sudopedia's version on it, and it seems that once it got to the Sudoku's implementation, it got too abstract.

Can someone try to explain the Dancing Links algorithm not in terms of its derivation but its implementation? (would be great to use the Sudoku as an example)

Thanks!

+4  A: 

Well then I will guess that this should help you:

A Sudoku Solver in Java implementing Knuth's Dancing Links Algorithm

Kyle Rozendo
And that URL has a link to Knuth's paper, which the question could usefully have included.
Jonathan Leffler
I added the link to Knuth's paper in the original question.
mizipzor