artificial intelligence for games depth limited search patrick olivier [email protected]
TRANSCRIPT
![Page 2: Artificial Intelligence for Games Depth limited search Patrick Olivier p.l.olivier@ncl.ac.uk](https://reader036.vdocument.in/reader036/viewer/2022062806/56649cdc5503460f949a700d/html5/thumbnails/2.jpg)
Recap: Breadth-first search
![Page 3: Artificial Intelligence for Games Depth limited search Patrick Olivier p.l.olivier@ncl.ac.uk](https://reader036.vdocument.in/reader036/viewer/2022062806/56649cdc5503460f949a700d/html5/thumbnails/3.jpg)
Roadmap of Romania…
![Page 4: Artificial Intelligence for Games Depth limited search Patrick Olivier p.l.olivier@ncl.ac.uk](https://reader036.vdocument.in/reader036/viewer/2022062806/56649cdc5503460f949a700d/html5/thumbnails/4.jpg)
Class Exercise – Uniform-Cost• Uniform-cost search
– Cost to get to a node g(n)– Expand the least-cost unexpanded node– Implement with fringe ordered by path cost
• Romanian holiday:– Initial state: Arad– Goal state: Bucharest– Do a uniform cost search by hand
![Page 5: Artificial Intelligence for Games Depth limited search Patrick Olivier p.l.olivier@ncl.ac.uk](https://reader036.vdocument.in/reader036/viewer/2022062806/56649cdc5503460f949a700d/html5/thumbnails/5.jpg)
Recap: Depth-first search
![Page 6: Artificial Intelligence for Games Depth limited search Patrick Olivier p.l.olivier@ncl.ac.uk](https://reader036.vdocument.in/reader036/viewer/2022062806/56649cdc5503460f949a700d/html5/thumbnails/6.jpg)
Depth-limited search
• depth-first search with depth limit L• nodes at depth L have no successors
![Page 7: Artificial Intelligence for Games Depth limited search Patrick Olivier p.l.olivier@ncl.ac.uk](https://reader036.vdocument.in/reader036/viewer/2022062806/56649cdc5503460f949a700d/html5/thumbnails/7.jpg)
Iterative deepening
• search to a depth limit L
• if no solution research to limit L+1
• previous search repeated
![Page 8: Artificial Intelligence for Games Depth limited search Patrick Olivier p.l.olivier@ncl.ac.uk](https://reader036.vdocument.in/reader036/viewer/2022062806/56649cdc5503460f949a700d/html5/thumbnails/8.jpg)
Iterative deepening search: L = 0
![Page 9: Artificial Intelligence for Games Depth limited search Patrick Olivier p.l.olivier@ncl.ac.uk](https://reader036.vdocument.in/reader036/viewer/2022062806/56649cdc5503460f949a700d/html5/thumbnails/9.jpg)
Iterative deepening search: L = 1
![Page 10: Artificial Intelligence for Games Depth limited search Patrick Olivier p.l.olivier@ncl.ac.uk](https://reader036.vdocument.in/reader036/viewer/2022062806/56649cdc5503460f949a700d/html5/thumbnails/10.jpg)
Iterative deepening search: L = 2
![Page 11: Artificial Intelligence for Games Depth limited search Patrick Olivier p.l.olivier@ncl.ac.uk](https://reader036.vdocument.in/reader036/viewer/2022062806/56649cdc5503460f949a700d/html5/thumbnails/11.jpg)
Iterative deepening search: L = 3
![Page 12: Artificial Intelligence for Games Depth limited search Patrick Olivier p.l.olivier@ncl.ac.uk](https://reader036.vdocument.in/reader036/viewer/2022062806/56649cdc5503460f949a700d/html5/thumbnails/12.jpg)
Iterative deepening search• Number of nodes generated in a depth-limited search to depth
d with branching factor b: – NDLS = b0 + b1 + b2 + … + bd-2 + bd-1 + bd
• Number of nodes generated in an iterative deepening search to depth d with branching factor b: – NIDS = (d+1)b0 + d.b1 + (d-1)b2 + … + 3bd-2 +2bd-1 + 1bd
• For b=10, d=5:– NDLS = 1 + 10 + 100 + 1,000 + 10,000 + 100,000 = 111,111– NIDS = 6 + 50 + 400 + 3,000 + 20,000 + 100,000 = 123,456
• Overhead = (123,456 - 111,111)/111,111 = 11%
![Page 13: Artificial Intelligence for Games Depth limited search Patrick Olivier p.l.olivier@ncl.ac.uk](https://reader036.vdocument.in/reader036/viewer/2022062806/56649cdc5503460f949a700d/html5/thumbnails/13.jpg)
Properties of iterative deepening
• Complete? – Yes
• Time: – (d+1)b0 + d b1 + (d-1)b2 + … + bd = O(bd)
• Space: – O(bd)
• Optimal? – If the cost is the same per step
![Page 14: Artificial Intelligence for Games Depth limited search Patrick Olivier p.l.olivier@ncl.ac.uk](https://reader036.vdocument.in/reader036/viewer/2022062806/56649cdc5503460f949a700d/html5/thumbnails/14.jpg)
Summary of uninformed search