Do not revisit nodes in shortest path finding