. When a back edge has been found, the cyclic ancestor of the cycle is the destination vertex of that back edge. Consequently if the destination of a tree edge has a cyclic ancestor, then that tree edge is part of the cycle. Subsequently the source vertex's cyclic ancestor is that of the destination vertex. From this it can be recursively determined that if a vertex has a path through a cyclic ancestor back to itself, then the edges on that path are part of a directed cycle.
|
|
|