1 / 26

Depth-First Search (DFS) Properties

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

onella
Download Presentation

Depth-First Search (DFS) Properties

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Depth-First Search (DFS) Properties • Non-optimal solution path • Incomplete unless there is a depth bound • Exponential time • Linear space

  2. BFS

  3. 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

  4. Time requirements for depth-first iterative deepening on binary tree Nodes at each level 1 2 4 8 16 32 64 128 Nodes searched by DFS 1 +2 = 3 +4 = 7 +8 = 15 +16 = 31 +32 = 63 +64 = 127 +128 = 255 Nodes searched by iterative DFS 1 +3 = 4 +7 = 11 +15 = 26 +31 = 57 +63 = 120 +127 = 247 +255 = 502

  5. Homework

  6. Example

More Related