dlx
v0.2.1
Published
Knuth's Dancing Links algorithm for the exact cover problem
Downloads
6,528
Readme
dlx
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