All-pair shortest path
Input direct G=(V,E)
Output: (u,v) for each u,v
Flyod-Warshall Algorithm

D[u,v,k]
Case 1: vk is not in the path for D[u,v,k]
{u⋯,S,⋯,v},vk∉S
then,
D[u,v,k]=D[u,v,k−1]
Case 2: vk is on the path
{u⋯,vk,⋯,k}
D[u,v,k]=D[u,vk,k−1]+D[vk,v,k−1]
$$