Lably
Skip to content

Biconnected component

Maximal biconnected subgraph

  • 5 min read
  • 2 chapters

Related on Lably

Through Graph (discrete mathematics), Stack (abstract data type) and If and only if

Algorithms

The classic sequential algorithm for computing biconnected components in a connected undirected graph is due to John Hopcroft and Robert Tarjan (1973). It runs in linear time, and is based on depth-first search. This algorithm is also outlined as Problem 22-2 of Introduction to Algorithms (both 2nd and 3rd editions).

The idea is to run a depth-first search while maintaining the following information:

  1. the depth of each vertex in the depth-first-search tree (once it gets visited), and
  2. for each vertex v, the lowest depth of neighbors of all descendants of v (including v itself) in the depth-first-search tree, called the lowpoint.

The depth is standard to maintain during a depth-first search. The lowpoint of v can be computed after visiting all descendants of v (i.e., just before v gets popped off the depth-first-search stack) as the minimum of the depth of v, the depth of all neighbors of v (other than the parent of v in the depth-first-search tree) and the lowpoint of all children of v in the depth-first-search tree.

The key fact is that a nonroot vertex v is a cut vertex (or articulation point) separating two biconnected components if and only if there is a child y of v such that lowpoint(y) ≥ depth(v). This property can be tested once the depth-first search returned from every child of v (i.e., just before v gets popped off the depth-first-search stack), and if true, v separates the graph into different biconnected components. This can be represented by computing one biconnected component out of every such y (a component which contains y will contain the subtree of y, plus v), and then erasing the subtree of y from the tree.

The root vertex must be handled separately: it is a cut vertex if and only if it has at least two children in the DFS tree. Thus, it suffices to simply build one component out of each child subtree of the root (including the root).

Pseudocode

<u id="mwUQ">GetArticulationPoints(i)</u> visited[i] := <b id="mwUg">true</b> current_time := current_time+1 visit_time[i] := current_time low[i] := current_time childCount := 0 isArticulation := <b id="mwUw">false</b> <b id="mwVA">for each</b> j <b id="mwVQ">in</b> Neighborhood(i) <b id="mwVg">do</b> <b id="mwVw">if</b> <b id="mwWA">not</b> visited[j] <b id="mwWQ">then</b> parent[j] := i GetArticulationPoints(j) childCount := childCount + 1 <b id="mwWg">if</b> low[j] ≥ visit_time[i] <b id="mwWw">then</b> isArticulation := <b id="mwXA">true</b> low[i] := Min (low[i], low[j]) <b id="mwXQ">else if</b> j ≠ parent[i] <b id="mwXg">then</b> low[i] := Min (low[i], visit_time[j]) <b id="mwXw">if</b> (parent[i] ≠ <b id="mwYA">null</b> <b id="mwYQ">and</b> isArticulation) <b id="mwYg">or</b> (parent[i] = <b id="mwYw">null</b> <b id="mwZA">and</b> childCount > 1) <b id="mwZQ">then</b> <b id="mwZg">Output</b> i as articulation point
<u id="mwaA">Main</u> current_time := 0 // global variable parent[r] := <b id="mwaQ">null</b> GetArticulationPoints(r) // r is an arbitrary root

Note that the terms child and parent denote the relations in the DFS tree, not the original graph.


Other algorithms

A simple alternative to the above algorithm uses chain decompositions, which are special ear decompositions depending on DFS-trees. Chain decompositions can be computed in linear time by this traversing rule. Let C be a chain decomposition of G. Then G is 2-vertex-connected if and only if G has minimum degree 2 and C1 is the only cycle in C. This gives immediately a linear-time 2-connectivity test and can be extended to list all cut vertices of G in linear time using the following statement: A vertex v in a connected graph G (with minimum degree 2) is a cut vertex if and only if v is incident to a bridge or v is the first vertex of a cycle in C – C1. The list of cut vertices can be used to create the block-cut tree of G in linear time.

In the online version of the problem, vertices and edges are added (but not removed) dynamically, and a data structure must maintain the biconnected components. Jeffery Westbrook and Robert Tarjan (1992) developed an efficient data structure for this problem based on disjoint-set data structures. Specifically, it processes n vertex additions and m edge additions in O(m α(m, n)) total time, where α is the inverse Ackermann function. This time bound is proved to be optimal.

Uzi Vishkin and Robert Tarjan (1985) designed a parallel algorithm on CRCW PRAM that runs in O(log n) time with n + m processors.

Another algorithm has been provided by Harold Gabow, in his paper "Path-based depth-first search for strong and biconnected components" (2000).

Sign in to keep reading

One more chapter is free with a Lably account.

More in Topics in mathematics