5 questions to test your understanding
During a DFS-based cycle detection on a directed graph, the algorithm follows an edge and arrives at a vertex that has already been completely processed (colored black). What should the algorithm conclude?
Why is a two-color scheme (visited / unvisited) insufficient for cycle detection in directed graphs?
In DFS-based cycle detection on a directed graph, discovering a back edge (an edge pointing to a gray vertex) is both a necessary and sufficient condition for the graph to contain a cycle.
If DFS encounters an edge to a fully-processed (black) vertex, this indicates a cycle exists in the directed graph.
Explain why encountering a gray vertex during DFS indicates a cycle, while encountering a black vertex does not, and why this distinction requires three colors rather than two.