Proof

  1. Each depth-first tree found in DFS is a SCC

  2. Let , be distinct SCC of

  3. Define max_finish(C) = max{finish_time(u) | u in C}

  4. If some vertex has an edge in to some then:

  5. max_finish(C) > max_finish(C')

    1. discovered earlier - will go from to then finish then back to finish
    2. discovered earlier - finished without visiting because no path from to
  6. In if some vertex has an edge to some , then max_finish(C) > max_finish(C')

  7. If max_finish(C) > max_finish(C') then in no edge from to

  8. DFS

    1. Start vertex , with largest max_finish(C) of all SCC
    2. Visit all vertices reachable from
    3. has no edge from to another SCC
    4. never visit another SCC
    5. Select another start vertex with largest max_finish(C) of all SCC except for