Redirected
retagged by
1,499 views
1 votes
1 votes

retagged by

2 Answers

5 votes
5 votes

The problem is Solved by Using Strongly Connected component by Calling DFS.

      Call DFS for each option according to there start and Finish time.(<U,V> meaning U is starting time and V is finish time  of vertex)

1)  <(1,6) (2,5) (3,4) (8,10)>:  This option having 2 connected    component as 1/6,2/5,3/4 and 8/10 so not connected graph

2)   <(6,7) (2,5) (3,4) (8,9)>: In this graph having 3 connected component like (2/5,3/4) as one component,(6/7) is second and (8/9) is third component so it also not connected graph.

3)  <(4,5) (2,8) (1,7) (3,6)>: In this graph is connected as having single connected component as 1/8,2/7,3/6,4/5.

4) <(7,8) (1,2) (5,6) (3,4)> : graph having 4 connected component as (1/2),(3/4),(5/6),(7/8).

option C is correct.

3 votes
3 votes
In DFS we will use stack and it is implemented as

option A:

First P will be discovered since it has the least discovery time

Now from P it will go to Q and then R and then R finishes at 4 and next Q finishes at 5 and P finishes at 6

In between there is no discovery of S so it cant be reached, So it is disconnected.

Option B:

It starts from Q and reches R and both gets finished . P and S are disconnected since they cant be reached.

Option C:

It starts from R and then Q and then S and then P So all can be reached. So connected.

Option D:

All are disconnected

Related questions

1 votes
1 votes
2 answers
4
Mojo-Jojo asked Jan 8, 2016
1,174 views
DFS