Watch that tango!
March 3, 2008 3 Comments
Wife: Dancing lynx? That would be really cute. Of course, they’d have to get fitted for special little shoes, if they were going to be, like, tap-dancing or anything. Still…
Me: It’s links. With an “i”.
Wife: Yes, I know that, but it would be much cuter if it was a bobcat.
Me: And less useful.
Yesterday I implemented the Dancing Links algorithm. I first heard about it a few years ago after I wrote a simple Sudoku game. I didn’t write a version back then because I had tired of writing Yet Another Sudoku Game, and my game languished and was forgotten. This time, however, my current project could benefit from it.
It is a surprisingly easy algorithm to write. With the way people talk about it — and with some of the implementations I have seen — I was expecting it to be a long, drawn out battle to get it done. Not so! It was the work of maybe a few hours to read about it and get it completed. Now I just need to see if it will work for my purposes. 😛