GithubHelp home page GithubHelp logo

cube_solver's Introduction

Paige Gulley | March 2015 | Cube Solver

Tools for solving a puzzle which has been on my desk for ages

We have a sequence of 64 wooden cubes strung together. There are 44 right-angle bends at irregular positions along this string. We want to bend the string such that it forms one 4x4 cube.

The puzzle

Setting this up as a search problem, going depth first.

###The constraints

Accounting for symmetry, There are 4 starting positions. We can start off in any of 6 directions, and each of the 44 bends offers 4 new possible directions. The space contains around 4^45 possibilities, or 300 quadrillion states

Its too chaotic for many optimizations, but we have a few things on our side:

  • Symmetry allows for some starting positions to be ignored.
  • We don't check past failure, so we can throw out whole branches as we go.
  • If we need to, we can start checking for cube segmentation, which would let us throw out more dead ends (not implemented yet, though)

On my machine it runs at 1 million loops every 15 seconds, or 5.7 billion loops per day.

For some reason, the script halts after about 830 million steps, around 4 hours in. Fails to find solution. Further investigation to follow

cube_solver's People

Contributors

pgulley avatar

Stargazers

Tim Smith avatar

Watchers

James Cloos avatar  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.