Question: Problem 3 ( Extra Credit + 3 0 points ) Given a directed graph, determine if it is strongly connected. A graph is Strongly Connected

Problem 3(Extra Credit +30 points)
Given a directed graph, determine if it is strongly connected. A graph is Strongly Connected if every node in the graph is reachable from every other node; that is, given any starting node, you can reach every other node in the graph.
Maximum time complexity: O(n3) Assumptions: None
Example1: Graph:
Input: An array of vertices and an array of edges Vertexes: {A, B, C, D}
Edges: {(A, B),(A, C),(B, D),(C, A),(D, A)} Output: Strongly Connected
Example 2: Graph:
Input: An array of vertices and an array of edges Vertexes: {A, B, C, D}
Edges: {(A, B),(B, D),(C, A),(D, A)} Output: Not Strongly Connected
Hints:
- You can solve this using an adjacency list or adjacency matrix, it is up to you which to
use
- You cannot assume if the graph is weighted or not, but weights actually do not matter in
this problem (we only care if a relation/edge exists, not what weight it may have)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!