C++ Link: A-star Shortest Path Algorithm (C++ recipe)

Pathfinding A Star

Image via Wikipedia

Thank you, StumbleUpon! I just so happen to have come across a handy code snippet for the A* pathfinding algorithm.  This is pretty much a staple in any AI programmer’s arsenal.

So here’s the code! Enjoy, peoples!

A-star Shortest Path Algorithm (C++ recipe)

Update! Oct. 13, 2017

Seeing how this is one of the more popular posts on my blog, I wanted to update the link for the algorithm. The above link works, but the creator has moved all his “recipes” to his GitHub. Here’s a link for his C++ A* Algorithm Recipe. Good luck!

Update! Oct. 4, 2018

Seeing how this is one of the more… wait, haven’t I done this before? Well, we’re doing it again, because now I have an A* algorithm of my own! Go check out my newest tutorial, KMStar! It goes pretty deep into explanations, so, hopefully, you’ll get a better understanding of how A* works! Yay!