27-1. Connected Components Biconnected Components
27-1. Connected Components Biconnected Components
Biconnected Components
1
Connected Component
Connectivity in an undirected graph means that every vertex can reach every
other vertex via any path. If the graph is not connected the graph can be
broken down into Connected Components.
Strong Connectivity applies only to directed graphs. A directed graph is
strongly connected if there is a directed path from any vertex to every other
vertex. This is same as connectivity in an undirected graph, the only
difference being strong connectivity applies to directed graphs and there
should be directed paths instead of just paths. Like connected components, a
directed graph can be broken down into Strongly Connected Components.
A connected component of an undirected graph
is a maximal connected subgraph.
A tree is a graph that is connected and acyclic.
A directed graph is strongly connected if there
is a directed path from vi to vj and also
from vj to vi.
2
*Figure 6.5: A graph with two connected components
connected component (connected subgraph)
H1 0 H2 4
2 1 5
3 6
G4 (not connected)
3
*Figure 6.6: Strongly connected components of G3
0
0
1
2
G3
4
Connected Component
Strong connectivity and equivalence relations
In undirected graphs, two vertices are connected if they have a path connecting them. How should we define
connected in a directed graph? We say that a vertex a is strongly connected to b if there exist two paths, one from
a to b and another from b to a. Note that we allow the two paths to share vertices or even to share edges. We will
use a ~ b as shorthand for "a is strongly connected to b". We will allow very short paths, with one vertex and no
edges, so that any vertex is strongly connected to itself.
Recall that a relation is another word for a collection of pairs of objects (if you like, you can think of a relation as
being a directed graph, but not the same one we're using to define connectivity). An equivalence relation a # b is a
relation that satisfies three simple properties:
•Reflexive property: For all a, a # a. Any vertex is strongly connected to itself, by definition.
•Symmetric property: If a # b, then b # a. For strong connectivity, this follows from the symmetry of the
definition. The same two paths (one from a to b and another from b to a) that show that a ~ b, looked at in the
other order (one from b to a and another from a to b) show that b ~ a.
•Transitive property: If a # b and b # c, then a # c. Let's expand this out for strong connectivity: if a ~ b and b ~
c, we have four paths: a-b, b-a, b-c, and c-b. Concatenating them in pairs a-b-c and c-b-a produces two paths
connecting a-c and c-a, so a ~ c, showing that the transitive property holds for strong connectivity.
5
Since all three properties are true of strong connectivity, strong connectivity is an equivalence relation.
Connected Components
If in the above graph, vertex 1 and all the edges associated with
it, i.e. the edges 1-0, 1-2 and 1-3 are removed, there will be no
path to reach any of the vertices 2, 3 or 4 from the vertices 0 and
5, that means the graph will split into two separate components. 7
One consisting of the vertices 0 and 5 and another one consisting
of the vertices 2, 3 and 4 as shown in the following figure.
Articulation Point
• Likewise removing the vertex 0 will disconnect the vertex 5
from all other vertices. Hence the given graph has two
articulation points: 0 and 1.
u
Let v1, v2,…, vk denote the
children of u
– Each is the root of a subtree of DFS
This root is an
articulation point
Important Point
Forward Edge: It is an edge (u, v) such that v is descendant
but not part of the DFS tree.
Back edge: It is an edge (u, v) such that v is ancestor of edge
u but not part of DFS tree.
Presence of back edge indicates a cycle in directed graph.
Cross Edge: It is a edge which connects two node such that
they do not have any ancestor and a descendant relationship
between them.
How to find articulation
points?
[Step 1.]
Find the depth-first spanning tree T for G
[Step 2.]
Add back edges in T
[Step 3.]
Determine DFN(i) and L(i) DFN(i): the visiting
sequence of vertices i by depth first search L(i): the
least DFN reachable from i through a path
consisting of zero or more tree edges followed by
zero or one back edge
[Step 4.]
Vertex i is an articulation point of G if and only if
either: i is the root of T and has at least two
children i is not the root and has a child j for which
L(j)>=DFN(i) 14
How to find articulation
points?
15
Find biconnected component of a connected undirected graph
by depth first spanning tree
nontree
0 edge
3 (back edge)
4 0 9 8 9 8 1 5
nontree 4 5
7 7 edge
3 1
0 5 (back edge) 2 2 6 6
2 2 3 5 3
1 7 7
dfn
depth 8 9
4 6
first 4 0 9 8
1 6
number
(a) depth first spanning tree (b)
If u is an ancestor of v then dfn(u) < dfn(v).
16
*Figure 6.24: dfn and low values for dfs spanning tree with root =3
0
Vertax 0 1 2 3 4 5 6 7 8 9
dfn 4 3 2 0 1 5 6 7 9 8
low 4 0 0 0 0 5 5 5 9 8
***low, for each vertex of G such that low (u) is the lowest depth
first number that we can reach from u using a path of descendants
followed by at most one back edge
u: articulation point : 1, 3, 5, 7
low(child) dfn(u) 17
Biconnected Components
Before Biconnected Components, let's first try to understand
what a Biconnected Graph is and how to check if a given graph
is Biconnected or not.
A graph is said to be Biconnected if:
1.It is connected, i.e. it is possible to reach every vertex from
every other vertex, by a simple path.
2.Even after removing any vertex the graph remains connected.
For example, consider the graph in the following figure
18
Biconnected Components
The given graph is clearly connected. Now try removing the
vertices one by one and observe. Removing any of the vertices
does not increase the number of connected components. So the
given graph is Biconnected.
Now consider the following graph which is a slight modification
in the previous graph.