pub fn convergence_degree(graph: &Graph) -> IgraphResult<Vec<f64>>Expand description
Per-edge convergence degree.
Edges that lie on no shortest path between any source/sink pair
produce NaN (matching upstream’s 0/0 semantics).
Time complexity: O(|V|·(|V| + |E|)) — BFS per source vertex.
§Examples
use rust_igraph::{Graph, convergence_degree};
// Directed star with one outgoing edge: 1→0, 2→0, 3→0, 4→0, 0→5.
let mut g = Graph::new(6, true).unwrap();
for u in [1, 2, 3, 4] { g.add_edge(u, 0).unwrap(); }
g.add_edge(0, 5).unwrap();
let res = convergence_degree(&g).unwrap();
// 0→5 sees four sources converging into one terminus → +2/3.
assert!((res[4] - (4.0 / 6.0)).abs() < 1e-12);
// Each leaf-to-hub edge has one source, two sinks → −1/3.
for r in &res[..4] {
assert!((r - (-1.0 / 3.0)).abs() < 1e-12);
}