Skip to main content

edge_resilience

Function edge_resilience 

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

Compute edge resilience λ(G) / m.

The fraction of edges that must be removed to disconnect the graph.

§Examples

use rust_igraph::{Graph, edge_resilience};

// Path 0-1-2: λ = 1, m = 2, resilience = 0.5
let g = Graph::from_edges(&[(0,1),(1,2)], false, Some(3)).unwrap();
let r = edge_resilience(&g).unwrap();
assert!((r - 0.5).abs() < 0.01);