Skip to main content

widest_path_widths_floyd_warshall_with_mode

Function widest_path_widths_floyd_warshall_with_mode 

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

Mode-aware variant of widest_path_widths_floyd_warshall. Mode selects how directed edges contribute to the adjacency matrix:

On undirected graphs every mode collapses to All (matches upstream).

Counterpart of igraph_widest_path_widths_floyd_warshall(_, _, vss_all(), vss_all(), weights, mode).

§Examples

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

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