Dynamic Programming
If not connected or for self, weight is infinity for matrix building. because the shortest path does not have cycle.
is already calculated
- Floyd-Warshall algorithm simplest and good
- Run bellman ford algorithm once from each vertex is and worst dense graph complexity has edges so