retagged by
568 views
1 votes
1 votes

Consider two vertices a and b that are simultaneously on the FIFO queue at same point during the execution of breadth first search from s in an undirected graph.
Which of the following is true?
1. The number of edges on the shortest path between s and a is atmost one more than the number of edges on the shortest path between s and b.
2. The number of edges on the shortest path between s and a is atleast one less than the number of edges on the shortest path between s and b.
3. There is a path between a and b.

     a.1 only

     b.1 and 2 only

     c. 2 only

     d. 1, 2 and 3

retagged by

1 Answer

0 votes
0 votes

Answer is D . All are true. 

BFS and DFS traversal are using for knowing the connected component of given graph.So , if a and b are in FIFO queue then must be a path between a and b. We can't say surely about the which one have more total edges then others because in a queue all are unvisited neighbour node of some node.   

Answer:

Related questions

1 votes
1 votes
2 answers
1
saptarshiDey asked Feb 1, 2019
857 views
What will be the path from A-H if BFS is used in the following graph?
0 votes
0 votes
2 answers
2
srestha asked Jun 30, 2018
899 views
How through a BFS we can find graph is connected or disconnected? Plz give some example and explain
0 votes
0 votes
0 answers
3
Tuhin Dutta asked Dec 12, 2017
370 views
Starting vertex is : $V_1$Find the BFS traversal sequence
0 votes
0 votes
1 answer
4
codingo1234 asked Nov 21, 2018
380 views
HOW CAN WE GET A CROSS EDGE WHILE PERFORMING A BFS ON UNDIRECTED AND DIRECTED GRAPH CAN ANYONE SHOW WITH AN EXAMPLE?