0% found this document useful (0 votes)
7 views

17. W-10_L-1_DFS Applications Full Tree Traversal Cycle Finding Component Finding Articulation Point Finding.pptx

The document discusses Depth-First Search (DFS) and its applications, including tree traversal, cycle finding, and component finding. It explains the different types of edges in DFS: tree edges, back edges, forward edges, and cross edges, highlighting their characteristics and importance. Additionally, it includes references for further reading and practice resources.

Uploaded by

6yzdahmed
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views

17. W-10_L-1_DFS Applications Full Tree Traversal Cycle Finding Component Finding Articulation Point Finding.pptx

The document discusses Depth-First Search (DFS) and its applications, including tree traversal, cycle finding, and component finding. It explains the different types of edges in DFS: tree edges, back edges, forward edges, and cross edges, highlighting their characteristics and importance. Additionally, it includes references for further reading and practice resources.

Uploaded by

6yzdahmed
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 13

DFS Applications Full Tree

Traversal Cycle Finding


Component Finding Articulation
Point Finding
Week-10, Lecture-01

Course Code: CSE221 Course Teacher: Tanzina Afroz Rimi


Course Title: Algorithms Designation: Lecturer
Program: B.Sc. in CSE Email: [email protected]
DFS: Kinds of edges
• DFS introduces an important distinction among edges in the original
graph:
• Tree edge: encounter new (white) vertex
• The tree edges form a spanning forest
• Can tree edges form cycles? Why or why not?
• No

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

Tree edges Back edges


5
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
• Not a tree edge, though
• From grey node to black node

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

Tree edges Back edges Forward edges Cross edges


8
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
• Note: tree & back edges are important; most algorithms don’t
distinguish forward & cross

9
Textbooks & Web References
• Text Book (Chapter 22)
• www.geeksforgeeks.org
Practice

You might also like