17. W-10_L-1_DFS Applications Full Tree Traversal Cycle Finding Component Finding Articulation Point Finding.pptx
17. W-10_L-1_DFS Applications Full Tree Traversal Cycle Finding Component Finding Articulation Point Finding.pptx
2
DFS Example
source
vertex d
f
1 8 13|
|12 |11 16
2 | 9
7 |10
3 | 5 | 14|
4 6 15
Tree edges
3
DFS: Kinds of edges
• DFS introduces an important distinction among edges in the original
graph:
• Tree edge: encounter new (white) vertex
• Back edge: from descendent to ancestor
• Encounter a grey vertex (grey to grey)
• Self loops are considered as to be back edge.
4
DFS Example
source
vertex d
f
1 8 13|
|12 |11 16
2 | 9
7 |10
3 | 5 | 14|
4 6 15
6
DFS: Kinds of edges
• DFS introduces an important distinction among edges in the original
graph:
• Tree edge: encounter new (white) vertex
• Back edge: from descendent to ancestor
• Forward edge: from ancestor to descendent
• Cross edge: between a tree or subtrees
• From a grey node to a black node
7
DFS Example
source
vertex d
f
1 8 13|
|12 |11 16
2 | 9
7 |10
3 | 5 | 14|
4 6 15
9
Textbooks & Web References
• Text Book (Chapter 22)
• www.geeksforgeeks.org
Practice