subgraph that is strongly connected. That is all vertices in a strong component can reach each other, and any other vertex in the directed graph either cannot reach the strong component or cannot be reached from the component. (Note that we are considering
5. (This question goes slightly beyond what was covered in the lectures, but you can solve it by combining algorithms that we have described.)
A directed graph is said to be strongly connected if every vertex is reachable from every other vertex; i.e., for every pair of vertices u, v, there is a directed path from u to v and a directed path from v to u.
A strong component of a graph is then a maximal subgraph that is strongly connected. That is all vertices in a strong component can reach each other, and any other vertex in the directed graph either cannot reach the strong component or cannot be reached from the component.
(Note that we are considering directed graphs, so for a pair of vertices u and v there could be a path from u to v, but no path path from v back to u; in that case, u and v are not in the same strong component, even though they are connected by a path in one direction.)
-
Given a vertex v in a directed graph D, design an
algorithm for com- puting the strong connected component containing the vertex v. Give a high-level description of the algorithm, in terms of ADTs and algo- rithms described in the lectures. (For full marks, the algorithm should run it time O(n + m), where n is the number of vertices and m is the number of edges of D.) -
It is well known that strong connected components partition the ver- tices of a graph. Describe how to extend your algorithm of part 1 to an algorithm for computing all the strong connected components of a directed graph. (Only a high-level description is required.)
Trending now
This is a popular solution!
Step by step
Solved in 2 steps