Académique Documents
Professionnel Documents
Culture Documents
Biconnected Components
Connectivity/Biconnectivity for Undirected Graph
Articulation points
Possible strategy:
For all vertices v in V:
Remove v and its incident edges
Test connectivity using a DFS.
Execution time: (n(n+m)).
Can we do better?
internal vertex u
Consider an internal vertex u
Not a leaf,
Assume it is not the root
u
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
Here u is an
is an articulation point
articulation
point
internal vertex u
This root is an
articulation
point
How to find articulation points?
A A
E E
B B
D D
I I
C F F
C
H H
G G
A
B
C
Can you characterize D ?
D
F E
G
H
I
Depth First Search number
A B C F
G =(V, E)
D E
1
A
2 ABCDEF
B 1 2 3 9 6 4
9
3 D
C
F 4 E
6
F 4 E
6
v
If there is a back edge from x
to a proper ancestor of v,
w then v is reachable from x.
x
Finding Articulation Points
low[v] = min{
d[v],
lowest d[w] among all back edges (v,w)
lowest low[w] among all tree edges (v,w)
}
In English: low(v) < d[v] indicates if there is
another way to reach v which is not via its parent
Definition of low(v)
6 g
Example
Initialize Low
1 a 1 of each node
a e i
Low[u] = d[u]
2 b 2 8 e 8
b f j
3 c 3 9 i 9
c g
10 10
4 d 4 7 f 7 j
d h
5 h 5
low[v] = min{ 6 g 6
d[v],
lowest d[w] among all back edges (v,w)
lowest low[w] among all tree edges (v,w)
}
Example
Travers the tree
1 a 1 in post-order
a e i
Left, Right, Root
2 b 2 8 e 8
b f j
3 c 3 9 i 9
c g
10 10
4 d 4 7 f 7 j
d h
So, Node Low[g]
5 h 5 =min{ d[g],
min all d[w]
min all low [w]}
low[v] = min{ 6 g 6 3 =min { 6, 3, NA}
d[v], =3
lowest d[w] among all back edges (v,w)
lowest low[w] among all tree edges (v,w)
}
Example
Travers the tree
1 a 1 in post-order
a e i
Left, Right, Root
2 b 2 8 e 8
b f j
3 c 3 9 i 9
c g
10 10
4 d 4 7 f 7 j
d h
Next, Node Low[h]
5 h 5 3 =min{ d[h],
min all d[w]
min all low [w]}
low[v] = min{ 6 g 3 =min { 5, 3, 3}
d[v], =3
lowest d[w] among all back edges (v,w)
lowest low[w] among all tree edges (v,w)
}
Example
Travers the tree
1 a 1 in post-order
a e i
Left, Right, Root
2 b 2 8 e 8
b f j
3 c 3 9 i 9
c g
10 10
4 d 4 7 f 7 j
d h 3 Next, Node Low[d]
5 h 3 =min{ d[d],
min all d[w]
min all low [w]}
low[v] = min{ 6 g 3 =min { 4, 3, 3}
d[v], =3
lowest d[w] among all back edges (v,w)
lowest low[w] among all tree edges (v,w)
}
Example
Travers the tree
1 a 1 in post-order
a e i
Left, Right, Root
2 b 2 8 e 8
b f j
3 c 3 9 i 9
c g
10 10
4 d 3 7 f 7 j
d h 1 Next, Node Low[f]
5 h 3 =min{ d[f],
min all d[w]
min all low [w]}
low[v] = min{ 6 g 3 =min { 7, NA, 1}
d[v], =1
lowest d[w] among all back edges (v,w)
lowest low[w] among all tree edges (v,w)
}
Example
Travers the tree
1 a 1 in post-order
a e i
Left, Right, Root
2 b 2 8 e 8
b f j
1
3 c 3 9 i 9
c g
10 10
4 d 3 7 f 1 j
d h
Next, Node Low[c]
5 h 3 =min{ d[c],
min all d[w]
min all low [w]}
low[v] = min{ 6 g 3 =min { 3, 1, 1}
d[v], =1
lowest d[w] among all back edges (v,w)
lowest low[w] among all tree edges (v,w)
}
Example
Travers the tree
1 a 1 in post-order
a e i
Left, Right, Root
2 b 2 8 e 8
b f j 1
3 c 1 9 i 9
c g
10 10
4 d 3 7 f 1 j
d h
Next, Node Low[b]
5 h 3 =min{ d[b],
min all d[w]
min all low [w]}
low[v] = min{ 6 g 3 =min { 2, 1, 1}
d[v], =1
lowest d[w] among all back edges (v,w)
lowest low[w] among all tree edges (v,w)
}
Example
Travers the tree
1 a 1 in post-order
a e i
Left, Right, Root
2 b 1 8 e 8
b f j
3 c 1 9 i 9
c g
10 10 8
4 d 3 7 f 1 j
d h
Next, Node Low[j]
5 h 3 =min{ d[j],
min all d[w]
min all low [w]}
low[v] = min{ 6 g 3 =min { 10, 8, NA}
d[v], =8
lowest d[w] among all back edges (v,w)
lowest low[w] among all tree edges (v,w)
}
Example
Travers the tree
1 a 1 in post-order
a e i
Left, Right, Root
2 b 1 8 e 8
b f j
3 c 1 9 i 9 8
c g
10 8
4 d 3 7 f 1 j
d h
Next, Node Low[i]
5 h 3 =min{ d[i],
min all d[w]
min all low [w]}
low[v] = min{ 6 g 3 =min { 9, 8, 8}
d[v], =8
lowest d[w] among all back edges (v,w)
lowest low[w] among all tree edges (v,w)
}
Example
Travers the tree
1 a 1 in post-order
a e i
Left, Right, Root
2 b 1 8 e 8
b f j No Change
3 c 1 9 i 8
c g
10 8
4 d 3 7 f 1 j
d h
Next, Node Low[e]
5 h 3 =min{ d[e],
min all d[w]
min all low [w]}
low[v] = min{ 6 g 3 =min { 8, 8, 8}
d[v], =8
lowest d[w] among all back edges (v,w)
lowest low[w] among all tree edges (v,w)
}
Example
1 a 1
a e i No Change
2 b 1 8 e 8
b f j
3 c 1 9 i 8
c g
10 8
4 d 3 7 f 1 j
d h
Next, Node Low[a]
5 h 3 =min{ d[e],
min all d[w]
min all low [w]}
low[v] = min{ 6 g 3 =min { 1, 1, NA}
d[v], =1
lowest d[w] among all back edges (v,w)
lowest low[w] among all tree edges (v,w)
}
Example
1 a 1
a e i
2 b 1 8 e 8
b f j
3 c 1 9 i 8
c g
10 8
4 d 3 7 f 1 j
d h
Node a,
5 h 3 It is Root & it has more than
one child so it is an articulation
point
6 g 3
6 g 3
6 g 3
A bridge is an edge in a connected graph whose removal makes it
disconnected
(u,v) is a bridge if LOW(v) > d[u]
Example
1 a 1
a e i
2 b 1 8 e 8
b f j
3 c 1 9 i 8
c g
10 8
4 d 3 7 f 1 j
d h
Edge a b,
5 h 3 Low[b] <= d[a]
So, Not a Bridge
6 g 3
A bridge is an edge in a connected graph whose removal makes it
disconnected
(u,v) is a bridge if LOW(v) > d[u]
Example
1 a 1
a e i
2 b 1 8 e 8
b f j
3 c 1 9 i 8
c g
10 8
4 d 3 7 f 1 j
d h
Edge b c,
5 h 3 Low[c] <= d[b]
So, Not a Bridge
6 g 3
A bridge is an edge in a connected graph whose removal makes it
disconnected
(u,v) is a bridge if LOW(v) > d[u]
Example
1 a 1
a e i
2 b 1 8 e 8
b f j
3 c 1 9 i 8
c g
10 8
4 d 3 7 f 1 j
d h
Edge c f,
5 h 3 Low[f] <= d[c]
So, Not a Bridge
6 g 3
A bridge is an edge in a connected graph whose removal makes it
disconnected
(u,v) is a bridge if LOW(v) > d[u]
Example
1 a 1
a e i
2 b 1 8 e 8
b f j
3 c 1 9 i 8
c g
10 8
4 d 3 7 f 1 j
d h
Edge c d,
5 h 3 Low[d] <= d[c]
So, Not a Bridge
6 g 3
A bridge is an edge in a connected graph whose removal makes it
disconnected
(u,v) is a bridge if LOW(v) > d[u]
Example
1 a 1
a e i
2 b 1 8 e 8
b f j
3 c 1 9 i 8
c g
10 8
4 d 3 7 f 1 j
d h
Edge d h,
5 h 3 Low[h] <= d[d]
So, Not a Bridge
6 g 3
A bridge is an edge in a connected graph whose removal makes it
disconnected
(u,v) is a bridge if LOW(v) > d[u]
Example
1 a 1
a e i
2 b 1 8 e 8
b f j
3 c 1 9 i 8
c g
10 8
4 d 3 7 f 1 j
d h
Edge h g,
5 h 3 Low[g] <= d[h]
So, Not a Bridge
6 g 3
A bridge is an edge in a connected graph whose removal makes it
disconnected
(u,v) is a bridge if LOW(v) > d[u]
Example
1 a 1
a e i
2 b 1 8 e 8
b f j
3 c 1 9 i 8
c g
10 8
4 d 3 7 f 1 j
d h
Edge a e,
5 h 3 Low[e] > d[a]
So, Is a Bridge
6 g 3
A bridge is an edge in a connected graph whose removal makes it
disconnected
(u,v) is a bridge if LOW(v) > d[u]
Example
1 a 1
a e i
2 b 1 8 e 8
b f j
3 c 1 9 i 8
c g
10 8
4 d 3 7 f 1 j
d h
Edge e i,
5 h 3 Low[i] <= d[e]
So, Not a Bridge
6 g 3
A bridge is an edge in a connected graph whose removal makes it
disconnected
(u,v) is a bridge if LOW(v) > d[u]
Example
1 a 1
a e i
2 b 1 8 e 8
b f j
3 c 1 9 i 8
c g
10 8
4 d 3 7 f 1 j
d h
Edge i i,
5 h 3 Low[j] <= d[i]
So, Not a Bridge
6 g 3
A bridge is an edge in a connected graph whose removal makes it
disconnected
(u,v) is a bridge if LOW(v) > d[u]
Articulation Points: Pseudocode