Depth-first search (DFS) is an algorithm for traversing or searching a tree, tree structure, or graph. One starts at the root (selecting some node as the root in the graph case) and explores as far as possible along each branch before backtracking.

- Wiki
2 articles, 0 books.

Depth-first search is a simple way, to explore a graph.

There are two fundamental ways of graph search, which are the breadth-first search and the depth-first search. In this post, I’ll explain the depth-first search. Here, I focus on the relation between the depth-first search and a topological sort.