DLX-Sudoku-Solver icon indicating copy to clipboard operation
DLX-Sudoku-Solver copied to clipboard

C++ and JavaScript implementation of Donald Knuth's Algorithm X using the Dancing Links technique or Algorithm DLX.

DLX Sudoku Solver

This is a C++ implementation of Donald Knuth's Algorithm DLX which enumerates all solutions to an exact cover problem. It is used to solve Sudoku puzzles.

I also implemented it in JavaScript to create a simple Sudoku Solver web application.

See it in action at: https://karlhajal.github.io/DLX-Sudoku-Solver

Acknowledgements

  • Dr Knuth's Dancing Links Paper: http://www.ocf.berkeley.edu/~jchu/publicportal/sudoku/0011047.pdf
  • Jonathan Chu's detailed explanation on turning a Sudoku grid into an exact cover problem: https://www.ocf.berkeley.edu/~jchu/publicportal/sudoku/sudoku.paper.html