Skip to main content

radius_weighted_with_mode

Function radius_weighted_with_mode 

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

Mode-aware weighted radius. None for vcount == 0.

Counterpart of igraph_radius(_, weights, _, mode).

ยงExamples

use rust_igraph::{Graph, radius_weighted_with_mode, EccMode};

let mut g = Graph::with_vertices(3);
g.add_edge(0, 1).unwrap();
g.add_edge(1, 2).unwrap();
let r = radius_weighted_with_mode(&g, &[1.0, 2.0], EccMode::All).unwrap();
assert!((r.unwrap() - 2.0).abs() < 1e-9);