Code covered by the BSD License  

Highlights from
Demonstration of Astar (A*)

4.6

4.6 | 5 ratings Rate this file 100 Downloads (last 30 days) File Size: 14.89 KB File ID: #26723
image thumbnail

Demonstration of Astar (A*)

by Bob Sturm

 

18 Feb 2010 (Updated 21 Feb 2011)

Pathfinding algorithm Astar (A*)

| Watch this File

File Information
Description

How do you find the shortest path from one point to another in a computationally efficient way? The A* algorithm provides one implementation where the distance to the goal is considered as a heuristic in addition to local weightings, and the best path is recovered without combinatorial complexity.

MATLAB release MATLAB 7.7 (R2008b)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (5)
18 Feb 2010 Mike Russell

Love this, presentation is beautiful and code is quite readable.

Thanks for this tool!

29 Jul 2010 TheCount Graven

I was playing with the code and I think that the g part of the Astar equation (f=g+h) is missing. I inputted my own state space for the algorithm to traverse and it went 7 spaces more than it needed to to reach its goal. I added a crude form of g and it found the optimal path I was looking for in my example. Other than that I like this GUI it looks really nice.

07 May 2011 David Buckingham

this is great. code is readable and the animation looks pretty. i wish there was a gui control to slow down the animation.

01 May 2012 Carl Fischer

Nice demo. Thanks. However, I'm struggling to make the algorithm work with a rectangular map due to the fact that the order of the x and y axes depends on whether we're talking about image coordinates or matrix indexes. Terribly confusing.

27 May 2012 Cristian munoz  
Please login to add a comment or rating.
Updates
21 Feb 2011

I have corrected the entire algorithm such that the total path cost is correct, and the heuristic is properly used.

Tag Activity for this File
Tag Applied By Date/Time
path finding Bob Sturm 18 Feb 2010 10:58:07
demo Bob Sturm 18 Feb 2010 10:58:07
optimization Bob Sturm 18 Feb 2010 10:58:07
data exploration Bob Sturm 18 Feb 2010 10:58:07
game Bob Sturm 18 Feb 2010 10:58:07

Contact us at files@mathworks.com