some_solns2 - u be the vertex on C which precedes v u v C...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
CMPS 101 Midterm 2 review One solution Problem 7 from the review sheet: Let G be a directed graph. Prove that if G contains a directed cycle, then G contains a back edge. (Hint: use the white path theorem.) Proof: Suppose G contains a directed cycle, call it C . Let v be the first vertex on C to be discovered by DFS, and let
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: u be the vertex on C which precedes v . u v C Since no vertex on C is discovered before v , at the time of discovery of v the vertices of C form a path from v to u consisting of white vertices. By the white-path theorem, u becomes a descendent of v in some DFS tree. Therefore ( u , v ) is a back edge. ///...
View Full Document

Ask a homework question - tutors are online