Function floyd_warshall::floyd_warshall
[−]
[src]
pub fn floyd_warshall<G>(g: G) -> PathMatrix<G::NodeWeight> where
G: Data + GraphBase<NodeId = NodeIndex> + NodeCount + IntoNodeIdentifiers<NodeId = NodeIndex> + IntoNodeReferences + IntoEdgeReferences + GraphProp,
G::NodeWeight: Clone,
G::EdgeWeight: Clone + Into<usize>,
This function computes a distance matrix containing the shortest paths between every two nodes in the graph. By using the Floyd-Warshall algorithm, this is computed in O(V3) runtime.