Understanding the shortest path