pub fn diameter_with_mode(
graph: &Graph,
mode: EccMode,
) -> IgraphResult<Option<u32>>Expand description
Diameter of graph under the given mode. None for vcount == 0.
Counterpart of igraph_diameter(_, NULL_weights, _, NULL, NULL, NULL, NULL, mode == directed ? IGRAPH_OUT : IGRAPH_ALL, /*unconn=*/true).
ยงExamples
use rust_igraph::{Graph, diameter_with_mode, EccMode};
let mut g = Graph::with_vertices(3);
g.add_edge(0, 1).unwrap();
g.add_edge(1, 2).unwrap();
assert_eq!(diameter_with_mode(&g, EccMode::All).unwrap(), Some(2));