Depth-limited search is depth-first search with a depth bound . The motivation behind is that DFS can get stuck in infinitely deep paths, or cycles/loops.

The rule is just to expand like DFS, but do not expand beyond depth . Thus, DLS finds a solution only if the goal depth . Otherwise, it returns cutoff/failure even if a solution might exist.

Properties:

  • Terminates (always)
  • Complete if a solution exists within the bound .
  • Not optimal (can return a deeper/higher cost solution)

Complexity:

  • Time:
  • Space: (linear in depth)

If , DLS may waste effort compared to BFS.