DFS: Edge classification in undirected graphs
Dependencies:
When DFS is performed on an undirected graph $G$, all edges are either tree edges or back edges.
Proof
Without loss of generality, assume visit(u)
is called before visit(v)
.
Therefore, $v$ was white when visit(u)
was called.
By the white path theorem $v$ will be a descendant of $u$ in $G_π$.
Therefore, in the directed version of $G$,
$(v, u)$ is a back edge and $(u, v)$ is either a tree edge or a forward edge.
By using precedence rules, we get that in the undirected graph $G$, $(u, v)$ is either a tree edge or a back edge.
Dependency for:
Info:
- Depth: 6
- Number of transitive dependencies: 12
Transitive dependencies:
- /sets-and-relations/equivalence-classes
- /sets-and-relations/relation-composition-is-associative
- /sets-and-relations/equivalence-relation
- Graph
- Transpose of a graph
- Path in Graph
- Rooted tree
- Forest
- Properties of DFS
- DFS: Edge classification
- DFS: Parenthesis theorem
- DFS: White-path theorem