edited by
2,663 views

3 Answers

4 votes
4 votes

Max possible height corresponds to the spanning tree generated by the BFS of the complete bipartite graph Km,n ..

Say we have  {v1 , v2 , v3 ......., vm}  in one partition of vertices and { t1 , t2 , ....... , tn } in the other vertex set..

So DFS can be done as selecting vertex from one of the sets alternately..So say we start DFS from v1 , then we reach to t1 from v1 , then to v2 from t1 , then to t2 from v2 and so on..

This way we will have max height  =  number of edges [ because in each step we are traversing to a descendent not sibling ]

                                           =  m + n - 1   [ As number of vertices  =  m + n ]

Hence max height possible as far as DFS tree is concerned    =  m + n - 1.. 

For BFS, we can take one vertex in v1.. Now after that we push all its neighbors in the queue  which are in the vertex set 2..All of them will be pushed as it is a complete bipartite graph.. Hence max height in this case = 1.

edited by
0 votes
0 votes

max height of BFS tree traversal, if BFS is run on a complete bipartite graph(  ) should be 2 only bcoz it can be patitioned into two group of vertices.

0 votes
0 votes
Answer for BFS is 2 because bipartite is divided into two set of disjoints therefore each level is required to show each set of disjoints.

Related questions

2 votes
2 votes
1 answer
2
4 votes
4 votes
0 answers
3
Na462 asked Aug 21, 2018
3,852 views
Which of following statement is true ?A. In BFS of UDG there are no back edges and forward edges.B. In BFS of Directed Graph there is no back edge and forward edges.C. In...
0 votes
0 votes
0 answers
4