Knuth's Dancing Links algorithm for the exact cover problem
npm install dlxdlx
===
An implementation of Knuth's Dancing Links algorithm for the exact cover
problem.
Usage:
``
var dlx = require("dlx");
var matrix = [
[0, 0, 1, 0, 1, 1, 0],
[1, 0, 0, 1, 0, 0, 1],
[0, 1, 1, 0, 0, 1, 0],
[1, 0, 0, 1, 0, 0, 0],
[0, 1, 0, 0, 0, 0, 1],
[0, 0, 0, 1, 1, 0, 1],
];
var solutions = dlx.solve(matrix);
// solutions == [[0, 3, 4]];
`
Install dependencies: npm install
Run tests: npm test`