A* Demonstration

Applet by James Macgill

Instructions

This is a simple interactive implementation of the A* path finding algorithm.

To test:

To load predefined maps:

To test with your own map:

To set up obstacles/paths:

To try different methods

To install on your own system

astar.zip Is basically a zip of my development directory. It contains all the class and Java files you need as well as some example maps (And some other files you don't need!).
You can run AStarApplet.class both as an applet and as an application.
As an application you can save new maps.
(right click on the above link and choose 'save link as' if Netscape gets confused)

To make me happy (or sad)

Send me some feedback.

About the A* algorithm

(A quick overview for now, I'll go into more depth later)

The algorithm searches outwards from the start point adding up the cost of traversing each cell.
It stores the distance each cell is from the start point and moves on.
When it reaches the end point it searches back, looking for the cell with the shortest distance from the start each step.

For a more detailed introduction to A* take a look at this excellent online tutorial.

Notes:

The applet has been deliberately slowed down so that you can see what is going on.
There are now three methods available: Classic A* which works properly and Old (my fist attempt) which doesn't.
Fudge is a recent addition that adds a tweak to the heuristic to find more direct routes in less time.(especially with diagonal cases)
Old may appear to operate faster than Classic but this is an artifact of the animation and not a result of the methods efficiency.

Improvements

Add additional path finder methods.
Add more predefined patterns.

Take a look at the Influence Mapping applet.



Last Updated January 18 1999.
James Macgill - Center for Computational Geography.
Home Page