1,601 views

3 Answers

1 votes
1 votes

Answer would be b) (d,b)

You can find meaning of cross edge (for BFS on undirected graph)  here. Usually cross edges are used in context of Depth First Search Forest.

Since edge (d,b) is present in the breadth first search tree, it can't be cross edge (according to the meaning in the given link).

Following is the breadth first tree:

reshown by
1 votes
1 votes

algorithm to detect cross edge and tree edge : 

Algorithm BFS(Vertex s
// iterative algorithm

initialize container L0, level, to contain vertex s 
i = 0 
while Li is not empty do {
create container Li+1 to initially be empty      // next level 
for each vertex v in Li do      // vertices in previous level
for each edge e incident on v do
if edge e is unexplored then
let w be the other end of e 
if vertex w is unexplored then 
    label e a discovery edge and  insert w into Li+1 
else 
    label e as a cross edge
i = i + 1
} //
So we can say that in case of bfs  with undirected  graph , the edge which are not including in the tree are cross edge.
So B will be the answer  , because bfs  tree contains : { (a-c) , ( a-d) , (a-e) ,  (c - f) ,  ( d - b ) }  all this mentioned edges would be tree edges.

Related questions

0 votes
0 votes
1 answer
1
0 votes
0 votes
0 answers
2
1 votes
1 votes
1 answer
4