Which of the following is the correct decomposition of the directed graph given below into its strongly connected components?
A
{P, Q, R, S}, {T}, {U}, {V}
No worries! We‘ve got your back. Try BYJU‘S free classes today!
B
{P, Q, S, T, V}, {R}, {U}
No worries! We‘ve got your back. Try BYJU‘S free classes today!
C
{P, Q, R, S, T, V}, {U}
Right on! Give the BNAT exam to get a 100% scholarship for BYJUS courses
D
{P, Q, R, S, T, U, V}
No worries! We‘ve got your back. Try BYJU‘S free classes today!
Open in App
Solution
The correct option is C {P, Q, R, S, T, V}, {U} To find strongly connected component apply DFS on graph and find longest cycle. If you find a cycle in the reverse direction of every edge and again apply the DFS, if you found cycle this time also. Then this cycle is strongly connected component.
Now change direction of every edge
So, 2 strongly connected components {P, Q, V, T, S, R} and {U} are present.