The Iterative Deepening Algorithm
The Iterative Deepening Algorithm
This search
algorithm finds out the best depth limit and does it by gradually increasing the limit until a
goal is found.
This algorithm performs depth-first search up to a certain "depth limit", and it keeps
increasing the depth limit after each iteration until the goal node is found.
This Search algorithm combines the benefits of Breadth-first search's fast search and depth-
first search's memory efficiency.
The iterative search algorithm is useful in uninformed search when search space is large,
and depth of goal node is unknown.
Advantages: It combines the benefits of BFS and DFS search algorithm in terms of fast
search and memory efficiency.
Disadvantages: The main drawback is that, it repeats all the work of the previous phase.
(The main drawback of IDDFS is that it repeats all the work of the previous phase.)
Example: Following tree structure is showing the iterative deepening depth-first search.
IDDFS algorithm performs various iterations until it does not find the goal node.
The iteration performed by the algorithm is given as:
1st iteration : d=0 [A]
2st iteration : d=0+1=1 [A-B-C]
3st iteration : d=1+1=2 [A-B-C-D-E-F-G]
Completeness: This algorithm is complete is if the branching factor is finite.
Time Complexity: Let's suppose b is the branching factor and depth is d then the worst-case
time complexity is O(bd ).
Space Complexity: The space complexity of IDDFS will be O(bd).
Optimal: IDDFS algorithm is optimal if path cost is a non- decreasing function of the depth of
the node.