Concept Flow - Cycle Detection in Directed Graph
Start at each unvisited node
Mark node as visited and in recursion stack
For each neighbor
If neighbor not visited
→Recurse DFS on neighbor
If neighbor in recursion stack
→Cycle detected
After all neighbors checked
Remove node from recursion stack
Continue with next node or end
Start DFS from each node, track visited and recursion stack to detect back edges indicating cycles.