0% found this document useful (0 votes)
125 views10 pages

Iterative Deepening

Iterative deepening depth first search (IDDFS) is a hybrid search algorithm that combines depth-first search (DFS) and breadth-first search (BFS). IDDFS performs DFS repeatedly, each time increasing the maximum search depth. This allows it to find solutions faster than DFS while using less memory than BFS. The example shows performing IDDFS on a tree by incrementing the depth limit from 0 to 4 and tracing the DFS path at each limit. IDDFS has the same time complexity as DFS and BFS but uses less memory than BFS.

Uploaded by

Supranya Gupta
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
125 views10 pages

Iterative Deepening

Iterative deepening depth first search (IDDFS) is a hybrid search algorithm that combines depth-first search (DFS) and breadth-first search (BFS). IDDFS performs DFS repeatedly, each time increasing the maximum search depth. This allows it to find solutions faster than DFS while using less memory than BFS. The example shows performing IDDFS on a tree by incrementing the depth limit from 0 to 4 and tracing the DFS path at each limit. IDDFS has the same time complexity as DFS and BFS but uses less memory than BFS.

Uploaded by

Supranya Gupta
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 10

Iterative Deepening

Introduction
• Iterative deepening depth first search (IDDFS)
is a hybrid of BFS and DFS. In IDDFS, we
perform DFS up to a certain “limited depth,”
and keep increasing this “limited depth” after
every iteration.
Limitations of DFS & BFS
• In DFS, you would recursively look at a node’s
adjacent vertex. DFS may not end in an infinite
search space. Also, DFS may not find the shortest
path to the goal. DFS needs O(d) space, where d is
depth of search.
• BFS consumes too much memory. BFS needs to
store all the elements in the same level. In the case
of a tree, the last level has N / 2 leaf nodes, the
second last level has N / 4. So, BFS needs O(N)
space.
Example
• Our starting node (A) is at a depth of 0. Our goal
node (R) is at a depth of 4. The above example is a
finite tree, but think of the above tree as an
infinitely long tree and only up to depth = 4 is
shown in the diagram.
• As stated earlier, in IDDFS, we perform DFS up to a
certain depth and keep incrementing this allowed
depth. Performing DFS upto a certain allowed
depth is called Depth Limited Search (DLS).
Explanation
• Let us understand DLS, by performing DLS on
the above example. In Depth Limited Search,
we first set a constraint on how deep (or how
far from root) will we go. Let’s say our limit
(DEPTH) is 2. By looking at the rest of the
nodes, DFS would be as follows –

• ABEFCGDH
Similarly
DEPTH DLS traversal

0 A

1 ABCD

2 ABEFCGDH

3 ABEIFJKCGLDHMN

4 ABEIFJKOPCGLRDHMNS
Space complexitY
Time complexity
DFS O(bd) O(d)
BFS O(bd) O(bd)
IDDFS O(bd) O(bd)
Iterative deepening A*
• iterative deepening A* (IDA*) is a graph traversal and path
search algorithm that can find the shortest path between a
designated start node and any member of a set of goal
nodes in a weighted graph. It is a variant of iterative
deepening depth-first search that borrows the idea to use a
heuristic function to evaluate the remaining cost to get to
the goal from the A* search algorithm. Since it is a depth-
first search algorithm, its memory usage is lower than in A*,
but unlike ordinary iterative deepening search, it
concentrates on exploring the most promising nodes and
thus does not go to the same depth everywhere in the
search tree. Unlike A*, IDA* does not utilize dynamic
programming and therefore often ends up exploring the
same nodes many times.
Water Jug Problem

You might also like