Depth-First Search Algorithm: Maqsood Ahmad
Depth-First Search Algorithm: Maqsood Ahmad
Algorithm
Maqsood Ahmad
Graph Traversal Algorithm
• DFS in data structure have played a crucial role in searching for DFS trees and graph designs.
• The DFS algorithm has proven to be extremely important in studying data structures.
• This algorithm follows the backtracking principle for performing exhaustive searches of
multiple nodes by backtracking as and when required and moving forward when possible.
• Depth-limited search can solve the drawback of the infinite path in the Depth-
first search. In this algorithm, the node at the depth limit will treat as it has no
successor nodes further.
Depth-Limited Search Algorithm
Depth-limited search can be terminated with two Conditions of failure:
Standard failure value: It indicates that problem does not have any solution.
Cutoff failure value: It defines no solution for the problem within a given depth
limit.
Advantages:
Depth-limited search is Memory efficient.
Disadvantages:
Depth-limited search also has a disadvantage of incompleteness.
It may not be optimal if the problem has more than one solution.