C++ Implementation of the A* algorithm.