Implementation of the A* algorithm in C++