Skip to content

wbyoung/dance

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Dancing Links Implementation

NPM version Build status Code Climate Coverage Status Dependencies devDependencies

An implementation of Donald Knuth's Dancing Links Algorithm to solve exact cover problems.

var dlx = require('dancing');
var matrix = [
  [1, 0, 0, 1, 0, 0, 1],
  [1, 0, 0, 1, 0, 0, 0],
  [0, 0, 0, 1, 1, 0, 1],
  [0, 0, 1, 0, 1, 1, 0],
  [0, 1, 1, 0, 0, 1, 1],
  [0, 1, 0, 0, 0, 0, 1]
];
dlx.solve(matrix); //=> [[1, 3, 5]]

License

This project is distributed under the MIT license.