DFS - Depth First Search
DFS algorithm is exploring every path all the way to the leaf of the graph. As in other graph algorithms, we keep track of the nodes that were already explored to prevent cycling.
When choosing DFS, it is useful to consider the width and depth of the graph. If the graph is very wide and solutions are frequent, DFS could be the right choice. On the other hand, if the graph is very deep choosing the BFS can be better option.
Applications:
- path finding
- discovering the longest path
- cycling detection