solving problems by searching
play

Solving problems by searching Part I: Uninformed Search - PowerPoint PPT Presentation

Solving problems by searching Part I: Uninformed Search Formula<ng a Problem Domain State: Some descrip<on of the current world state Ac<on:


  1. Solving ¡problems ¡by ¡searching ¡ Part ¡I: ¡Uninformed ¡Search ¡

  2. Formula<ng ¡a ¡Problem ¡Domain ¡ • State: ¡Some ¡descrip<on ¡of ¡the ¡current ¡world ¡ state ¡ • Ac<on: ¡Means ¡to ¡manipulate ¡the ¡world. ¡ • Goal: ¡The ¡desired ¡descrip<on ¡of ¡the ¡world. ¡ • Problem: ¡Descrip<on ¡of ¡the ¡problem ¡to ¡be ¡ solved. ¡ • Solu<on: ¡Sequence ¡of ¡ac<ons ¡that ¡will ¡lead ¡us ¡ from ¡to ¡the ¡goal ¡state. ¡

  3. Example: ¡Romania ¡ • On ¡holiday ¡in ¡Romania; ¡currently ¡in ¡Arad. ¡ • Flight ¡leaves ¡tomorrow ¡from ¡Bucharest ¡ ¡ • Formulate ¡goal: ¡ – be ¡in ¡Bucharest ¡ ¡ • Formulate ¡problem: ¡ – states: ¡various ¡ci<es ¡ – ac<ons: ¡drive ¡between ¡ci<es ¡ ¡ • Find ¡solu<on: ¡ – sequence ¡of ¡ci<es, ¡e.g., ¡Arad, ¡Sibiu, ¡Fagaras, ¡Bucharest ¡ ¡

  4. Example: ¡Romania ¡

  5. Problem ¡types ¡ • Determinis<c, ¡fully ¡observable ¡ à ¡single-­‑state ¡problem ¡ – Agent ¡knows ¡exactly ¡which ¡state ¡it ¡will ¡be ¡in; ¡solu<on ¡is ¡a ¡sequence ¡ ¡ • Non-­‑observable ¡ à ¡sensorless ¡problem ¡(conformant ¡problem) ¡ – Agent ¡may ¡have ¡no ¡idea ¡where ¡it ¡is; ¡solu<on ¡is ¡a ¡sequence ¡ ¡ • Nondeterminis<c ¡and/or ¡par<ally ¡observable ¡ à ¡con<ngency ¡ problem ¡ – percepts ¡provide ¡new ¡informa<on ¡about ¡current ¡state ¡ – oRen ¡interleave} ¡search, ¡execu<on ¡ ¡ • Unknown ¡state ¡space ¡ à ¡explora<on ¡problem ¡

  6. Single-­‑state ¡problem ¡formula<on ¡ A ¡problem ¡is ¡defined ¡by ¡four ¡items: ¡ 1. ini<al ¡state ¡e.g., ¡"at ¡Arad" ¡ ¡ 2. ac<ons ¡or ¡successor ¡func<on ¡ S(x) ¡= ¡set ¡of ¡ac<on–state ¡pairs ¡ ¡ – e.g., ¡ S(Arad) ¡= ¡ { <Arad ¡ à ¡Zerind, ¡Zerind>, ¡… ¡ } ¡ ¡ 3. goal ¡test, ¡can ¡be ¡ – explicit, ¡e.g., ¡ x ¡ = ¡"at ¡Bucharest" ¡ – implicit, ¡e.g., ¡ Checkmate(x) ¡ ¡ 4. path ¡cost ¡(addi<ve) ¡ – e.g., ¡sum ¡of ¡distances, ¡number ¡of ¡ac<ons ¡executed, ¡etc. ¡ – c(x,a,y) ¡ is ¡the ¡step ¡cost, ¡assumed ¡to ¡be ¡≥ ¡0 ¡ A ¡solu<on ¡is ¡a ¡sequence ¡of ¡ac<ons ¡leading ¡from ¡the ¡ini<al ¡state ¡to ¡a ¡ • goal ¡state ¡

  7. Selec<ng ¡a ¡state ¡space ¡ Real ¡world ¡is ¡absurdly ¡complex ¡ ¡ • à ¡state ¡space ¡must ¡be ¡abstracted ¡for ¡problem ¡solving ¡ ¡ (Abstract) ¡state ¡= ¡set ¡of ¡real ¡states ¡ • ¡ (Abstract) ¡ac<on ¡= ¡complex ¡combina<on ¡of ¡real ¡ac<ons ¡ • – e.g., ¡"Arad ¡ à ¡Zerind" ¡represents ¡a ¡complex ¡set ¡of ¡possible ¡routes, ¡detours, ¡rest ¡ stops, ¡etc. ¡ ¡ For ¡guaranteed ¡realizability, ¡any ¡real ¡state ¡"in ¡Arad “ ¡must ¡get ¡to ¡some ¡real ¡ • state ¡"in ¡Zerind" ¡ ¡ (Abstract) ¡solu<on ¡= ¡ ¡ • – set ¡of ¡real ¡paths ¡that ¡are ¡solu<ons ¡in ¡the ¡real ¡world ¡ ¡ Each ¡abstract ¡ac<on ¡should ¡be ¡"easier" ¡than ¡the ¡original ¡problem ¡ • ¡

  8. Example: ¡The ¡8-­‑puzzle ¡ 5 7 2 4 1 2 3 5 6 4 5 6 8 3 1 7 8 Start State Goal State • states ¡= ¡integer ¡loca<ons ¡of ¡<les ¡ • ac<ons ¡= ¡move ¡blank ¡leR, ¡right, ¡up, ¡down ¡ • goal ¡test: ¡= ¡goal ¡state ¡(given) ¡path ¡ • cost: ¡1 ¡per ¡move ¡ ¡ • [Note: ¡op<mal ¡solu<on ¡of ¡n-­‑Puzzle ¡family ¡is ¡NP-­‑hard] ¡ ¡

  9. Example: ¡robo<c ¡assembly ¡ P R R R R R • states: ¡ – real-­‑valued ¡coordinates ¡of ¡robot ¡joint ¡angles ¡ – parts ¡of ¡object ¡to ¡be ¡assembled ¡ • ac<ons: ¡con<nuous ¡mo<on ¡of ¡robot ¡joints ¡ • goal ¡test: ¡complete ¡assembly ¡ • path ¡cost: ¡<me ¡to ¡execute ¡

  10. Tree ¡search ¡example ¡ • Simple ¡means ¡to ¡find ¡a ¡path ¡to ¡the ¡goal ¡state. ¡

  11. Tree ¡search ¡example ¡ Arad Sibiu Timisoara Zerind Arad Fagaras Oradea Arad Lugoj Arad Oradea Rimnicu Vilcea 14 ¡Jan ¡2004 ¡ CS ¡3243 ¡-­‑ ¡Blind ¡Search ¡ 11 ¡

  12. Tree ¡search ¡example ¡ Arad Sibiu Timisoara Zerind Arad Fagaras Oradea Arad Lugoj Arad Oradea Rimnicu Vilcea 14 ¡Jan ¡2004 ¡ CS ¡3243 ¡-­‑ ¡Blind ¡Search ¡ 12 ¡

  13. Tree ¡search ¡example ¡ Arad Sibiu Timisoara Zerind Arad Fagaras Oradea Arad Lugoj Arad Oradea Rimnicu Vilcea 14 ¡Jan ¡2004 ¡ CS ¡3243 ¡-­‑ ¡Blind ¡Search ¡ 13 ¡

  14. Tic ¡Tac ¡Toe ¡Example ¡ X X X X X X X X X −

  15. Tic ¡Tac ¡Toe ¡Example ¡ X X X X X X X X X X O X O X . . . O −

  16. Tic ¡Tac ¡Toe ¡Example ¡ X X X X X X X X X X O X O X . . . O X O X X O X O . . . X X −

  17. Tic ¡Tac ¡Toe ¡Example ¡ X X X X X X X X X X O X O X . . . O X O X X O X O . . . X X . . . . . . . . . . . . . . . X O X X O X X O X O X O O X X O X X O X O O − 1 0 +1

  18. Uninformed ¡search ¡strategies ¡ • Uninformed ¡strategies ¡use ¡only ¡the ¡ informa<on ¡available ¡in ¡the ¡problem ¡ defini<on ¡ ¡ – Breadth-­‑first ¡search ¡ – Uniform-­‑cost ¡search ¡ – Depth-­‑first ¡search ¡ – Depth-­‑limited ¡search ¡ – Itera<ve ¡deepening ¡search ¡ ¡

  19. Search ¡strategies ¡ • A ¡strategy ¡is ¡defined ¡by ¡picking ¡the ¡order ¡of ¡node ¡ expansion ¡ ¡ • Strategies ¡are ¡evaluated ¡along ¡the ¡following ¡dimensions: ¡ – completeness—does ¡it ¡always ¡find ¡a ¡solu<on ¡if ¡one ¡exists? ¡ – <me ¡complexity—number ¡of ¡nodes ¡generated/expanded ¡ – space ¡complexity—maximum ¡number ¡of ¡nodes ¡in ¡memory ¡ – op<mality—does ¡it ¡always ¡find ¡a ¡least-­‑cost ¡solu<on? ¡ ¡ • Time ¡and ¡space ¡complexity ¡are ¡measured ¡in ¡terms ¡of ¡ – b —maximum ¡branching ¡factor ¡of ¡the ¡search ¡tree ¡ – d —depth ¡of ¡the ¡least-­‑cost ¡solu<on ¡ – m —maximum ¡depth ¡of ¡the ¡state ¡space ¡(may ¡be ¡ ∞ ) ¡ ¡

  20. Breadth-­‑first ¡search ¡ Expand ¡shallowest ¡unexpanded ¡node ¡ Implementa<on: ¡ ¡fringe ¡is ¡a ¡FIFO ¡queue ¡new ¡successors ¡go ¡at ¡the ¡end: ¡ ¡ A B C D E F G

  21. Breadth-­‑first ¡search ¡ Expand ¡shallowest ¡unexpanded ¡node ¡ Implementa<on: ¡ ¡fringe ¡is ¡a ¡FIFO ¡queue ¡new ¡successors ¡go ¡at ¡the ¡end: ¡ ¡ A B C D E F G

  22. Breadth-­‑first ¡search ¡ Expand ¡shallowest ¡unexpanded ¡node ¡ Implementa<on: ¡ ¡fringe ¡is ¡a ¡FIFO ¡queue ¡new ¡successors ¡go ¡at ¡the ¡end: ¡ ¡ A B C D E F G

  23. Breadth-­‑first ¡search ¡ Expand ¡shallowest ¡unexpanded ¡node ¡ Implementa<on: ¡ ¡fringe ¡is ¡a ¡FIFO ¡queue ¡new ¡successors ¡go ¡at ¡the ¡end: ¡ ¡ A B C D E F G

  24. Proper<es ¡of ¡Breadth ¡First ¡Search ¡ • Complete: ¡Yes ¡(if ¡b ¡is ¡finite) ¡ • Time: ¡ 1+b+b 2 +b 3 +...+b d +b(b d −1) ¡= ¡O(b d+1 ) ¡ • Space: ¡ O(b d+1 ) ¡(keeps ¡every ¡node ¡in ¡memory) ¡ • Op<mal: ¡ – Yes ¡(if ¡cost ¡= ¡1 ¡per ¡step) ¡ – Not ¡op<mal ¡in ¡general ¡ • Space ¡is ¡the ¡big ¡problem; ¡can ¡easily ¡generate ¡nodes ¡ at ¡100MB/sec ¡so ¡24hrs ¡= ¡8640GB. ¡ ¡

  25. Depth-­‑first ¡search ¡ Expand ¡deepest ¡unexpanded ¡node ¡ Implementa<on: ¡ ¡fringe ¡is ¡a ¡LIFO ¡queue; ¡put ¡successors ¡at ¡front: ¡ ¡ A B C D E F G H I J K L M N O

  26. Depth-­‑first ¡search ¡ Expand ¡deepest ¡unexpanded ¡node ¡ Implementa<on: ¡ ¡fringe ¡is ¡a ¡LIFO ¡queue; ¡put ¡successors ¡at ¡front: ¡ ¡ A B C D E F G H I J K L M N O

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend