Floyd’s algorithm
Floyd’s algorithm is also known as the all pairs shortest path algorithm. It will compute the shortest path between all possible pairs of vertices in a (possibly weighted) graph or digraph simultaneously in time (where is the number of vertices in the graph).
Algorithm Floyd(V)
Input: A weighted graph or digraph with vertices
Output: A matrix of shortest paths and a matrix of predecessors in the shortest path
for do
if then
else
for do
for do
if and then
if or then
Title | Floyd’s algorithm |
---|---|
Canonical name | FloydsAlgorithm |
Date of creation | 2013-03-22 12:16:29 |
Last modified on | 2013-03-22 12:16:29 |
Owner | vampyr (22) |
Last modified by | vampyr (22) |
Numerical id | 6 |
Author | vampyr (22) |
Entry type | Algorithm |
Classification | msc 68R10 |
Classification | msc 05C38 |
Classification | msc 05C85 |
Synonym | all pairs shortest path algorithm |