Implement pathfinding algorithm.