1 / 28

Artificial Intelligence for Games Uninformed search

Artificial Intelligence for Games Uninformed search. Patrick Olivier p.l.olivier@ncl.ac.uk. Simple problem solving agent. Roadmap of Romania…. Example: Romanian holiday. On holiday in Romania (currently in Arad) Flight leaves tomorrow from Bucharest Formulate goal: be in Bucharest

emory
Download Presentation

Artificial Intelligence for Games Uninformed search

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. Artificial Intelligence for GamesUninformed search Patrick Olivier p.l.olivier@ncl.ac.uk

  2. Simple problem solving agent

  3. Roadmap of Romania…

  4. Example: Romanian holiday • On holiday in Romania (currently in Arad) • Flight leaves tomorrow from Bucharest • Formulate goal: • be in Bucharest • Formulate problem: • states: various cities • actions: drive between cities • Find solution: • sequence of cities, e.g., Arad, Sibiu, Fagaras…

  5. Example: 8 puzzle • states? • locations of tiles • actions? • move blank left, right, up, down • goal test? • goal state (given) • path cost? • 1 per move

  6. Example: robot assembly • states? • joint angles + parts • actions? • joint motions • goal test? • complete assembly • path cost? • time to execute

  7. Example: NPC path planning • states? • discretised world • actions? • character motions • goal test? • destination reached • path cost? • cumulative motion cost

  8. Tree search algorithms • simulated (offline) exploration of state space • generating successors of already-explored states

  9. Tree search: implementation

  10. Search strategies • strategy defined by order of node expansion • strategies evaluated according to: • completeness: always find a solution if one exists? • time complexity: number of nodes generated • space complexity: maximum nodes in memory • optimality: always finds a least-cost solution? • time & space complexity measured in terms of: • b: maximum branching factor of the search tree • d: depth of the least-cost solution • m: maximum depth of the state space (may be ∞)

  11. Uninformed search strategies • only use information in the problem definition (uninformed): • breadth-first search • uniform-cost search • depth-first search • depth-limited search • iterative deepening search • improve using informed search (next week)

  12. Breadth-first search • Expand shallowest unexpanded node • Implementation: fringe is a FIFO queue • add newly expanded nodes to back of queue • expand nodes at the front of the queue

  13. Old queue: [ ] New queue: [A]

  14. Old queue: [A] New queue: [B C]

  15. Old queue: [B C] New queue: [C D E]

  16. Old queue: [C D E] New queue: [D E F G]

  17. Properties of breadth-first search • Complete? • Yes (if b is finite) • Time: • b+b2+b3+… +bd + (bd+1-b) = O(bd+1) • Space: • O(bd+1) …keeps every node in memory • Optimal? • If the cost is the same per step • Space is the problem (more than time)

  18. Depth-first search • Expand deepest unexpanded node • Implementation: fringe is a LIFO queue • add newly expanded nodes to front of queue • expand node at the front of queue

  19. Old queue: [ ] New queue: [A]

  20. Old queue: [A] New queue: [B C]

  21. Old queue: [B C] New queue: [D E C]

  22. Old queue: [D E C] New queue: [H I E C]

  23. Old queue: [H I E C] New queue: [I E C]

  24. Old queue: [I E C] New queue: [E C]

  25. Old queue: [E C] New queue: [J K C]

  26. Old queue: [J K C] New queue: [K C]

  27. Old queue: [K C] New queue: [C]

  28. Properties of depth-first search • Complete? • No – fails in infinite-depth spaces (or with loops) • modify to avoid repeated states along path • complete in finite spaces • Time: • O(bm): bad if m much larger than d of shallowest goal • if solutions are dense, much faster than breadth-first • Space: • O(bm), i.e. linear space • Optimal? • No

More Related