Concept Flow - Cycle Detection in Undirected Graph
Start at any node
Mark node as visited
For each neighbor
If neighbor not visited
Recurse DFS on neighbor
If cycle found, return True
If neighbor visited and not parent
Cycle detected! Return True
All neighbors checked, no cycle
Return False
Start DFS from any node, mark visited, explore neighbors. If a visited neighbor is not parent, cycle exists.
