• edited by
875 views
1 1 vote
Assume WHITE vertices that are yet to be discovered, BLACK vertices are finished vertices and GRAY vertices are frontier betweeen WHITE and BLACK in Depth First Search.

Now, What are the various edge types like TREE-EDGE and BACK-EDGE possible between any pair of vertices during a Depth First Search in an Undirected graph.

Confused about the edge type between WHITE and GRAY type vertices.

[ CLRS (3rd Edition) : 22-3:1; Page # 610 ]

1 Answer

0 0 votes

An edge (u,v) is said to be TREE-EDGE if either u is ancestor of v or v is ancestor of u.
An edge (u,v) is said to be BACK-EGE if the edge between u and v discovered during the traversal from v to u.

If we can have a TREE-EDGE between any pair of types of vertices in an undirected graph, we can also have BACK-EDGE in that same pair of  types of vertices.

Possible types of edges in undirected graph during DFS at any stage
  WHITE GRAY BLACK
WHITE Tree, Back Tree, Back None
GRAY Tree, Back Tree, Back Tree, Back
BLACK None Tree, Back Tree, Back
Position:
Show:

Related questions

0 0 votes
0 0 answers
1.5k
1.5k views
Lakshman Bhaiya asked Nov 13, 2018
1,502 views
Consider the following sequence of nodes for the undirected graph given below$:$$(1)PQSTWVUR$$(2)PQRSTUWV$$(3)PQRTUSVW$A Depth First Search (DFS) is started at node $P.$T...
1 1 vote
1 1 answer
1.6k
1.6k views
Aditya Bahuguna asked Jan 7, 2018
1,562 views
Consider the graph belowThe sequence of vertex that are not pushed onto stack using DFS starting from vertex ' 8 '.4,7$6,7,5$2,3None
1 1 vote
1 1 answer
1.8k
1.8k views
Shubham Kumar Gupta asked Dec 3, 2017
1,803 views
DFS Graph Traversal:Starting vertex $=\mathrm{V}_{6}$Identify valid DFS.$6,8,7,5,4,2,1$$6,3,1,2,4,5,8,7$$6,3,7,8,5,2,4,1$$6,8,5,4,2,1,7$
0 0 votes
0 0 answers
474
474 views
saumya mishra asked Sep 25, 2017
474 views
What is the correct answer please provide with reason?