pub fn transitivity_avglocal_undirected(
graph: &Graph,
mode: TransitivityMode,
) -> IgraphResult<f64>Expand description
Average local transitivity (clustering coefficient).
Computes the local transitivity for each vertex and returns the mean.
mode: how to handle vertices with degree < 2.TransitivityMode::Nan: exclude them (result is NaN if no vertex qualifies).TransitivityMode::Zero: include them with transitivity 0.
ยงExamples
use rust_igraph::{Graph, transitivity_avglocal_undirected, TransitivityMode};
// Triangle: all vertices have local transitivity 1.0
let mut g = Graph::with_vertices(3);
g.add_edge(0, 1).unwrap();
g.add_edge(1, 2).unwrap();
g.add_edge(0, 2).unwrap();
let avg = transitivity_avglocal_undirected(&g, TransitivityMode::Nan).unwrap();
assert!((avg - 1.0).abs() < 1e-10);