Class Biconnectivity
- Namespace
- Graphity
- Assembly
- Graphity.Core.dll
The bridges, articulation points and biconnected components of a graph read as undirected, as BiconnectivityOf(BiAdjacentGraph) returns them.
public sealed class Biconnectivity
- Inheritance
-
Biconnectivity
- Inherited Members
Examples
Here, the control flow of the method load, whose loop is connected to the rest only through
header:
Biconnectivity biconnectivity =
Components.BiconnectivityOf(BiAdjacentGraph.Of(cfg));
Edges bridges = biconnectivity.Bridges;
// bridges: entry -> header, header -> exit
SortedIntView articulationPoints = biconnectivity.ArticulationPoints;
// articulationPoints: [1] - header
Remarks
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.
Instances are immutable and safe to share between threads.
Memory: up to 8 x EdgeCount + 20 x NodeCount bytes.
Properties
ArticulationPoints
Gets the articulation points, in ascending order.
public SortedIntView ArticulationPoints { get; }
Property Value
Remarks
Time: O(1).
Blocks
Gets the blocks, as a partition of the edges.
public EdgePartition Blocks { get; }
Property Value
Remarks
Each block is a group of the partition: Blocks.Get(e) returns the block of edge e,
and Blocks.EdgesOf(block) the edges of a block. Self-loops are in no block and map to -1,
so IsPartial is 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).
Bridges
Gets the bridges, in edge index order.
public Edges Bridges { get; }
Property Value
Remarks
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).