he heur uristic c sea earc rch h
play

He Heur uristic c Sea earc rch h Com omputer Science c cpsc - PowerPoint PPT Presentation

He Heur uristic c Sea earc rch h Com omputer Science c cpsc sc322, Lecture 7 7 (Te Text xtboo ook k Chpt 3.6) May ay, 2 23, 2 2017 CPSC 322, Lecture 7 Slide 1 Co Cour urse se Ann nnou ounc ncem emen ents ts


  1. He Heur uristic c Sea earc rch h Com omputer Science c cpsc sc322, Lecture 7 7 (Te Text xtboo ook k Chpt 3.6) May ay, 2 23, 2 2017 CPSC 322, Lecture 7 Slide 1

  2. Co Cour urse se Ann nnou ounc ncem emen ents ts Assignment1 t1: poste ted If yo you ar are c confused on b bas asic s sear arch al algorith thm, different se t sear arch strategies….. Check lear arning goal als at at th the e end of lectu tures. Wo Work on th the Prac acti tice E Exercises an and Please d do c come to to o office hours Giuseppe : Fri 830-930, my office CICSR 105 • Johnson, David davewj@cs.ubc.ca Office hour: ICCS X141, Wed 1-230pm • Johnson, Jordon jordon@cs.ubc.ca Office hour: ICCS X141, Mon 11-1pm • Kazemi, S. Mehran smkazemi@cs.ubc.ca Office hour: ICCS X141, Wed 230-4pm • Rahman, MD Abed abed90@cs.ubc.ca Office hour: ICCS X141, Fri 3-430pm • Wang, Wenyi wenyi.wang@alumni.ubc.ca Office hour: ICCS X141, Mon 1-230pm CPSC 322, Lecture 7 Slide 2

  3. Co Cour urse se Ann nnou ounc ncem emen ents ts Inked S Slides • At th t the end o of eac ach lectu ture I I r revi vise/clean an-up th the s slides. Adding comments, improving writing… make sure you check th them o out CPSC 322, Lecture 7 Slide 3

  4. Lectu ture re Ov Overv rvie iew • Recap ap • Sear arch wit ith Co Costs • Summar ary U y Unin info formed d Sear arch • Heuristic Search CPSC 322, Lecture 7 Slide 4

  5. Recap ap: Se Sear arch wit ith Co 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 5

  6. Recap ap U Unin info form rmed Se Sear arch Complete Optimal T ime 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 6

  7. Recap ap U Unin info form rmed Se Sear arch • Why are all these strategies called uninformed? Because they do o not ot con onsi sider any infor ormation on abou out the st states s (end n nod odes) s) 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 sp specific n nature of of the prob oblem. CPSC 322, Lecture 7 Slide 7

  8. Lectu ture re Ov Overv rvie iew • Rec ecap ap • Sear arch wit ith Co Costs • Summar ary Un y Unin info formed d Sear arch • Heuristic Search CPSC 322, Lecture 7 Slide 8

  9. Beyond uninformed search…. What information we could use to better select paths from the frontier? A. an estimate of the distance from the last node on the path to the goal B. an estimate of the distance from the start state to the goal C. an estimate of the cost of the path D. None of the above CPSC 322, Lecture 6 Slide 9

  10. Heuri He rist stic ic Se Sear arch 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 est stimate of of the dist stance from node n to o a go goal nod ode. This is called a he heur uris isti tic CPSC 322, Lecture 7 Slide 10

  11. Mor ore fo form rmal ally ly 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 1 1

  12. Mor ore fo form rmal ally ly (c (con ont. t.) Definition (ad admissible heuristi tic) 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 cost 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 12

  13. Exa xamp mple le Admi miss ssib ible le He Heuri rist stic ic Fu Functi tion ons Search prob oblem: robot has to find a route from start location to goal location on a grid (discrete space with obstacles) Final cos Fi ost (quality of the solution) is the number of steps G CPSC 322, Lecture 3 Slide 13

  14. Exa xamp mple le Admi miss ssib ible le He Heuri rist stic ic Fu Functi tion ons If no obstacles, cost of optimal solution is… CPSC 322, Lecture 3 Slide 14

  15. Exa xamp mple le Admi miss ssib ible le He Heuri rist stic ic Fu Functi tion ons If there are obstacle, the optimal solution without obstacles is an admissible heuristic G CPSC 322, Lecture 3 Slide 15

  16. Exa xamp mple le Admi miss ssib ible le He Heuri rist stic ic Fu Functi tion ons • 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 16

  17. Admi miss ssib ible le He Heuri rist stic ic Fu Functi tion on fo for r 8-puzz zzle le A reasonable admissible heuristics for the 8-puzzle is? A. Number of misplaced tiles plus number of correctly place tiles B. Number of misplaced tiles C. Number of correctly placed tiles D. None of the above CPSC 322, Lecture 6 Slide 17

  18. Admi miss ssib ible le Exa xamp mple le He Heuri rist stic ic Fu Functi tion ons • In the 8-puzzle, we can use the number of misplaced tiles CPSC 322, Lecture 3 Slide 18

  19. Exa xamp mple le Admi miss ssib ible le He Heuri rist stic ic Fu Functi tion ons • 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 19

  20. How ow to to Con onst stru ruct t an A Admis issi sible le Heuri rist stic ic You identify relaxed version of the problem: • where one or more constraints have been dropped • problem with fewer restrictions on the actions Robot: the agent can move through walls Drive ver: the agent can move straight 8puzzle: (1) tiles can move anywhere (2) tiles can move to any adjacent square Resu sult: The cost of an optimal solution in 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 20

  21. Ho How to to Co Cons nstru truct ct an an a admi miss ssib ible le He Heur uris isti tic c (con (c ont. 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: al allowing the agent to move through walls. Optimal solution to this relaxed problem is Manhattan distance Driver: al allowing the agent to move straight. Optimal solution to this relaxed problem is straight-line distance 8puzzle: (1) tiles can an m move ve an anyw ywhere Optimal solution to this relaxed problem is number of misplaced tiles (2) tiles can move to any adjacent square…. CPSC 322, Lecture 7 Slide 21

  22. Anot other r appro roach to to con onst stru ruct t heuri rist stic ics Sol olution on cos ost for or a su subprob oblem 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 22 Goal node

  23. He Heuri rist stic ics: s: Dom omin inan ance If h 2 (n) ≥ h 1 (n) for every state n (both admissible) then h 2 dominates h 1 Which one is better for search ? A. h 1 B. h 2 C. It depends CPSC 322, Lecture 8

  24. He Heuri rist stic ics: s: Dom omin inan ance 8puzz zzle: (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 Slide 24 CPSC 322, Lecture 8

  25. Co Comb mbin inin ing g Admi miss ssib ible le He Heuri rist stic ics Ho How to o com ombine h heurist stics s when t there is s no o dom ominance? 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 25

  26. Com ombin inin ing g Admis issi sible le Heuri rist stic ics: s: Exa xample le In In 8-puzz zzle, s , sol olution on cos ost for or the 1,2 ,2,3 ,3,4 ,4 su subprob oblem is substantially more accurate than Manhattan distance in so some case ses So….. CPSC 322, Lecture 3 Slide 26

Recommend


More recommend