All-Pairs Shortest Paths
Given a directed graph G = (V,E) with weight function w: E
R mapping edges to real-valued weights, find the shortest path between every pair of vertices u,v
V that minimizes the sum of the weights along the edges of the path.
Run Single-Source Shortest Path on every vertex.
Dijkstra, O(VE lg V) using binary heap and priority queue
Note that E = O(
) in the worst case.
Dynamic Programming approach
Matrix Multiplication Approach with repeated squaring,
Application: Mileage chart for a road atlas.