[Algorithms] update shortest path