2
Most read
3
Most read
20
Most read
1
Connected Components and
Biconnected Components
2
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.
Connected Component
3
*Figure 6.5: A graph with two connected components
1
0
2
3
4
5
6
7
H1 H2
G4 (not connected)
connected component (connected subgraph)
4
*Figure 6.6: Strongly connected components of G3
0
1
0
1
2
G3
not strongly connected
strongly connected component
(strongly connected subgraph)
5
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.
Since all three properties are true of strong connectivity, strong connectivity is an equivalence relation.
6
Connected Components
adjacency list: O(n+e)
adjacency matrix: O(n2)
7
Articulation Point
In a graph, a vertex is called an articulation point if removing it and all
the edges associated with it results in the increase of the number of
connected components in the graph. For example consider the graph
given in following figure.
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. 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.
8
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.
• Articulation Points represents vulnerabilities in a network. In order
to find all the articulation points in a given graph, the brute force
approach is to check for every vertex if it is an articulation point or
not, by removing it and then counting the number of connected
components in the graph. If the number of components increases,
then the vertex under consideration is an articulation point
otherwise not.
Consider an internal vertex u
– Not a leaf,
– Assume it is not the root
Let v1, v2,…, vk denote the
children of u
– Each is the root of a subtree of DFS
– If for some child, there is no back
edge from any node in this subtree
going to a proper ancestor of u, then u
is an articulation point
u
Here u is an
articulation point
Articulation Point for internal
vertex u
internal vertex u
Here u is not an articulation
point
– A back edge from every
subtree of u to proper
ancestors of u exists
u
What if u is a leaf
A leaf is never an articulation point
A leaf has no subtrees..
What about the root?
the root is an articulation point if an only if
it has two or more children.
– Root has no proper ancestor
– There are no cross edges between its subtrees
This root is an
articulation 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.
Important Point
14
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)
15
How to find articulation points?
16
Find biconnected component of a connected undirected graph
by depth first spanning tree
8 9
1
4 0
3
0 5
3 5
4 6
1 6
9 8 9 8
7 7
3
4 5
7
6
9 8
2
0
1
0
6
7
1 5
2
4
3
(a) depth first spanning tree (b)
2 2
dfn
depth
first
number
nontree
edge
(back edge)
nontree
edge
(back edge)
If u is an ancestor of v then dfn(u) < dfn(v).
17
*Figure 6.24: dfn and low values for dfs spanning tree with root =3
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
low(u)=min{dfn(u), min{low(w)|w is a child of u},
min{dfn(w)|(u,w) is a back edge}
u: articulation point : 1, 3, 5, 7
low(child)  dfn(u)
0
18
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
19
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.
Now what to look for in a graph to check if it's Biconnected. By now it
is said that a graph is Biconnected if it has no vertex such that its
removal increases the number of connected components in the graph.
And if there exists such a vertex then it is not Biconnected. A vertex
whose removal increases the number of connected components is
called an Articulation Point.
So simply check if the given graph has any articulation point or not. If
it has no articulation point, then it is Biconnected otherwise not.
20
A biconnected component of a connected undirected graph is a maximal biconnected
subgraph, H, of G. By maximal, we mean that G contains no other subgraph that is both
biconnected and properly contains H. For example, the graph of following Figure contains
the six biconnected components shown in following Figure . It is easy to verify that two
biconnected components of the same graph have no more than one vertex in common.
This means that no edge can be in two or more biconnected components of a graph. Hence,
the biconnected components of G partition the edges of G. We can find the biconnected
components of a connected undirected graph, G, by using any depth first spanning tree of
G.
Biconnected Components
21
Applications
Application:
• Networking A computer network can be modeled
as a graph, where vertices are routers and edges
are network connections between edges.
• A router can be considered critical if it can
disconnect the network for that router to fail. It
would be nice to identify which routers are
critical. We can do such an identification by
solving the biconnected components problem.

More Related Content

PPTX
Connectivity of graphs
PDF
graph_theory_1-11.pdf___________________
PPTX
Electrical Network Topology
PPT
Biconnected components (13024116056)
PPTX
PPTX
Spanningtreesppt
PPTX
NON-LINEAR DATA STRUCTURE-Graphs.pptx
PPTX
Graph data structures for ppt for understanding.pptx
Connectivity of graphs
graph_theory_1-11.pdf___________________
Electrical Network Topology
Biconnected components (13024116056)
Spanningtreesppt
NON-LINEAR DATA STRUCTURE-Graphs.pptx
Graph data structures for ppt for understanding.pptx

Similar to 27-1. Connected Components Biconnected Components.pdf (20)

PPT
Lecture 5b graphs and hashing
PPTX
Lecture 2.3.1 Graph.pptx
PDF
PPT on Graph Theory ( Tree, Cotree, nodes, branches, incidence , tie set and ...
PPTX
logic.pptx
PDF
NAS-Ch2-Network Equations
PPT
Data Structures-Non Linear DataStructures-Graphs
PPTX
DATA STRUCTURES.pptx
PPTX
Graphs.pptx
PPTX
Data structure note
PPSX
Unit-6 Graph.ppsx ppt
PPTX
Graph Theory in Theoretical computer science
PPTX
UNIT IV NON LINEAR DATA STRUCTURES - GRAPH
PPTX
Tree, function and graph
PPT
Graph theory concepts complex networks presents-rouhollah nabati
PDF
unit-3-dsa-graph introduction to grapgh and graph type
PDF
Daa chpater 12
PPTX
GRAPH THEORY AND ITS APPLICATIONS.......
PPTX
Slides Chapter10.1 10.2
PDF
Unit 4.2(graphs)
PPTX
VANU no sql ppt.pptx
Lecture 5b graphs and hashing
Lecture 2.3.1 Graph.pptx
PPT on Graph Theory ( Tree, Cotree, nodes, branches, incidence , tie set and ...
logic.pptx
NAS-Ch2-Network Equations
Data Structures-Non Linear DataStructures-Graphs
DATA STRUCTURES.pptx
Graphs.pptx
Data structure note
Unit-6 Graph.ppsx ppt
Graph Theory in Theoretical computer science
UNIT IV NON LINEAR DATA STRUCTURES - GRAPH
Tree, function and graph
Graph theory concepts complex networks presents-rouhollah nabati
unit-3-dsa-graph introduction to grapgh and graph type
Daa chpater 12
GRAPH THEORY AND ITS APPLICATIONS.......
Slides Chapter10.1 10.2
Unit 4.2(graphs)
VANU no sql ppt.pptx
Ad

Recently uploaded (20)

PDF
medical_surgical_nursing_10th_edition_ignatavicius_TEST_BANK_pdf.pdf
PDF
FOISHS ANNUAL IMPLEMENTATION PLAN 2025.pdf
PDF
English Textual Question & Ans (12th Class).pdf
PDF
Complications of Minimal Access-Surgery.pdf
PDF
BP 704 T. NOVEL DRUG DELIVERY SYSTEMS (UNIT 1)
PPTX
Share_Module_2_Power_conflict_and_negotiation.pptx
PDF
LIFE & LIVING TRILOGY- PART (1) WHO ARE WE.pdf
PDF
Race Reva University – Shaping Future Leaders in Artificial Intelligence
PPTX
Module on health assessment of CHN. pptx
PDF
International_Financial_Reporting_Standa.pdf
PDF
FORM 1 BIOLOGY MIND MAPS and their schemes
PDF
semiconductor packaging in vlsi design fab
PDF
What if we spent less time fighting change, and more time building what’s rig...
PDF
ChatGPT for Dummies - Pam Baker Ccesa007.pdf
PPTX
Education and Perspectives of Education.pptx
PDF
BP 505 T. PHARMACEUTICAL JURISPRUDENCE (UNIT 1).pdf
PPTX
Virtual and Augmented Reality in Current Scenario
PPTX
B.Sc. DS Unit 2 Software Engineering.pptx
PPTX
A powerpoint presentation on the Revised K-10 Science Shaping Paper
PPTX
ELIAS-SEZIURE AND EPilepsy semmioan session.pptx
medical_surgical_nursing_10th_edition_ignatavicius_TEST_BANK_pdf.pdf
FOISHS ANNUAL IMPLEMENTATION PLAN 2025.pdf
English Textual Question & Ans (12th Class).pdf
Complications of Minimal Access-Surgery.pdf
BP 704 T. NOVEL DRUG DELIVERY SYSTEMS (UNIT 1)
Share_Module_2_Power_conflict_and_negotiation.pptx
LIFE & LIVING TRILOGY- PART (1) WHO ARE WE.pdf
Race Reva University – Shaping Future Leaders in Artificial Intelligence
Module on health assessment of CHN. pptx
International_Financial_Reporting_Standa.pdf
FORM 1 BIOLOGY MIND MAPS and their schemes
semiconductor packaging in vlsi design fab
What if we spent less time fighting change, and more time building what’s rig...
ChatGPT for Dummies - Pam Baker Ccesa007.pdf
Education and Perspectives of Education.pptx
BP 505 T. PHARMACEUTICAL JURISPRUDENCE (UNIT 1).pdf
Virtual and Augmented Reality in Current Scenario
B.Sc. DS Unit 2 Software Engineering.pptx
A powerpoint presentation on the Revised K-10 Science Shaping Paper
ELIAS-SEZIURE AND EPilepsy semmioan session.pptx
Ad

27-1. Connected Components Biconnected Components.pdf

  • 2. 2 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. Connected Component
  • 3. 3 *Figure 6.5: A graph with two connected components 1 0 2 3 4 5 6 7 H1 H2 G4 (not connected) connected component (connected subgraph)
  • 4. 4 *Figure 6.6: Strongly connected components of G3 0 1 0 1 2 G3 not strongly connected strongly connected component (strongly connected subgraph)
  • 5. 5 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. Since all three properties are true of strong connectivity, strong connectivity is an equivalence relation.
  • 6. 6 Connected Components adjacency list: O(n+e) adjacency matrix: O(n2)
  • 7. 7 Articulation Point In a graph, a vertex is called an articulation point if removing it and all the edges associated with it results in the increase of the number of connected components in the graph. For example consider the graph given in following figure. 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. 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.
  • 8. 8 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. • Articulation Points represents vulnerabilities in a network. In order to find all the articulation points in a given graph, the brute force approach is to check for every vertex if it is an articulation point or not, by removing it and then counting the number of connected components in the graph. If the number of components increases, then the vertex under consideration is an articulation point otherwise not.
  • 9. Consider an internal vertex u – Not a leaf, – Assume it is not the root Let v1, v2,…, vk denote the children of u – Each is the root of a subtree of DFS – If for some child, there is no back edge from any node in this subtree going to a proper ancestor of u, then u is an articulation point u Here u is an articulation point Articulation Point for internal vertex u
  • 10. internal vertex u Here u is not an articulation point – A back edge from every subtree of u to proper ancestors of u exists u
  • 11. What if u is a leaf A leaf is never an articulation point A leaf has no subtrees..
  • 12. What about the root? the root is an articulation point if an only if it has two or more children. – Root has no proper ancestor – There are no cross edges between its subtrees This root is an articulation point
  • 13. 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. Important Point
  • 14. 14 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)
  • 15. 15 How to find articulation points?
  • 16. 16 Find biconnected component of a connected undirected graph by depth first spanning tree 8 9 1 4 0 3 0 5 3 5 4 6 1 6 9 8 9 8 7 7 3 4 5 7 6 9 8 2 0 1 0 6 7 1 5 2 4 3 (a) depth first spanning tree (b) 2 2 dfn depth first number nontree edge (back edge) nontree edge (back edge) If u is an ancestor of v then dfn(u) < dfn(v).
  • 17. 17 *Figure 6.24: dfn and low values for dfs spanning tree with root =3 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 low(u)=min{dfn(u), min{low(w)|w is a child of u}, min{dfn(w)|(u,w) is a back edge} u: articulation point : 1, 3, 5, 7 low(child)  dfn(u) 0
  • 18. 18 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
  • 19. 19 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. Now what to look for in a graph to check if it's Biconnected. By now it is said that a graph is Biconnected if it has no vertex such that its removal increases the number of connected components in the graph. And if there exists such a vertex then it is not Biconnected. A vertex whose removal increases the number of connected components is called an Articulation Point. So simply check if the given graph has any articulation point or not. If it has no articulation point, then it is Biconnected otherwise not.
  • 20. 20 A biconnected component of a connected undirected graph is a maximal biconnected subgraph, H, of G. By maximal, we mean that G contains no other subgraph that is both biconnected and properly contains H. For example, the graph of following Figure contains the six biconnected components shown in following Figure . It is easy to verify that two biconnected components of the same graph have no more than one vertex in common. This means that no edge can be in two or more biconnected components of a graph. Hence, the biconnected components of G partition the edges of G. We can find the biconnected components of a connected undirected graph, G, by using any depth first spanning tree of G. Biconnected Components
  • 21. 21 Applications Application: • Networking A computer network can be modeled as a graph, where vertices are routers and edges are network connections between edges. • A router can be considered critical if it can disconnect the network for that router to fail. It would be nice to identify which routers are critical. We can do such an identification by solving the biconnected components problem.