|
CS 3343/3341 Analysis of Algorithms Spring 2012 Recitation 10 Graph Search Week 11: Apr 03-Apr 05 Due (on time): 2012-04-09 23:59:59 Due (late): 2012-04-13 23:59:59 |
Recitation 10 should be submitted following directions at:
submissions with deadlines
|
"Exercise 22.4-5, page 615: Another way to perform topological sorting on a directed acyclic graph G = (V, E) is to repeatedly find a vertex of in-degree 0, output it, and remove it and all its outgoing edges from the graph. Explain how to implement this idea so that it runs in time O(V + E). What happens to this algorithm if G has cycles?" [Here "in-degree" of a given vertex means the number of edges coming into the vertex.]