Skip navigation.

PHP A*

NOTE

I originally developed this for the Codewalkers "Shortest Path Through a Maze" Contest. I'm in the process of making this page more oriented towards A* and less towards the contest.

Download the source code (.zip) to the newer, object-oriented implementation.

The original page can be found here.

BTW, it appears that my implementation has a bug lurking somewhere. It fails to solve the 'big' and 'crazy' mazes in the fewest steps. I'm guessing the problem is in the PQueue class.

See it in Action

A* Resources

Here are some great resources that I used to develop my implementation of the A* algorithm: