Fixed path extraction in A* algorithm