pub enum EdgeType {
Tree = 0,
Back = 1,
Forward = 2,
Cross = 3,
}
Expand description
The type of an edge in a DFS (depth-first search), as EdgeTypes classifies the edges of a
graph.
A depth-first search through all nodes reaches each node once, either by a tree edge or as the
root of a new search tree; the tree edges form the DFS forest. Every other edge gets its type from
where its target lies relative to its source in that forest, so each edge has exactly one type.
Edges::of collects the edges of one type.
An edge between two nodes of which neither is an ancestor of the other in the DFS forest: the
search had finished the target before it reached the source.