Skip to main content

bellman_ford

Function bellman_ford 

Source
pub fn bellman_ford(
    g: &Graph,
    source: usize,
) -> Result<ShortestPaths, ErrorsJSL>
Expand description

The Bellman-Ford algorithm, O(V E), allowing negative weights. Returns an error if a negative cycle is reachable from the source (shortest paths are then undefined).