depth-first search (dfs)
Depth-first search (DFS) is a graph traversal algorithm that explores vertices of a graph by prioritizing the deepest unexplored paths. It starts at a given vertex, and then follows each path as far as possible before backtracking. This algorithm uses a stack to maintain the visiting order and keeps track of visited vertices to avoid cycles. DFS is primarily used for graph traversals and can be employed to solve problems such as finding connected components, detecting cycles, and searching for specific nodes or paths within a graph.
Requires login.
Related Concepts (1)
Similar Concepts
- breadth-first search
- breadth-first search (bfs)
- depth-first search
- depth-limited search
- directory traversal
- in-order traversal
- in-order traversal of binary trees
- inorder traversal
- iterative tree traversal
- path traversal
- post-order traversal
- postorder traversal
- recursive tree traversal
- tree recursion
- tree traversal