The All-Pairs Shortest Paths problem [00RQ]

Input: a directed, weighted graph G = (V,E) with vertices numbered 1 \dots n. Output: an n \times n matrix s where s[u,v] records the length of the shortest path from u to v, or an indication that the graph has negative cycles.

Ideally we also want to be able to recover the actual shortest path between any two vertices u and v.