Cycle Detection (DFS)
Detect cycles in a directed graph using Depth-First Search. If DFS encounters a back-edge to a node currently in the active recursion stack, a cycle is confirmed.
0
Total Nodes
0
Total Edges
0
Visited Nodes
No Cycle
Cycle Status
DFS CYCLE DETECTION
💡 Editor Guide: Click empty space to add a node. Click and drag between nodes to connect them with a directed edge.
Execution Log
Click Load Cyclic Graph or draw your own, then start DFS.
🛠️ Presets
🎨 Legend
In active recursion stack
Visited / Finished exploring
Active node / Checking back-edge
⚡ Time Complexity
DFS cycle detection operates in O(V + E) time. Uses O(V) extra memory for the visited array and recursion stack.