8000 GitHub - nelsyeung/dlx: Knuth's Algorithm X using Dancing Links written with ES6
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
/ dlx Public

Knuth's Algorithm X using Dancing Links written with ES6

License

Notifications You must be signed in to change notification settings

nelsyeung/dlx

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DLX

Knuth's Algorithm X using Dancing Links written with ES6. The solver code are commented to match the original paper to make it easier to learn and understand.

Getting started

npm install @nelsyeung/dlx

Usage

import dlx from 'dlx';

const 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],
];

const solution = dlx(matrix); // [4, 1, 5]

License

MIT license

About

Knuth's Algorithm X using Dancing Links written with ES6

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published
0