heuristic search
play

Heuristic Search Robert Platt Northeastern University Some images - PowerPoint PPT Presentation

Heuristic Search Robert Platt Northeastern University Some images and slides are used from: 1. CS188 UC Berkeley 2. RN, AIMA Recap: What is graph search? Start state Goal state Graph search: find a path from start to goal what are the


  1. Heuristic Search Robert Platt Northeastern University Some images and slides are used from: 1. CS188 UC Berkeley 2. RN, AIMA

  2. Recap: What is graph search? Start state Goal state Graph search: find a path from start to goal – what are the states? – what are the actions (transitions)? – how is this a graph?

  3. Recap: What is graph search? Goal state Start state Graph search: find a path from start to goal – what are the states? – what are the actions (transitions)? – how is this a graph?

  4. Recap: BFS/UCS Image: Adapted from Berkeley CS188 course notes (downloaded Summer 2015)

  5. Recap: BFS/UCS Notice that we search equally far in all directions... It's like this Start Goal Image: Adapted from Berkeley CS188 course notes (downloaded Summer 2015)

  6. Idea Is it possible to use additional information to decide which direction to search in?

  7. Idea Is it possible to use additional information to decide which direction to search in? Yes! Instead of searching in all directions, let's bias search in the direction of the goal.

  8. Example Stright-line distances to Bucharest

  9. Example Goal state Start state Expand states in order of their distance to the goal – for each state that you put on the fringe: calculate straight-line distance to the goal – expand the state on the fringe closest to the goal

  10. Example Goal state Start state Heuristic: Expand states in order of their distance to the goal – for each state that you put on the fringe: calculate straight-line distance to the goal – expand the state on the fringe closest to the goal Greedy search

  11. Greedy Search Image: Adapted from Berkeley CS188 course notes (downloaded Summer 2015)

  12. Greedy Search Each time you expand a state, calculate the heuristic for each of the states that you add to the fringe. – heuristic: i.e. distance to Bucharest – on each step, choose to expand the state with the lowest heuristic value.

  13. Greedy Search This is like a guess about how far the state is from the goal Each time you expand a state, calculate the heuristic for each of the states that you add to the fringe. – heuristic: i.e. distance to Bucharest – on each step, choose to expand the state with the lowest heuristic value.

  14. Example: Greedy Search

  15. Example: Greedy Search

  16. Example: Greedy Search

  17. Example: Greedy Search Path: A-S-F-B

  18. Example: Greedy Search Path: A-S-F-B Notice that this is not the optimal path!

  19. Example: Greedy Search Greedy Search: – Not optimal – Not complete – But, it can be very fast Path: A-S-F-B Notice that this is not the optimal path!

  20. Greedy vs UCS UCS: Greedy Search: – Optimal – Not optimal – Complete – Not complete – Usually very slow – But, it can be very fast

  21. Greedy vs UCS UCS: Greedy Search: – Optimal – Not optimal – Complete – Not complete – Usually very slow – But, it can be very fast Can we combine greedy and UCS???

  22. Greedy vs UCS UCS: Greedy Search: – Optimal – Not optimal – Complete – Not complete – Usually very slow – But, it can be very fast Can we combine greedy and UCS??? YES: A*

  23. Greedy vs UCS UCS Image: Adapted from Berkeley CS188 course notes (downloaded Summer 2015)

  24. Greedy vs UCS UCS Greedy Image: Adapted from Berkeley CS188 course notes (downloaded Summer 2015)

  25. Greedy vs UCS UCS Greedy A* Image: Adapted from Berkeley CS188 course notes (downloaded Summer 2015)

  26. A* Image: Adapted from Berkeley CS188 course notes (downloaded Summer 2015)

  27. A* : a state : minimum cost from start to : heuristic at ( i.e. an estimate of remaining cost-to-go) UCS: expand states in order of Greedy: expand states in order of A*: expand states in order of

  28. A* What is “cost-to-go”? : a state : minimum cost from start to : heuristic at ( i.e. an estimate of remaining cost-to-go) UCS: expand states in order of Greedy: expand states in order of A*: expand states in order of

  29. A* What is “cost-to-go”? – minimum cost required : a state to reach a goal state : minimum cost from start to : heuristic at ( i.e. an estimate of remaining cost-to-go) UCS: expand states in order of Greedy: expand states in order of A*: expand states in order of

  30. A* g = 0 h=6 8 S g = 1 h=5 e h=1 a 1 1 3 2 g = 9 g = 2 h=6 g = 4 S a d G b d e h=1 h=2 h=6 h=5 1 h=2 h=0 1 g = 3 h=7 g = 6 g = 10 c b c G d h=0 h=2 h=7 h=6 g = 12 G h=0 A*: expand states in order of Slide: Adapted from Berkeley CS188 course notes (downloaded Summer 2015)

  31. When should A* terminate? Should we stop when we enqueue a goal? h = 2 A 2 2 S G h = 3 h = 0 2 3 B h = 1 No: only stop when we dequeue a goal Slide: Adapted from Berkeley CS188 course notes (downloaded Summer 2015)

  32. Is A* optimal? h = 6 1 3 A S h = 7 G h = 0 5 What went wrong? Actual cost-to-go < heuristic The heuristic must be less than the actual cost-to-go! Slide: Adapted from Berkeley CS188 course notes (downloaded Summer 2015)

  33. When is A* optimal? It depends on whether we are using the tree search or the graph search version of the algorithm. Recall: – in tree search, we do not track the explored set – in graph search, we do

  34. Recall: Breadth first search (BFS) What is the purpose of the explored set?

  35. When is A* optimal? It depends on whether we are using the tree search or the graph search version of the algorithm. Optimal if h is admissible Optimal if h is consistent

  36. When is A* optimal? It depends on whether we are using the tree search or the graph search version of the algorithm. Optimal if h is admissible Optimal if h is consistent – h(s) is an underestimate – h(s) is an underestimate of the true cost-to-go. of the cost of each arc.

  37. When is A* optimal? It depends on whether we are using the tree search or the graph search version of the algorithm. Optimal if h is admissible Optimal if h is consistent – h(s) is an underestimate – h(s) is an underestimate of the true cost-to-go. of the cost of each arc. What is “cost-to-go”? – minimum cost required to reach a goal state

  38. When is A* optimal? It depends on whether we are using the tree search or the graph search version of the algorithm. Optimal if h is admissible Optimal if h is consistent – h(s) is an underestimate – h(s) is an underestimate of the true cost-to-go. of the cost of each arc. More on this later...

  39. Admissibility: Example Stright-line distances to Bucharest h(s) = straight-line distance to goal state (Bucharest)

  40. Admissibility Stright-line distances to Bucharest h(s) = straight-line distance to goal state (Bucharest) Is this heuristic admissible???

  41. Admissibility Stright-line distances to Bucharest h(s) = straight-line distance to goal state (Bucharest) Is this heuristic admissible??? YES! Why?

  42. Admissibility: Example Start state Goal state h(s) = ? Can you think of an admissible heuristic for this problem?

  43. Admissibility h = 6 1 3 A S h = 7 G h = 0 5 Why isn't this heuristic admissible? Slide: Adapted from Berkeley CS188 course notes (downloaded Summer 2015)

  44. Consistency State space graph Search tree A S (0+2) 1 1 S h=4 C A (1+4) B (1+1) h=1 1 h=2 2 3 C (2+1) C (3+1) B h=1 G (5+0) G (6+0) G h=0 What went wrong? Slide: Adapted from Berkeley CS188 course notes (downloaded Summer 2015)

  45. Consistency Cost of going from s to s' s s'

  46. Consistency Rearrange terms

  47. Consistency Cost of going from s to s' implied by heuristic Actual cost of going from s to s'

  48. Consistency Cost of going from s to s' implied by heuristic Actual cost of going from s to s'

  49. Consistency Consistency implies that the “f-cost” never decreases along any path to a goal state. – the optimal path gives a goal state its lowest f-cost. A* expands states in order of their f-cost. Given any goal state, A* expands states that reach the goal state optimally before expanding states the reach the goal state suboptimally.

  50. Consistency implies admissibility Suppose: Then:

  51. Consistency implies admissibility Suppose: Then:

  52. Consistency implies admissibility Suppose: admissible Then:

  53. Consistency implies admissibility Suppose: Then:

  54. Consistency implies admissibility Suppose: Then: admissible

  55. Consistency implies admissibility Suppose: Then: admissible admissible

  56. Consistency implies admissibility Suppose: Then:

  57. A* vs UCS  Uniform-cost expands equally in all “directions” Start Goal  A* expands mainly toward the goal, but does Start Goal hedge its bets to ensure optimality Slide: Adapted from Berkeley CS188 course notes (downloaded Summer 2015)

  58. A* vs UCS Greedy UCS A* Slide: Adapted from Berkeley CS188 course notes (downloaded Summer 2015)

  59. Choosing a heuristic The right heuristic is often problem-specific. But it is very important to select a good heuristic!

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