Depth-First Search (DFS) Properties • • • • Non-optimal solution path Incomplete unless there is a depth bound Exponential time Linear space BFS Comments on Iterative Deepening Search • Complexity – Space complexity = O(bd) – Time Complexity • = O(bd) (i.e., asymptotically the same as BFS or DFS in the the worst case) • The overhead in repeated searching of the same subtrees is small relative to the overall time – e.g., for b=10, only takes about 11% more time than DFS • A useful practical method – combines • guarantee of finding an optimal solution if one exists (as in BFS) • space efficiency, O(bd) of DFS • But still has problems with loops like DFS Time requirements for depth-first iterative deepening on binary tree Nodes at each level Nodes searched by DFS Nodes searched by iterative DFS 1 1 1 2 +2 = 3 +3 = 4 4 +4 = 7 +7 = 11 8 +8 = 15 +15 = 26 16 +16 = 31 +31 = 57 32 +32 = 63 +63 = 120 64 +64 = 127 +127 = 247 +128 = 255 +255 = 502 128 12 Homework Example
© Copyright 2026 Paperzz