$./dfs
graph:
start:
2 step/s
# algorithm
1DFS(G, s)
2begin
3 visited[s]true; time++
4 d[s]time
5 for each vadj(s) do
6 if not visited[v] then
7 DFS(G, v) // recurse
8 time++; f[s]time
9end
# graph visualization
ABCDEFG
current exploring in stack visited d/f time
click a node to set as start, or drag to reposition
# stack (recursion)
run to begin...
# variables
current
exploring
time
# discovery / finish times
nodediscoveryfinish
# current action
select a start node and click "run" to begin...