Coder Social home page Coder Social logo

wpande / dancing-links Goto Github PK

View Code? Open in Web Editor NEW

This project forked from benfowler/dancing-links

0.0 2.0 0.0 224 KB

Java implementation of Knuth's Dancing Links algorithm. With examples, including ultra-fast Sudoku solver.

License: GNU General Public License v3.0

Java 100.00%

dancing-links's Introduction

Overview

dancing-links is a Java implementation of Donald Knuth's Dancing Links algorithm, which is a fast implementation of his Algorithm X algorithm, to solve the exact matrix cover problem.

See Knuth's very approachable paper describing the algorithm and some interesting applications.

Support

dancing-links is supplied as-is. If it breaks, you get to keep both pieces.

Example Usage

A few examples are included as subprojects to the main 'dlx' modules. Unit tests are also included. The example applications are most useful for understanding how to set up constraints and feed them into the solver, how to run the solver, and decode results.

Here's some of the examples included:

Sudoku solver

A classic application of the exact matrix cover problem is the efficient solution of Sudoku; on a very old machine, this solver can brute-force the solution to the hardest solver in less than a millisecond. A large battery of very hard Sudoku are included in the test suite.

n-Queens

Like it says.

3D Tetramino

This example was written to crack a 3D tetramino-style block puzzle given to my parents. This is a straightforward extrapolation of the tetramino solver that Knuth describes in his paper.

Dr Wood's Kaleidoscope Puzzle

I was given this cheesy, but surprisingly versatile little puzzle one Christmas, and instead of cranking through his puzzles manually, decided to smash them with this Kaleidoscope solver instead.

An interesting extension of this example, would be to write a graphical editor to help write new (valid) puzzles and grade their difficulty.

dancing-links's People

Contributors

benfowler avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.