An optimized implementation of the 1-cover problem [class under review].
- The implementation is based on the Dancing Links Algorithm paper published by Knuth:
- This class is an implementation of the "1-cover" problem:
- Given a matrix of 1s and 0s, is there a subset of the rows such that there is one and only one 1 in each column?
- It turns out a lot of interesting problems can be encoded in such a way that the 1-cover algorithm can be used to solve them (For example, counting the number of possible solutions to a Sudoku puzzle). Knuth talks in general about exact-cover problems (placing dominoes on a chessboard, the N-queens problem, etc.), and how each of these are specializations of the 1-cover problem, and so can be solved by this algorithm.