pub fn avg_neighbor_degree_ratio(graph: &Graph) -> IgraphResult<f64>Expand description
Compute the average neighbor degree ratio.
For each vertex with degree >= 1, compute the ratio of the average degree of its neighbors to its own degree. Return the mean of these ratios. Returns 0.0 for graphs where no vertex has degree >= 1.
§Examples
use rust_igraph::{Graph, avg_neighbor_degree_ratio};
// K_3: each v has d=2, neighbors avg d=2, ratio=1.0 → avg=1.0
let g = Graph::from_edges(&[(0,1),(1,2),(0,2)], false, Some(3)).unwrap();
assert!((avg_neighbor_degree_ratio(&g).unwrap() - 1.0).abs() < 1e-10);