Optimal path based on the current position