Iterative Deepening Depth-First Search (IDDFS) is a search algorithm that combines the benefits of both Depth-First Search (DFS) and Breadth-First Search (BFS). It is particularly useful in scenarios where the depth of the search tree is unknown and the solution could be located at any level. In thi...
Iterative Deepening Depth-First Search (IDDFS) is a search algorithm that combines the benefits of both Depth-First Search (DFS) and Breadth-First Search (BFS). It is particularly useful in scenarios where the depth of the search tree is unknown and the solution could be located at any level. In this detailed explanation, we'll explore the various aspects of IDDFS, including its motivation, implementation, advantages, disadvantages, and applications.
Size: 1.69 MB
Language: en
Added: Aug 09, 2024
Slides: 13 pages
Slide Content
NAME: VIVEK MAJUMDAR
SUBJECT: ARTIFICIAL INTELLIGENCE
COURSE: B-TECH
SEM: V
SEC: B
ROLL NO: 11900122094
YEAR: 2024-25
DEPARTMENT: COMPUTER SCIENCE & ENGINEERING
1
IDDFS ALGORITHM
Overview:
IDDFS involves running a series of depth-limited depth-first searches, increasing the depth limit
incrementally until the goal is found or all nodes are explored.
Steps of the Algorithm:
1.Initialize Depth Limit: Start with a depth limit of 0.
2.Perform Depth-Limited DFS:
a)Use DFS to explore nodes up to the current depth limit.
b)If the goal node is found, terminate the search.
c)If not found, return to the root node.
3.Increment Depth Limit: Increase the depth limit by one.
4.Repeat: Continue until the goal is found or all possible nodes have been explored.
6
DISADVANTAGES
oThe time taken is exponential to reach the goal node.
oThe main problem with IDDFS is the time and wasted calculations that take place at
each depth.
oThe situation is not as bad as we may think of especially when the branching factor is
found to be high.
oThe IDDFS might fail when the BFS fails. When we are to find multiple answers from
the IDDFS, it gives back the success nodes and its path once even if it needs to be
found again after multiple iterations. To stop the depth bound is not increased further.
8
TIME & SPACE COMPLEXITY
Depth-First Search (DFS):
Time Complexity: O(b^m)
•b is the branching factor (average number of
child nodes per node).
•m is the maximum depth of the search tree.
Breadth-First Search (BFS):
Time Complexity: O(b^d)
•d is the depth of the shallowest solution.
Iterative Deepening Depth-First Search (IDDFS):
Time Complexity: O(b^d)
•Althoughitrepeatedlyvisitsnodes,thenumber
ofvisitsdoesnotchangetheasymptotic
complexitycomparedtoBFS,
Depth-First Search (DFS):
Space Complexity:O(b×m)
Breadth-First Search (BFS):
Space Complexity: O(b^d)
Iterative Deepening Depth-First Search (IDDFS):
Space Complexity: O(b×d)
9