This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
Unformatted text preview: CS 473: Algorithms, Fall 2009 HBS 1 1. a b c d e f g h Draw the DFS tree rooted at A for the above graph. Use alphabetic ordering to break ties. Label the vertices of the tree with their pre(v) : post(v) time. Add in the remaining edges of the graph and label them as forward (F), backward (B), and cross (C) edges. Sort the vertices by their post visit order. 2. Let G be a directed graph and G SCC its strong connected component metagraph (which is a DAG). Prove or disprove the following. For any DFS of G the vertex with smallest postvisit number is in a sink component of G SCC . 3. Let G = ( V,E ) be an undirected graph with n vertices (  V  = n ) and m edges (  E  = m ). Give an O ( n ) time algorithm to check if G has at least two distinct cycles and output them if it does. Assume that the graph is represented using adjacency lists. Note that m can be much larger than n so the algorithm should not check all edges. Hint: What is the structure of a minimal connected graph that has two cycles? Use DFS.of a minimal connected graph that has two cycles?...
View
Full
Document
This note was uploaded on 01/22/2011 for the course CS 473 taught by Professor Chekuri,c during the Fall '08 term at University of Illinois, Urbana Champaign.
 Fall '08
 Chekuri,C
 Algorithms

Click to edit the document details