A* path-finding algorithm.