Back Edge Or Cross
Directed graph with edges 1→2, 1→3, 2→4, 3→4, 4→2. DFS starts at 1 and takes neighbours in increasing order. A clock ticks once per entry and once per exit:
| vertex | pre | post |
|---|---|---|
| 1 | 1 | 8 |
| 2 | 2 | 5 |
| 3 | 6 | 7 |
| 4 | 3 | 4 |
The tree edges are 1→2, 2→4, 1→3. Exactly one of the two remaining edges proves the graph contains a directed cycle. Which one, and what in the table proves it?
Sign in to answer questions and track your progress
Sign In