prev

next

of 28

View

35Download

0

Embed Size (px)

DESCRIPTION

Directed Acyclic Graph. DAG – directed graph with no directed cycles. Getting Dressed. Underwear. Socks. Watch. Pants. Shoes. Shirt. Belt. Tie. Jacket. Topological Sort. Linear ordering of the vertices of G, such that if ( u , v ) E, then u appears smewhere before v. - PowerPoint PPT Presentation

Directed Acyclic GraphDAG directed graph with no directed cycles

Getting DressedUnderwearSocksShoesPantsBeltShirtWatchTieJacket

Topological SortLinear ordering of the vertices of G, such that if (u,v)E, then u appears smewhere before v.

Getting DressedUnderwearSocksShoesPantsBeltShirtWatchTieJacketSocksUnderwearPantsShoesWatchShirtBeltTieJacket

Topological SortTopological-Sort (G)call DFS(G) to compute finishing times f [v] for all v Vas each vertex is finished, insert it onto the front of a linked listreturn the linked list of vertices

Time: (|V|+|E|).

Getting DressedUnderwearSocksShoesPantsBeltShirtWatchTieJacket1 |UndiscoveredActiveFinishedUnfinished

Getting DressedUnderwearSocksShoesPantsBeltShirtWatchTieJacket1 |2 |UndiscoveredActiveFinishedUnfinished

Getting DressedUnderwearSocksShoesPantsBeltShirtWatchTieJacket1 |2 |3 |UndiscoveredActiveFinishedUnfinished

Getting DressedUnderwearSocksShoesPantsBeltShirtWatchTieJacketJacket1 |2 |3 | 4UndiscoveredActiveFinishedUnfinished

Getting DressedUnderwearSocksShoesPantsBeltShirtWatchTieJacketTieJacket1 |2 | 53 | 4UndiscoveredActiveFinishedUnfinished

Getting DressedUnderwearSocksShoesPantsBeltShirtWatchTieJacketTieJacket6 |1 |2 | 53 | 4UndiscoveredActiveFinishedUnfinished

Getting DressedUnderwearSocksShoesPantsBeltShirtWatchTieJacketBeltTieJacket6 | 71 |2 | 53 | 4UndiscoveredActiveFinishedUnfinished

Getting DressedUnderwearSocksShoesPantsBeltShirtWatchTieJacketShirtBeltTieJacket6 | 71 | 82 | 53 | 4UndiscoveredActiveFinishedUnfinished

Getting DressedUnderwearSocksShoesPantsBeltShirtWatchTieJacketShirtBeltTieJacket6 | 71 | 82 | 53 | 49 |UndiscoveredActiveFinishedUnfinished

Getting DressedUnderwearSocksShoesPantsBeltShirtWatchTieJacketWatchShirtBeltTieJacket6 | 71 | 82 | 53 | 49 |10UndiscoveredActiveFinishedUnfinished

Getting DressedUnderwearSocksShoesPantsBeltShirtWatchTieJacketWatchShirtBeltTieJacket11 |6 | 71 | 82 | 53 | 49 |10UndiscoveredActiveFinishedUnfinished

Getting DressedUnderwearSocksShoesPantsBeltShirtWatchTieJacketWatchShirtBeltTieJacket11 |12 |6 | 71 | 82 | 53 | 49 |10UndiscoveredActiveFinishedUnfinished

Getting DressedUnderwearSocksShoesPantsBeltShirtWatchTieJacketWatchShirtBeltTieJacket11 |12 |6 | 713 |1 | 82 | 53 | 49 |10UndiscoveredActiveFinishedUnfinished

Getting DressedUnderwearSocksShoesPantsBeltShirtWatchTieJacketShoesWatchShirtBeltTieJacket11 |12 |6 | 713 |141 | 82 | 53 | 49 |10UndiscoveredActiveFinishedUnfinished

Getting DressedUnderwearSocksShoesPantsBeltShirtWatchTieJacketPantsShoesWatchShirtBeltTieJacket11 |12 |156 | 713 |141 | 82 | 53 | 49 |10UndiscoveredActiveFinishedUnfinished

Getting DressedUnderwearSocksShoesPantsBeltShirtWatchTieJacketUnderwearPantsShoesWatchShirtBeltTieJacket11 | 1612 |156 | 713 |141 | 82 | 53 | 49 |10UndiscoveredActiveFinishedUnfinished

Getting DressedUnderwearSocksShoesPantsBeltShirtWatchTieJacketUnderwearPantsShoesWatchShirtBeltTieJacket11 | 1612 |156 | 713 |1417 |1 | 82 | 53 | 49 |10UndiscoveredActiveFinishedUnfinished

Getting DressedUnderwearSocksShoesPantsBeltShirtWatchTieJacketSocksUnderwearPantsShoesWatchShirtBeltTieJacket11 | 1612 |156 | 713 |1417 | 181 | 82 | 53 | 49 |10UndiscoveredActiveFinishedUnfinished

Strongly-ConnectedGraph G is strongly connected if, for every u and v in V, there is some path from u to v and some path from v to u.

Strongly ConnectedNot Strongly Connected

A strongly connected component (SCC) of G is a maximal set of vertices C V such that for all u, v C, both u v and v u exist.

Strongly Connected Components

GSCC=(VSCC, ESCC): one vertex for each component(u, v) ESCC if there exists at least one directed edge from the corresponding components

Graph of Strongly Connected Components

GSCC has a topological ordering

Graph of Strongly Connected Components

Kinds of Edges1 |128 |1113|1614|155 | 63 | 42 | 79 |10source vertexd fTree edgesBack edgesForward edgesCross edgesBFCCCCCC