Skip to main content

bellman_ford

Function bellman_ford 

Source
pub fn bellman_ford<G, F>(
    graph: &G,
    source: G::Node,
    edge_cost: F,
) -> Result<Option<BellmanFord<G::Node>>>
where G: IndexGraphView, F: Fn(G::Edge) -> i64,
Expand description

Computes signed shortest paths from source.

ยงErrors

Returns an error for arithmetic overflow or a reachable negative cycle.