Please enable JavaScript.
Coggle requires JavaScript to display documents.
Floyd’s Algorithm, for( int i = 0; i< G->n(); i++), for( int j=0;…
Floyd’s Algorithm
-
It is convenient to record the lengths of shortest paths in an n × n matrix D called the distance matrix
Floyd’s algorithm computes the distance matrix of a weighted graph with n
vertices through a series of n × n matrices:
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
D[i, j ] ← min{D[i, j ], D[i, k] + D[k, j ]}
-