pub fn bridges(graph: &Graph) -> IgraphResult<Vec<u32>>Expand description
Bridges of graph — edges whose removal would increase the number
of (weakly) connected components.
Counterpart of igraph_bridges(). On directed graphs the input is
treated as undirected (matches upstream’s IGRAPH_ALL mode default
at components.c:1417). Returns edge ids.
§Examples
use rust_igraph::{Graph, bridges};
// Two triangles sharing a single bridge edge: 0-1-2-0, 3-4-5-3, 2-3.
// Only edge id 6 (the 2-3 link) is a bridge.
let mut g = Graph::with_vertices(6);
g.add_edge(0, 1).unwrap(); // edge 0
g.add_edge(1, 2).unwrap(); // edge 1
g.add_edge(2, 0).unwrap(); // edge 2
g.add_edge(3, 4).unwrap(); // edge 3
g.add_edge(4, 5).unwrap(); // edge 4
g.add_edge(5, 3).unwrap(); // edge 5
g.add_edge(2, 3).unwrap(); // edge 6 — bridge
assert_eq!(bridges(&g).unwrap(), vec![6]);