Solution to shortest shortest path (shortest path from all-pairs
shortest paths - PA#4)