Three-Color DFS States Visualization

In this visualization, we demonstrate how Depth-First Search (DFS) uses three colors to track vertex states:

A cycle is detected when DFS encounters a gray vertex again during traversal.

White (Unvisited)
Gray (In Process)
Black (Completed)
Step 1 of 1
Initialize the graph with all vertices colored white (unvisited).