Skip to main content

widest_path_widths_with_mode

Function widest_path_widths_with_mode 

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

Widest-path widths with directed-mode selection. Mirrors widest_path_widths but lets you choose OUT/IN/ALL traversal for directed graphs (ignored on undirected).

Counterpart of igraph_widest_path_widths_dijkstra(_, _, vss(source), vss_all(), weights, mode).

ยงExamples

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

let mut g = Graph::with_vertices(3);
g.add_edge(0, 1).unwrap();
g.add_edge(1, 2).unwrap();
let w = widest_path_widths_with_mode(&g, 0, &[3.0, 5.0], DijkstraMode::All).unwrap();
assert_eq!(w[1], Some(3.0));