lecture5 - CS 473: Algorithms Chandra Chekuri...

Info iconThis preview shows pages 1–17. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: CS 473: Algorithms Chandra Chekuri chekuri@cs.illinois.edu 3228 Siebel Center University of Illinois, Urbana-Champaign Fall 2009 Chekuri CS473ug Strong Connected Components (SCCs) A B C D E F G H Algorithmic Problem Find all SCCs of a given directed graph. Previous lecture: saw an O ( n ( n + m )) time algorithm. This lecture: O ( n + m ) time algorithm. Chekuri CS473ug Graph of SCCs A B C D E F G H Figure: Graph G B , E , F G H A , C , D Figure: Graph of SCCs G SCC Meta-graph of SCCs Let S 1 , S 2 , . . . S k be the SCCs of G . The graph of SCCs is G SCC Vertices are S 1 , S 2 , . . . S k There is an edge ( S i , S j ) if there is some u S i and v S j such that ( u , v ) is an edge in G . Chekuri CS473ug Reversal and SCCs Proposition For any graph G, the graph of SCCs of G rev is the same as the reversal of G SCC . Proof. Exercise. Chekuri CS473ug SCCs and DAGs Proposition For any graph G, the graph G SCC has no directed cycle. Chekuri CS473ug SCCs and DAGs Proposition For any graph G, the graph G SCC has no directed cycle. Proof. If G SCC has a cycle S 1 , S 2 , . . . , S k then S 1 S 2 S k is an SCC in G . Formal details: exercise. Chekuri CS473ug Part I Directed Acyclic Graphs Chekuri CS473ug Directed Acyclic Graphs Definition A directed graph G is a directed acyclic graph (DAG) if there is no directed cycle in G . 1 2 3 4 Chekuri CS473ug Sources and Sinks source sink 1 2 3 4 Definition A vertex u is a source if it has no in-coming edges. A vertex u is a sink if it has no out-going edges. Chekuri CS473ug Simple DAG Properties Every DAG G has at least one source and at least one sink. Chekuri CS473ug Simple DAG Properties Every DAG G has at least one source and at least one sink. If G is a DAG if and only if G rev is a DAG. Chekuri CS473ug Simple DAG Properties Every DAG G has at least one source and at least one sink. If G is a DAG if and only if G rev is a DAG. G is a DAG if and only each node is in its own strong component. Chekuri CS473ug Simple DAG Properties Every DAG G has at least one source and at least one sink. If G is a DAG if and only if G rev is a DAG. G is a DAG if and only each node is in its own strong component. Chekuri CS473ug Simple DAG Properties Every DAG G has at least one source and at least one sink. If G is a DAG if and only if G rev is a DAG. G is a DAG if and only each node is in its own strong component. Formal proofs: exercise. Chekuri CS473ug Topological Ordering/Sorting 1 2 3 4 Figure: Graph G 1 2 3 4 Figure: Topological Ordering of G Definition A topological ordering/sorting of G = ( V , E ) is an ordering < on V such that if ( u , v ) E then u < v . Chekuri CS473ug DAGs and Topological Sort Lemma A directed graph G can be topologically ordered iff it is a DAG....
View Full Document

Page1 / 95

lecture5 - CS 473: Algorithms Chandra Chekuri...

This preview shows document pages 1 - 17. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online