Giter VIP home page Giter VIP logo

astar-maze-solver's Introduction

A-Star Maze Solver

This program uses the A-star search algorithm in the Boost Graph Library to solve a maze. It is an example of how to apply Boost Graph Library algorithms to implicit graphs.

The solver consists of a single program called astar-maze. This program generates a random maze and tries to find the shortest path from the lower left-hand corner to the upper right-hand corner. Mazes are represented by two-dimensional grids where a cell in the grid may contain a barrier. You may move up, down, right, or left into any adjacent cell that does not contain a barrier.

Once a maze solution has been attempted, the maze is printed. If a solution was found it will be shown in the maze printout and its length will be returned. Note that not all mazes have solutions.

The default maze size is 20x10, though different dimensions may be specified on the command line.

Installation

You must have the Boost Graph Library version 1.44 or higher installed. Set BOOST_PATH in the Makefile to point to the root of your Boost include tree. The astar-maze program builds in the distribution directory and does not install anywhere else on the system.

Implementation

The maze is represented by the maze class. This class has a grid graph member which defines the underlying grid. All edges are assigned a weight of one. Barriers in the maze are removed from the underlying grid using a graph filter. The maze is searched using the A* search algorithm.

History

  • Version 1.0.0: Initial release

Copyright

Copyright W.P. McNeill 2010.

Distributed under the Boost Software License, Version 1.0.

See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt.

astar-maze-solver's People

Contributors

wpm avatar

Watchers

 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.