pub fn dijkstra_distances_multi(
graph: &Graph,
sources: &[VertexId],
weights: &[f64],
cutoff: Option<f64>,
) -> IgraphResult<Vec<Vec<Option<f64>>>>Expand description
Multi-source Dijkstra distances. result[i][v] is the shortest
distance from sources[i] to v (or None if unreachable / past
the cutoff).
Counterpart of igraph_distances_dijkstra_cutoff(..., from=sources, to=igraph_vss_all(), weights, IGRAPH_OUT, cutoff). Each source is
run independently — upstream loops over fromvit doing exactly
the same.
§Examples
use rust_igraph::{Graph, dijkstra_distances_multi};
let mut g = Graph::with_vertices(3);
g.add_edge(0, 1).unwrap();
g.add_edge(1, 2).unwrap();
let d = dijkstra_distances_multi(&g, &[0, 2], &[1.0, 3.0], None).unwrap();
assert_eq!(d[0], vec![Some(0.0), Some(1.0), Some(4.0)]);
assert_eq!(d[1], vec![Some(4.0), Some(3.0), Some(0.0)]);