Loading algorithms…
Loading visualizer…
Explore as deep as possible along each branch before backtracking. Utilizes a LIFO stack or call stack recursion.
Depth-First Search (DFS) is an essential graph traversal algorithm that explores as far as possible along each branch before backtracking.
d[u], and mark it as visited.f[u].In DFS, each node u receives two integer timestamps:
• d[u]: The counter step when node u is first discovered.
• f[u]: The counter step when node u's adjacency list has been fully explored.
The interval [d[u], f[u]] forms a well-parenthesized nested structure used for topological sorting and cycle detection.
💡 Dynamic Graph Extension: You can add new nodes and custom edges to the graph using the + Add Node tool in the visualizer above!
Click nodes to set source/target · Toggle Iterative/Recursive mode · Use "+ Add Node" to extend graph topology