depth-first search (dfs) properties
DESCRIPTION
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 - PowerPoint PPT PresentationTRANSCRIPT
![Page 1: Depth-First Search (DFS) Properties](https://reader034.vdocuments.us/reader034/viewer/2022050819/56814a9f550346895db7af63/html5/thumbnails/1.jpg)
![Page 2: Depth-First Search (DFS) Properties](https://reader034.vdocuments.us/reader034/viewer/2022050819/56814a9f550346895db7af63/html5/thumbnails/2.jpg)
![Page 3: Depth-First Search (DFS) Properties](https://reader034.vdocuments.us/reader034/viewer/2022050819/56814a9f550346895db7af63/html5/thumbnails/3.jpg)
![Page 4: Depth-First Search (DFS) Properties](https://reader034.vdocuments.us/reader034/viewer/2022050819/56814a9f550346895db7af63/html5/thumbnails/4.jpg)
![Page 5: Depth-First Search (DFS) Properties](https://reader034.vdocuments.us/reader034/viewer/2022050819/56814a9f550346895db7af63/html5/thumbnails/5.jpg)
Depth-First Search (DFS) Properties
• Non-optimal solution path• Incomplete unless there is a depth bound• Exponential time• Linear space
![Page 6: Depth-First Search (DFS) Properties](https://reader034.vdocuments.us/reader034/viewer/2022050819/56814a9f550346895db7af63/html5/thumbnails/6.jpg)
![Page 7: Depth-First Search (DFS) Properties](https://reader034.vdocuments.us/reader034/viewer/2022050819/56814a9f550346895db7af63/html5/thumbnails/7.jpg)
![Page 8: Depth-First Search (DFS) Properties](https://reader034.vdocuments.us/reader034/viewer/2022050819/56814a9f550346895db7af63/html5/thumbnails/8.jpg)
BFS
![Page 9: Depth-First Search (DFS) Properties](https://reader034.vdocuments.us/reader034/viewer/2022050819/56814a9f550346895db7af63/html5/thumbnails/9.jpg)
![Page 10: Depth-First Search (DFS) Properties](https://reader034.vdocuments.us/reader034/viewer/2022050819/56814a9f550346895db7af63/html5/thumbnails/10.jpg)
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
![Page 11: Depth-First Search (DFS) Properties](https://reader034.vdocuments.us/reader034/viewer/2022050819/56814a9f550346895db7af63/html5/thumbnails/11.jpg)
12
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
![Page 12: Depth-First Search (DFS) Properties](https://reader034.vdocuments.us/reader034/viewer/2022050819/56814a9f550346895db7af63/html5/thumbnails/12.jpg)
Homework
![Page 13: Depth-First Search (DFS) Properties](https://reader034.vdocuments.us/reader034/viewer/2022050819/56814a9f550346895db7af63/html5/thumbnails/13.jpg)
![Page 14: Depth-First Search (DFS) Properties](https://reader034.vdocuments.us/reader034/viewer/2022050819/56814a9f550346895db7af63/html5/thumbnails/14.jpg)
![Page 15: Depth-First Search (DFS) Properties](https://reader034.vdocuments.us/reader034/viewer/2022050819/56814a9f550346895db7af63/html5/thumbnails/15.jpg)
![Page 16: Depth-First Search (DFS) Properties](https://reader034.vdocuments.us/reader034/viewer/2022050819/56814a9f550346895db7af63/html5/thumbnails/16.jpg)
![Page 17: Depth-First Search (DFS) Properties](https://reader034.vdocuments.us/reader034/viewer/2022050819/56814a9f550346895db7af63/html5/thumbnails/17.jpg)
![Page 18: Depth-First Search (DFS) Properties](https://reader034.vdocuments.us/reader034/viewer/2022050819/56814a9f550346895db7af63/html5/thumbnails/18.jpg)
Example
![Page 19: Depth-First Search (DFS) Properties](https://reader034.vdocuments.us/reader034/viewer/2022050819/56814a9f550346895db7af63/html5/thumbnails/19.jpg)
![Page 20: Depth-First Search (DFS) Properties](https://reader034.vdocuments.us/reader034/viewer/2022050819/56814a9f550346895db7af63/html5/thumbnails/20.jpg)
![Page 21: Depth-First Search (DFS) Properties](https://reader034.vdocuments.us/reader034/viewer/2022050819/56814a9f550346895db7af63/html5/thumbnails/21.jpg)
![Page 22: Depth-First Search (DFS) Properties](https://reader034.vdocuments.us/reader034/viewer/2022050819/56814a9f550346895db7af63/html5/thumbnails/22.jpg)
![Page 23: Depth-First Search (DFS) Properties](https://reader034.vdocuments.us/reader034/viewer/2022050819/56814a9f550346895db7af63/html5/thumbnails/23.jpg)
![Page 24: Depth-First Search (DFS) Properties](https://reader034.vdocuments.us/reader034/viewer/2022050819/56814a9f550346895db7af63/html5/thumbnails/24.jpg)
![Page 25: Depth-First Search (DFS) Properties](https://reader034.vdocuments.us/reader034/viewer/2022050819/56814a9f550346895db7af63/html5/thumbnails/25.jpg)
![Page 26: Depth-First Search (DFS) Properties](https://reader034.vdocuments.us/reader034/viewer/2022050819/56814a9f550346895db7af63/html5/thumbnails/26.jpg)