Comment Comment by periodontal This is a specific example of an Exact cover problem: https://en.wikipedia.org/wiki/Exact_coverIf 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. parent periodontal 9 years ago
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.