Skip to main content

dijkstra

Function dijkstra 

Source
pub fn dijkstra(
    n: usize,
    edges_of: &[Vec<(usize, f64)>],
    source: usize,
) -> Vec<f64>
Expand description

Plain Dijkstra (the exact reference). Returns shortest distance from source to every node over the directed weighted graph; unreachable nodes are f64::INFINITY. edges_of[i] lists (neighbour, weight).