[][src]Function rs_graph::shortestpath::moorebellmanford::undirected

pub fn undirected<'a, G, W, F>(
    g: &'a G,
    weights: F,
    src: G::Node
) -> (NodeVec<&'a G, Option<G::Edge>>, Option<G::Node>) where
    G: 'a + IndexGraph<'a> + Graph<'a>,
    W: NumAssign + Ord + Copy,
    F: Fn(G::Edge) -> W, 

The shortest-path algorithm by Moore-Bellman-Ford on an undirected graph.

The function returns pair. The first element is the vector of the incoming edge for each (reachable) node. The second element a node on a negative cylce if it exists, otherwise it is None.