Question
Implement the algorithm to find Strongly Connected Components (SCC) in a directed graph. This will also require implementing Depth First Search and modifying DFS to
Implement the algorithm to find Strongly Connected Components (SCC) in a directed graph. This will also require implementing Depth First Search and modifying DFS to be able to modify the search order at the top level as required by SCC. Your program will read a graph description from a file. The graph will have n vertices, with vertices numbered from 1 to n. The first line of the file will contain a single integer value, n which is the number of vertices. Each line after that will contain a pair of integers specifying a directed edge of the graph; the first integer is the source vertex number for the edge, the second integer is the destination vertex number for the edge. You should read all the edges from the file and use them to build an Adjacency List representation of the graph. Your program should be able to handle a graph with an arbitrary number of vertices and edges. For this programming assignment, you must implement the Graph Adjacency List representation, DFS, Graph Transpose, and SCC algorithms yourself.
You can use any language. But java or python is preferable.
This assignment is worth 15% of your marks in the subject. Implement the algorithm to find Strongly Connected Components (SCC) in a directed graph. This will also require implementing Depth First Search and modifying DFS to be able to modify the search order at the top level as required by SCC. Your program will read a graph description from a file. The graph will have a vertices, with vertices numbered from 1 to n. The first line of the file will contain a single integer value, which is the number of vertices. Each line after that will contain a pair of integers specifying a directed edge of the graph; the first integer is the source vertex number for the edge, the second integer is the destination vertex number for the edge. You should read all the edges from the file and use them to build an Adjacency List representation of the graph. Your program should be able to handle a graph with an arbitrary number of vertices and edges. For this programming assignment, you must implement the Graph Adjacency List representation, DFS, Graph Transpose, and SCC algorithms yourself Input (input.txt): 12 12 23 24 25 36 45 47 52 56 57 63 68 78 7 10 87 97 109 10 11 11 12 12 10 10 12 CSE 373 Programming Assignment Fall 2021 Output: 1 245 36 7 8 9 10 11 12Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started