An implementation of the A* pathfinding algorithm.