2. [6 pts] Show how depth-first search works on the following graph. Assume Q is the source vertex and also each adjacen
Posted: Tue Apr 12, 2022 10:23 am
2. [6 pts] Show how depth-first search works on the following
graph. Assume Q is the source vertex and also each adjacency list
is ordered in alphabetical order. Write (W/G/B) next to each
vertices to indicate White/Gray/Black color and its discover &
finish time accordingly, also label each edges as T, B, C or F
according to whether they are Tree, Back, Cross or Forward edges.
At the very end, draw the depth-first tree/forest. (See Fig. 22.4
on textbook pp.605 as an example)
I am struggling to understand how the steps can be put into the
diagram.
2. [6 pts] Show how depth-first search works on the following graph. Assume Q is the source vertex and also each adjacency list is ordered in alphabetical order. Write (W/G/B) next to each vertices to indicate White/Gray/Black color and its discover & finish time accordingly, also label each edges as T, B, C or F according to whether they are Tree, Back, Cross or Forward edges. At the very end, draw the depth-first tree/forest. (See Fig. 22.4 on textbook pp.605 as an example) R R W v w Z Z R R 1 w V w Z Z R R I w w Z Z
graph. Assume Q is the source vertex and also each adjacency list
is ordered in alphabetical order. Write (W/G/B) next to each
vertices to indicate White/Gray/Black color and its discover &
finish time accordingly, also label each edges as T, B, C or F
according to whether they are Tree, Back, Cross or Forward edges.
At the very end, draw the depth-first tree/forest. (See Fig. 22.4
on textbook pp.605 as an example)
I am struggling to understand how the steps can be put into the
diagram.
2. [6 pts] Show how depth-first search works on the following graph. Assume Q is the source vertex and also each adjacency list is ordered in alphabetical order. Write (W/G/B) next to each vertices to indicate White/Gray/Black color and its discover & finish time accordingly, also label each edges as T, B, C or F according to whether they are Tree, Back, Cross or Forward edges. At the very end, draw the depth-first tree/forest. (See Fig. 22.4 on textbook pp.605 as an example) R R W v w Z Z R R 1 w V w Z Z R R I w w Z Z