by periodontal · 9y ago · 0 comments
If you haven't seen Knuth's Dancing Links implementation of Algorithm X, I highly recommend it. It's based on the observation that updating a doubly-linked list in-place preserves enough information to make backtracking easy.
It includes a sudoku (also exact cover) and pentonimo solver.
http://www.cs.mcgill.ca/~aassaf9/python/algorithm_x.html
> One day I decided to write Algorithm X in Python, and I came up with a very interesting variation on Dancing Links.
UPDATE: think I may see it, sounds like in terms of partitions an exact cover is a subset of a set's partition.