



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Main points of this exam paper are: Connected Components, Strongly Connected, Earliest Nu, Topologically, Topologically Sort, Another Pass, Number Assigned, Numbers Generated, Post Numbers, Partial Credit
Typology: Exams
1 / 5
This page cannot be seen from the preview
Don't miss anything!




Problem 1 (20 Points)
a) Run the Strongly Connected Components (SCC) algorithm on the following graph. Show the pre and post numbers for both passes of DFS. Where there are several choices of vertex to start at or edges to follow, go to the vertex that occurs earliest numerically.
b) How can we topologically sort the SCCs without running another pass of DFS? Assume you still have all the information generated by the SCC algorithm available, including pre and post numbers generated during each pass of DFS, and the SCC number assigned to each vertex.
Problem 2 (24 Points)
True or False? No explanation required except for partial credit. Each correct answer is worth 2 points, but 2 points will be subtracted for each wrong answer, so answer only if you are reasonable certain.
Problem 4 (18 Points)
Let T be a MST in the weighted graph G(V, E). Let G’(V’, E’) be a graph obtained by removing one vertex u from G (so that V’ = V – {u}), and by removing all the edges incident on u. Let e ∈ E any edge of T not incident on u. Prove that there is an MST of G’ that contains e. Hint: the cut property says:
Let X ⊆ T where T is a Minimum Spanning Tree (MST) in the weighted graph G(V, E). Let S ⊂ V such that no edge in X crosses between S and V – S; i.e. no edge in X has one endpoint in S and one endpoint in V – S. Among the edges crossing between S and V – S, let e be an edge of minimum weight. Then X ∪ {e} ⊆ T’ where T’is a MST in G(V, E).
Partial Answers to Problem 2