COMP 5481 Lab 8

$30.00

Category: You will Instantly receive a download link for .zip solution file upon Payment || To Order Original Work Click Custom Order?

Description

5/5 - (6 votes)

Problem Description:
Write a Java program that receives a directed graph as input and determines the strongly
connected components. A directed graph is strongly connected if there is a path between all
pairs of vertices.
Input: The first two lines of input determines number of vertices V and number of edges E,
respectively in the graph. The next E lines indicate the connectivity between vertices.
Output: Output will show the strongly connected components in input graph as given in the
test case format. The components themselves must be sorted.
Test Case Input Output
1 6
7
1 4
1 5
0 4
4 2
3 1
5 3
2 0
[1, 3, 5]
[0, 2, 4]
2 7
10
2 3
0 2
6 3
1 2
3 4
3 5
0 1
1 3
0 3
5 6
[0] [1]
[2]
[3, 5, 6]
[4]