Skip to main content

bellman_ford

Function bellman_ford 

Source
pub fn bellman_ford(graph: &Graph, start: usize) -> Option<Vec<f64>>
Expand description

Bellman-Ford shortest-path algorithm from start.

Returns None if a negative-weight cycle is reachable from start. Otherwise returns the distance vector (same format as dijkstra).