pub struct Biconnectivity { /* private fields */ }Expand description
The bridges, articulation points and biconnected components of a graph read as undirected, as
components::biconnectivity_of returns them.
A bridge is an edge whose removal increases the number of connected components, and an articulation point is a node whose removal does the same. A biconnected component, also called a block, is a maximal group of edges in which any two edges lie on a common cycle. The blocks partition the edges, not the nodes: an articulation point belongs to every block it touches.
The graph is read as undirected, as described at components: the edges
a -> b and b -> a are one undirected edge. So a graph that stores its edges in both directions
still has bridges, and the two directions of an edge lie in the same block. Self-loops are in no
block and never a bridge. Here, the control flow of the method load, whose loop is connected to
the rest only through header:
let biconnectivity = components::biconnectivity_of(&BiAdjacentGraph::of(&cfg));
let bridges = biconnectivity.bridges();
// bridges: entry -> header, header -> exit
let articulation_points = biconnectivity.articulation_points();
// articulation_points: [1] - headerInstances are immutable and safe to share between threads (Send and Sync).
Memory: up to 8 x edge_count + 20 x node_count bytes.
Implementations§
Source§impl Biconnectivity
impl Biconnectivity
Sourcepub fn bridges(&self) -> &Edges
pub fn bridges(&self) -> &Edges
Returns the bridges, in edge index order.
Of a bridge stored in both directions, only the edge from the lower to the higher node ID is
listed; blocks puts the other direction in the same block.
Time: O(1).
Sourcepub fn articulation_points(&self) -> SortedIntView<'_>
pub fn articulation_points(&self) -> SortedIntView<'_>
Returns the articulation points, in ascending order.
Time: O(1).
Sourcepub fn blocks(&self) -> &EdgePartition
pub fn blocks(&self) -> &EdgePartition
Returns the blocks, as a partition of the edges.
Each block is a group of the partition: blocks().get(e) returns the block of edge e, and
blocks().edges_of(block) the edges of a block. Self-loops are in no block and map to None, so
is_partial returns true exactly if the graph has self-loops.
Which block gets which group ID is not specified, but the same graph always yields the same group
IDs.
Time: O(1).
Trait Implementations§
Source§impl Clone for Biconnectivity
impl Clone for Biconnectivity
Source§fn clone(&self) -> Biconnectivity
fn clone(&self) -> Biconnectivity
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more