26-04-2017, 03:21 PM
The Floyd-Warshall algorithm calculates the shortest path matrix of all pairs for a given adjacency matrix. The algorithm is O (n ^ 3), and in most implementations you will see 3 nested for loops. This is very inefficient in Matlab, so in this version the two internal loops are vectorized (and as a result, it runs much faster).
It can be understood in the following video: