Question: (20 pts.) BFS on Directed Graph. Consider a directed graph G = (V, E). Depth first search allows us to label edges as tree,
(20 pts.) BFS on Directed Graph. Consider a directed graph G = (V, E). Depth first search allows us to label edges as tree, forward, back and cross edges. We can make similar definitions for breadth first search on a directed graph: 1. A BFS tree edge is an edge that is present in the BFS tree. 2. A BFS forward edge leads from a node to a non-child descendant in the BFS tree. 3. A BFS back edge leads to an ancestor in the BFS tree. 4. All other edges are BFS cross edges. (a) Explain why it is impossible to have BFS forward edges. (b) Give an efficient algorithm that classifies all edges in G as BFS tree edges, back edges, or cross edges.
Step by Step Solution
There are 3 Steps involved in it
a It is impossible to have BFS forward edges in a directed graph during a standard breadthfirst search BFS This is because BFS explores nodes level by ... View full answer
Get step-by-step solutions from verified subject matter experts
