Lecture05图算法课程.ppt

b a c d e f g h i j 1/8 6/7 3/4 2/5 c h j e i d b f a g b a c d e f g h i j c h j e i d b f a g 10/13 11/12 9/14 1/8 6/7 3/4 2/5 18/19 17/20 15/16 g f a b d c h i e j * * * * * * * * * * * * * * * * * * * * * * * * Lemma A directed graph G is acyclic iff a DFS of G yields no back edges: Forward: if G is acyclic, will be no back edges Trivial: a back edge implies a cycle Backward: if no back edges, G is acyclic Argue contrapositive: G has a cycle ? ? a back edge Let v be the vertex on the cycle first discovered, and u be the predecessor of v on the cycle When v disco

文档评论(0)

1亿VIP精品文档

相关文档