add the shortest path