Skip to main content

dijkstra

Function dijkstra 

Source
pub fn dijkstra(g: &CsrGraph, src: u32) -> Vec<(u32, f64)>
Expand description

Dijkstra from src, returning (node_index, distance) for every reachable node, sorted by distance ascending. src itself appears with distance 0.0.

Distance is the sum of -ln(weight) along the cheapest path. Unreachable nodes (and an out-of-range src) are omitted.