1 solving problems by searching chapter 3. depth first search expand deepest unexpanded node the...
TRANSCRIPT
![Page 1: 1 Solving problems by searching Chapter 3. Depth First Search Expand deepest unexpanded node The root is examined first; then the left child of the root;](https://reader031.vdocuments.site/reader031/viewer/2022020320/5697bfbb1a28abf838ca0fe0/html5/thumbnails/1.jpg)
1
Solving problems by searching
Chapter 3
![Page 2: 1 Solving problems by searching Chapter 3. Depth First Search Expand deepest unexpanded node The root is examined first; then the left child of the root;](https://reader031.vdocuments.site/reader031/viewer/2022020320/5697bfbb1a28abf838ca0fe0/html5/thumbnails/2.jpg)
Depth First Search
Expand deepest unexpanded node The root is examined first; then the left child of the
root; then the left child of this node, etc. until a leaf is found. At a leaf, backtrack to the lowest right child and repeat.
Does not have to keep all nodes on the open list, only retains the children of a single state
May get stuck in a deep search space Implementation : Fringe = LIFO queue, i.e., put successors at front
2
![Page 3: 1 Solving problems by searching Chapter 3. Depth First Search Expand deepest unexpanded node The root is examined first; then the left child of the root;](https://reader031.vdocuments.site/reader031/viewer/2022020320/5697bfbb1a28abf838ca0fe0/html5/thumbnails/3.jpg)
Depth-first Search Algorithm
3
![Page 4: 1 Solving problems by searching Chapter 3. Depth First Search Expand deepest unexpanded node The root is examined first; then the left child of the root;](https://reader031.vdocuments.site/reader031/viewer/2022020320/5697bfbb1a28abf838ca0fe0/html5/thumbnails/4.jpg)
4
Depth-first search
![Page 5: 1 Solving problems by searching Chapter 3. Depth First Search Expand deepest unexpanded node The root is examined first; then the left child of the root;](https://reader031.vdocuments.site/reader031/viewer/2022020320/5697bfbb1a28abf838ca0fe0/html5/thumbnails/5.jpg)
5
Depth-first search
![Page 6: 1 Solving problems by searching Chapter 3. Depth First Search Expand deepest unexpanded node The root is examined first; then the left child of the root;](https://reader031.vdocuments.site/reader031/viewer/2022020320/5697bfbb1a28abf838ca0fe0/html5/thumbnails/6.jpg)
6
Depth-first search
![Page 7: 1 Solving problems by searching Chapter 3. Depth First Search Expand deepest unexpanded node The root is examined first; then the left child of the root;](https://reader031.vdocuments.site/reader031/viewer/2022020320/5697bfbb1a28abf838ca0fe0/html5/thumbnails/7.jpg)
7
Depth-first search
![Page 8: 1 Solving problems by searching Chapter 3. Depth First Search Expand deepest unexpanded node The root is examined first; then the left child of the root;](https://reader031.vdocuments.site/reader031/viewer/2022020320/5697bfbb1a28abf838ca0fe0/html5/thumbnails/8.jpg)
8
Depth-first search
![Page 9: 1 Solving problems by searching Chapter 3. Depth First Search Expand deepest unexpanded node The root is examined first; then the left child of the root;](https://reader031.vdocuments.site/reader031/viewer/2022020320/5697bfbb1a28abf838ca0fe0/html5/thumbnails/9.jpg)
9
Depth-first search
![Page 10: 1 Solving problems by searching Chapter 3. Depth First Search Expand deepest unexpanded node The root is examined first; then the left child of the root;](https://reader031.vdocuments.site/reader031/viewer/2022020320/5697bfbb1a28abf838ca0fe0/html5/thumbnails/10.jpg)
10
Depth-first search
![Page 11: 1 Solving problems by searching Chapter 3. Depth First Search Expand deepest unexpanded node The root is examined first; then the left child of the root;](https://reader031.vdocuments.site/reader031/viewer/2022020320/5697bfbb1a28abf838ca0fe0/html5/thumbnails/11.jpg)
Depth-first Search
11
Complete? No: fails in infinite-depth spaces, spaces with loops
complete in finite spaces
Time? O(bm): terrible if m is much larger than d where m is maximum depth of any node,
d is depth of the least-cost solution but if solutions are dense, may be much faster
than breadth-first Space? O(bm), i.e., linear space!
where b is maximum branching factor of the search tree
Optimal? No
![Page 12: 1 Solving problems by searching Chapter 3. Depth First Search Expand deepest unexpanded node The root is examined first; then the left child of the root;](https://reader031.vdocuments.site/reader031/viewer/2022020320/5697bfbb1a28abf838ca0fe0/html5/thumbnails/12.jpg)
12
Depth-first search of 8-puzzle with a depth bound of 5
![Page 13: 1 Solving problems by searching Chapter 3. Depth First Search Expand deepest unexpanded node The root is examined first; then the left child of the root;](https://reader031.vdocuments.site/reader031/viewer/2022020320/5697bfbb1a28abf838ca0fe0/html5/thumbnails/13.jpg)
Depth Limited Search
13
Depth-limit for search is set at depth (level) l.
Nodes at depth (level) l have no successors in the search tree.
It is not optimal. It is complete if d < l. It has time complexity of O(bl). But space complexity is only O(bl).
![Page 14: 1 Solving problems by searching Chapter 3. Depth First Search Expand deepest unexpanded node The root is examined first; then the left child of the root;](https://reader031.vdocuments.site/reader031/viewer/2022020320/5697bfbb1a28abf838ca0fe0/html5/thumbnails/14.jpg)
Depth Limited Search
14
![Page 15: 1 Solving problems by searching Chapter 3. Depth First Search Expand deepest unexpanded node The root is examined first; then the left child of the root;](https://reader031.vdocuments.site/reader031/viewer/2022020320/5697bfbb1a28abf838ca0fe0/html5/thumbnails/15.jpg)
15
Iterative Deepening Search
Combines the benefits of depth-first and breadth-first search.
It is complete and optimal. It has time complexity of O(bd). But space complexity is only O(bd).
![Page 16: 1 Solving problems by searching Chapter 3. Depth First Search Expand deepest unexpanded node The root is examined first; then the left child of the root;](https://reader031.vdocuments.site/reader031/viewer/2022020320/5697bfbb1a28abf838ca0fe0/html5/thumbnails/16.jpg)
16
Iterative deepening search l =0
![Page 17: 1 Solving problems by searching Chapter 3. Depth First Search Expand deepest unexpanded node The root is examined first; then the left child of the root;](https://reader031.vdocuments.site/reader031/viewer/2022020320/5697bfbb1a28abf838ca0fe0/html5/thumbnails/17.jpg)
17
Iterative deepening search l =1
![Page 18: 1 Solving problems by searching Chapter 3. Depth First Search Expand deepest unexpanded node The root is examined first; then the left child of the root;](https://reader031.vdocuments.site/reader031/viewer/2022020320/5697bfbb1a28abf838ca0fe0/html5/thumbnails/18.jpg)
18
Iterative deepening search l =2
![Page 19: 1 Solving problems by searching Chapter 3. Depth First Search Expand deepest unexpanded node The root is examined first; then the left child of the root;](https://reader031.vdocuments.site/reader031/viewer/2022020320/5697bfbb1a28abf838ca0fe0/html5/thumbnails/19.jpg)
19
Iterative deepening search l =3
![Page 20: 1 Solving problems by searching Chapter 3. Depth First Search Expand deepest unexpanded node The root is examined first; then the left child of the root;](https://reader031.vdocuments.site/reader031/viewer/2022020320/5697bfbb1a28abf838ca0fe0/html5/thumbnails/20.jpg)
20
Iterative Deepening: Efficiency
Iterative deepening looks inefficient because so many states are expanded multiple times. In practice this is not that bad, because by far most of the nodes are at the bottom level. For a branching factor b of 2, this
might double the search time. For a branching factor b of 10, this
might add 10% to the search time.
![Page 21: 1 Solving problems by searching Chapter 3. Depth First Search Expand deepest unexpanded node The root is examined first; then the left child of the root;](https://reader031.vdocuments.site/reader031/viewer/2022020320/5697bfbb1a28abf838ca0fe0/html5/thumbnails/21.jpg)
21
Properties of iterative deepening search
Complete? Yes
Time? (d+1)b0 + d b1 + (d-1)b2 + … + bd = O(bd)
Space? O(bd)
Optimal? Yes
![Page 22: 1 Solving problems by searching Chapter 3. Depth First Search Expand deepest unexpanded node The root is examined first; then the left child of the root;](https://reader031.vdocuments.site/reader031/viewer/2022020320/5697bfbb1a28abf838ca0fe0/html5/thumbnails/22.jpg)
Summary of algorithms
Example :
http://www.cs.rochester.edu/u/kautz/Mazes/search/applet.html
22