Code Monkey home page Code Monkey logo

simplicity-solver's Introduction

"Simplicity" Solver

Copyright © 2012 Bart Massey and the Fall 2012 Portland State University CS 441/541 class

This program is licensed under the "MIT License". Please see the file COPYING in the source distribution of this software for license terms.

"Simplicity" is a sliding-blocks puzzle by James W. Stephens.

This solver is written in Java using Pathfinding Search.

This is the starting state of Simplicity.

..Y.
BBYY
.GR.
.GRR

The goal is to get the R block to the upper-left corner in as few moves as possible. One move is a sequence of horizontal and vertical steps by a single piece such that it does not intersect any other pieces at any point.

R???
RR??
????
????

The solution is displayed as a sequence of puzzle states leading from the starting state to a goal state.

The solver uses A* search, with an admissible heuristic of the number of pieces that provably have to move from their current position. A back-of-the-envelope calculation gives a strict upper bound of 64K for the number of possible states of this problem, so almost anything works quickly. The first working version of this search examines 272 states before finding a solution. By comparison, Dijkstra's Algorithm (achieved here by using a constant heuristic value of 0) examines 324 states.

simplicity-solver's People

Contributors

bartmassey avatar

Watchers

 avatar  avatar  avatar

Forkers

ankel

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.