Skip to main content

dijkstra

Function dijkstra 

Source
pub fn dijkstra(g: &WGraph, start: usize) -> Vec<Option<i64>>
Expand description

Dijkstra’s algorithm for single-source shortest paths (non-negative weights).

Returns dist\[v\] = Some(d) if reachable, None otherwise. Panics (via bounds check) if start >= g.n.