In a depth-first search of a directed graph, an arc is a tree edge if is the parent of ; a back edge if is an ancestor of in the forest, or itself; a forward edge if is a descendant of but not its child; a cross edge otherwise.
a, then at e; each vertex carries . The tree edges form two trees, rooted at a and e.