Graph visualizer
Depth-First Search
Explore deeply along each branch using a stack.
Best O(1)Average O(V + E)Worst O(V + E)Space O(V)
Example Graph
A-B, A-C, B-D, B-E, C-F, C-G, E-H, F-HVisualization
FrontierEmpty
CurrentFrontierVisitedFound
Metrics
Comparisons0
Visited0
Progress0%
Time taken0.0s
dfs(graph, start, target)stack = [start]visited = empty setwhile stack is not emptynode = stack.pop()check nodeif node == target: return nodemark node as visitedfor each unvisited neighborpush neighbor onto stackreturn not found