Skip to main content

dijkstra_distances_cutoff_with_mode

Function dijkstra_distances_cutoff_with_mode 

Source
pub fn dijkstra_distances_cutoff_with_mode(
    graph: &Graph,
    source: VertexId,
    weights: &[f64],
    cutoff: Option<f64>,
    mode: DijkstraMode,
) -> IgraphResult<Vec<Option<f64>>>
Expand description

Mode-aware dijkstra_distances_cutoff. Counterpart of igraph_distances_dijkstra_cutoff(_, _, source, vss_all(), weights, mode, cutoff).

ยงExamples

use rust_igraph::{Graph, dijkstra_distances_cutoff_with_mode, DijkstraMode};

let mut g = Graph::new(3, true).unwrap();
g.add_edge(0, 1).unwrap();
g.add_edge(1, 2).unwrap();
let d = dijkstra_distances_cutoff_with_mode(
    &g, 0, &[1.0, 2.0], Some(1.5), DijkstraMode::Out
).unwrap();
assert_eq!(d, vec![Some(0.0), Some(1.0), None]);