he heur urist stic ic sea earc rch
play

He Heur urist stic ic Sea earc rch h Computer ter Sc Science - PowerPoint PPT Presentation

He Heur urist stic ic Sea earc rch h Computer ter Sc Science ce cpsc3 c322 22, , Lectur ture e 7 (Te Text xtbo book ok Chpt 3.6) Sept, t, 19, 2012 CPSC 322, Lecture 7 Slide 1 Course urse Announcements ouncements Marks ks


  1. He Heur urist stic ic Sea earc rch h Computer ter Sc Science ce cpsc3 c322 22, , Lectur ture e 7 (Te Text xtbo book ok Chpt 3.6) Sept, t, 19, 2012 CPSC 322, Lecture 7 Slide 1

  2. Course urse Announcements ouncements Marks ks for As Assig ignme nment nt0: 0: wi will ll be posted ed on Co Connect t on Fir ir Assignment1: nment1: will will also be posted d on Fri If f you are confuse used d on basic search h algorith ithm, m, different erent search strategies….. Check learning g goals at the end of le lectu tures. res. Work rk on the Pr Practice tice Ex Exercises ises and and Pl Please come to office ce hours Giuseppe Tue 2 pm, my office. Nathaniel Tomer Fri 11am, X150 (Learning Center) Tatsuro Oya Wed 11am, X150 (Learning Center) Mehran Kazemi Mon 11 am, X150 (Learning Center) CPSC 322, Lecture 7 Slide 2

  3. Lecture cture Ov Overview view • Recap cap • Sea earch ch wit ith h Cos osts ts • Su Summ mmary ary Uni ninf nformed ormed Se Sear arch • Heuristic Search CPSC 322, Lecture 7 Slide 3

  4. Recap: cap: Se Search ch with th Cost sts • Sometimes there are costs associated with arcs. • The cost of a path is the sum of the costs of its arcs. • Optimal solution: not the one that minimizes the number of links , but the one that minimizes cost • Lowest-Cost-First Search: expand paths from the frontier in order of their costs. CPSC 322, Lecture 7 Slide 4

  5. Recap cap Uninforme nformed d Se Search ch Complete Optimal Time Space DFS N N O(b m ) O(mb) BFS Y Y O(b m ) O(b m ) IDS Y Y O(b m ) O(mb) LCFS Y Y O(b m ) O(b m ) Costs > 0 Costs >=0 CPSC 322, Lecture 7 Slide 5

  6. Recap cap Uninforme nformed d Se Search ch • Why are all these strategies called uninformed? Because they do not consid ider er any informati mation n about the states tes (end nodes) to decide which path to expand first on the frontier eg (  n0, n2, n3 n3  12), (  n0, n3 n3  8) , (  n0, n1, n4 n4  13) In other words, they are general they do not take into account the specif cific ic nature e of the problem em. CPSC 322, Lecture 7 Slide 6

  7. Lecture cture Ov Overview view • Recap cap • Sea earch ch wit ith h Cos osts ts • Sum ummary mary Uni ninf nformed ormed Sea earch • Heuristic Search CPSC 322, Lecture 7 Slide 7

  8. Heuristic uristic Se Search rch Uninformed/Blind search algorithms do not take into account the goal until they are at a goal node. Often there is extra knowledge that can be used to guide the search: an an estim imate ate of the distan tance ce from node n to a goal node. This is called a heurist ristic ic CPSC 322, Lecture 7 Slide 8

  9. More re fo formall mally Definition (search heuristic) A search heuristic h(n) is an estimate of the cost of the shortest path from node n to a goal node. • h can be extended to paths: h(  n 0 ,…, n k  )=h(n k ) • For now think of h(n) as only using readily obtainable information (that is easy to compute) about a node. CPSC 322, Lecture 7 Slide 9

  10. More re fo formall mally y (co cont.) nt.) Definition (admissibl sible e heuristi stic) A search heuristic h(n) is admissible if it is never an overestimate of the cost from n to a goal. • There is never a path from n to a goal that has path length less than h(n) . • another way of saying this: h(n) is a lower bound on the cost of getting from n to the nearest goal. CPSC 322, Lecture 7 Slide 10

  11. Ex Example mple Ad Admissible issible Heuristic ristic Fu Functions ctions Se Search h problem: em: robot has to find a route from start location to goal location on a grid (discrete space with obstacles) Fi Final l cost (quality of the solution) is the number of steps G CPSC 322, Lecture 3 Slide 11

  12. Ex Example mple Ad Admissible issible Heuristic ristic Fu Functions ctions If no obstacles, cost of optimal solution is… CPSC 322, Lecture 3 Slide 12

  13. Ex Example mple Ad Admissible issible Heuristic ristic Fu Functions ctions If there are obstacle, the optimal solution without obstacles is an admissible heuristic G CPSC 322, Lecture 3 Slide 13

  14. Ex Example mple Ad Admissible issible Heuristic ristic Fu Functions ctions • Similarly, If the nodes are points on a Euclidean plane and the cost is the distance, we can use the straight-line distance from n to the closest goal as the value of h(n) . CPSC 322, Lecture 3 Slide 14

  15. Ex Example mple Heuristic ristic Fu Functions ctions • In the 8-puzzle, we can use the number of misplaced tiles CPSC 322, Lecture 3 Slide 15

  16. Ex Example mple Heuristic ristic Fu Functions ctions • Another one we can use the number of moves between each tile's current position and its position in the solution 1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 8 CPSC 322, Lecture 3 Slide 16

  17. How w to to Construct struct a Heuristic ristic You identify relaxed version of the problem: • where one or more constraints have been dropped • problem with fewer restrictions on the actions Ro Robot: the agent can move through walls Driver Dr er: the agent can move straight 8puzzl zle: (1) tiles can move anywhere (2) tiles can move to any adjacent square Re Result: lt: The cost of an optimal solution to the relaxed problem is an admissible heuristic for the original problem (because it is always weakly less costly to solve a less constrained problem!) CPSC 322, Lecture 7 Slide 17

  18. How w to to Construct struct a Heuristic ristic (co cont. t.) You should identify constraints which, when dropped, make the problem extremely easy to solve • this is important because heuristics are not useful if they're as hard to solve as the original problem! This was the case in our examples Robot: allowi wing the agent to move through walls. Optimal solution to this relaxed problem is Manhattan distance Driver: allowi wing the agent to move straight. Optimal solution to this relaxed problem is straight-line distance 8puzzle: (1) tiles can move anywh where e Optimal solution to this relaxed problem is number of misplaced tiles (2) tiles can move to any adjacent square…. CPSC 322, Lecture 7 Slide 18

  19. An Another other approach roach to to co construct struct heuristics ristics So Solutio tion n cost for a subprob oble lem SubProblem Original Problem 1 3 1 3 8 2 5 @ 2 @ 7 6 4 @ @ 4 Current node 1 2 3 1 2 3 @ 4 8 4 @ @ @ 7 6 5 CPSC 322, Lecture 3 Slide 19 Goal node

  20. Heuristics: uristics: Dominance inance If h 2 (n) ≥ h 1 (n) for every state n (both admissible) then h 2 dominates h 1 Whi hich h o one ne is is be bett tter er fo for sea earch ch (why?) 8puzzl zle: (1) tiles can move anywhere (2) tiles can move to any adjacent square (Original problem: tiles can move to an adjacent square if it is empty) search costs for the 8-puzzle (average number of paths expanded): (d = depth of the solution) d=12 IDS = 3,644,035 paths A * (h 1 ) = 227 paths A * (h 2 ) = 73 paths d=24 IDS = too many paths A * (h 1 ) = 39,135 paths CPSC 322, Lecture 8 A * (h 2 ) = 1,641 paths

  21. Heuristics: uristics: Dominance inance If h 2 (n) ≥ h 1 (n) for all n then h 2 dominates h 1 Is Is h 2 be bett tter er fo for sea earch ch (why?) yes no It depends 8puzzl zle: (1) tiles can move anywhere (2) tiles can move to any adjacent square (Original problem: tiles can move to an adjacent square if it is empty) search costs for the 8-puzzle (average number of paths expanded): d=12 IDS = 3,644,035 paths A * (h 1 ) = 227 paths A * (h 2 ) = 73 paths d=24 IDS = too many paths A * (h 1 ) = 39,135 paths A * (h 2 ) = 1,641 paths CPSC 322, Lecture 8 Slide 21

  22. Combining mbining Heurist ristics ics How to combine ne heuris istics tics when there e is no domina nanc nce? e? If h 1 (n) is admissible and h 2 (n) is also admissible then h(n)= ………………… is also admissible … and dominates all its components CPSC 322, Lecture 3 Slide 22

  23. Combining mbining Heurist ristics: ics: Ex Example mple In 8-puzz zzle, e, solutio tion n cost t for the 1,2,3, ,3,4 4 subpro roble lem is substantially more accurate than Manhattan distance in some cases es So….. CPSC 322, Lecture 3 Slide 23

  24. Adm dmis issi sibl ble e he heur uris istic tic fo for Vac acuu uum m wor orld ld? states? Where it is dirty and robot location actions? Left , Right , Suck Possible goal test? no dirt at all locations CPSC 322, Lecture 3 Slide 24

  25. Learning Goals for today’s class • Const struct uct admiss ssib ible le heuristics stics for a given problem. • Ve Verify fy Heurist stic ic Dominance ce. • Co Combine ne admissib sible le heurist istics ics • From previous classes Define/read/write/trace/debug different search algorithms • With / Without cost • Informed / Uninformed CPSC 322, Lecture 7 Slide 25

  26. Next xt Class ss • Best-First Search • Combining LCFS and BFS: A* (finish 3.6) • A* Optimality CPSC 322, Lecture 7 Slide 26

Recommend


More recommend