For Algorithms using C programming
Due August 10, 2018 Goals: I. Understanding of Warshall's algorithm. 2. Understanding of strongly connected components. Requirements: 1. Write a program, based on Warshall's algorithm with successors, to find a leader for each strongly connected component of a directed graph. The leader of a strongly connected component is the smallest numbered vertex appearing in that SCC. The input will be formatted as follows a. The first line will contain an integer V giving the number of vertices. V will not exceed 50. b. Tail and head for each edge, one edge per line. The tail and head will be in the range 0... v 1. c. A line with -1 -1. 2. Your program's output for each vertex i will be either 1) the fact that vertex i is a leader or 2) a path from vertex i to its leader and a path from the leader to vertex i. intermediate matrices from your Warshall-based technique. Your program must also output the 3. Submit your program source file on Blackboard by 5:00 pm on Friday, August 10. One of the comment lines should include the compilation command used on OMEGA Getting Started: 1. Review Warshall's algorithm with successors. Also, consider the usual transitivity diagram and how 2. Test files are available on the course web page. Other cases may be used when your submissions ane 3. Since SCCs treat the graph as being reflexive (e.g. self-loops), each diagonal entry A[ ] [ i ] is it relates to this problem. checked. initialized to i. If there is an edge from i to j (il-), then Afi]13] is initialized to min(i,j). If there is no edge from i to j , then A [ i ] [ j ] s initialized to-1 (or some other value depending on your code). Based on this initialization, Warshall's algorithm may be modified to terminate with the leader for the SCC of vertex i stored at A[i]Ii]. 4. 5. Your code must execute in 6. Static allocation (i.e. no mallocs) is allowed 7. time. You may modify http://ranger.uta.edu/-veens/NOTES2320/warshall.e to do this assignment