A* (A Star) search algorithm for PHP