Skip to main content

is_biconnected

Function is_biconnected 

Source
pub fn is_biconnected(graph: &Graph) -> IgraphResult<bool>
Expand description

Check whether graph is biconnected.

On directed graphs the input is treated as undirected (matches upstream IGRAPH_ALL mode default at components.c:1292).

§Examples

use rust_igraph::{Graph, is_biconnected};

// Triangle: biconnected.
let mut g = Graph::with_vertices(3);
g.add_edge(0, 1).unwrap();
g.add_edge(1, 2).unwrap();
g.add_edge(2, 0).unwrap();
assert!(is_biconnected(&g).unwrap());

// Path 0-1-2: vertex 1 is an articulation point → not biconnected.
let mut g = Graph::with_vertices(3);
g.add_edge(0, 1).unwrap();
g.add_edge(1, 2).unwrap();
assert!(!is_biconnected(&g).unwrap());