Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed

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 12

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Machine Learning And Knowledge Discovery In Databases European Conference Ecml Pkdd 2015 Porto Portugal September 7 11 2015 Proceedings Part 3 Lnai 9286

Authors: Albert Bifet ,Michael May ,Bianca Zadrozny ,Ricard Gavalda ,Dino Pedreschi ,Francesco Bonchi ,Jaime Cardoso ,Myra Spiliopoulou

1st Edition

3319234609, 978-3319234601

More Books

Students also viewed these Databases questions

Question

=+Are the contracts enforceable?

Answered: 1 week ago