Skip to main content

articulation_points

Function articulation_points 

Source
pub fn articulation_points(graph: &Graph) -> IgraphResult<Vec<VertexId>>
Expand description

Articulation points of graph (returns vertices in upstream’s DFS-discovery order).

On directed graphs the input is treated as undirected (matching upstream igraph’s IGRAPH_ALL mode default at components.c:1060).

§Examples

use rust_igraph::{Graph, articulation_points};

// Cycle 0-1-2-0 plus pendant 2-3-4: vertices 2 and 3 are articulation points.
let mut g = Graph::with_vertices(5);
g.add_edge(0, 1).unwrap();
g.add_edge(1, 2).unwrap();
g.add_edge(2, 0).unwrap();
g.add_edge(2, 3).unwrap();
g.add_edge(3, 4).unwrap();
let mut ap = articulation_points(&g).unwrap();
ap.sort_unstable();
assert_eq!(ap, vec![2, 3]);