Skip to main content

convergence_degree_full

Function convergence_degree_full 

Source
pub fn convergence_degree_full(
    graph: &Graph,
) -> IgraphResult<(Vec<f64>, Vec<f64>, Vec<f64>)>
Expand description

Convergence degree along with the per-edge In(e) / Out(e) counts.

All three returned vectors have length graph.ecount().

ยงExamples

use rust_igraph::{Graph, convergence_degree_full};

// Path 0โ€”1โ€”2โ€”3 (undirected): the middle edge is touched by every
// source/sink pair across it; the end edges are not.
let mut g = Graph::with_vertices(4);
for (u, v) in [(0, 1), (1, 2), (2, 3)] { g.add_edge(u, v).unwrap(); }
let (_, ins, outs) = convergence_degree_full(&g).unwrap();
for (i, o) in ins.iter().zip(outs.iter()) {
    assert!(i + o > 0.0);
}