shortest path and egde number