Iterative deepening search runs depth-limited search with gradually increasing depth ().

This aims to combine the space efficiency of DFS with BFS completeness. This re-expands nodes, but the cost is generally acceptable.

Properties:

  • Complete: Yes (assuming finite branching)
  • Optimal: Yes (assuming unit step costs)
  • Time:
  • Space:

We can see that this has the same asymptotic time as BFS, with space usage like DFS.

Why is IDS still worth it even with re-expansion? Consider the number of nodes expanded per iteration for the example above:

Thus, the total expansions performed by IDS until the goal is . The number of unique nodes explored is .

Thus, most re-expansion is done near the top of the tree (small depth), which is cheap. As depth grows, the number of nodes at depth dominates anyway. Furthermore, IDS keeps space like DFS (), not like BFS.