1 / 28

Find a Path

4. A. B. C. 4. 3. 5. 5. s. G. 4. 3. F. D. E. 2. 4. Find a Path. Heuristically Informed Methods. Which node do I expand next? What information can I use to guide this decision? Hill Climbing Beam Search Best First Search. 4. A. B. C. 4. 3. 5. 5. s. G. 4. 3. F. D.

long
Download Presentation

Find a Path

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. 4 A B C 4 3 5 5 s G 4 3 F D E 2 4 Find a Path

  2. Heuristically Informed Methods • Which node do I expand next? • What information can I use to guide this decision? • Hill Climbing • Beam Search • Best First Search

  3. 4 A B C 4 3 5 5 s G 4 3 F D E 2 4 Hill Climbing A B C 10.4 6.7 4 11.0 s G 8.9 3 6.9 F D E

  4. Hill Climbing • Heuristic: Straight line distance to goal • Sort new paths, if any, by the estimated distances between their terminal nodes and the goal • Add the new paths to the FRONT of the Q

  5. Hill Climbing Problems • Local optima • Uninformative landscape (plateaus) • Uninformed movement operator (ridge) • Consider parameter tuning • Thermostat, television, mountain climbing

  6. Beam Search • BFS, but only the the best W (beam size) nodes at each level are expanded. • Beam search will only consider w nodes per level. No exponential explosion.

  7. Best-First Search • Expand best next node • Resort the ENTIRE Q by heuristic after every expansion

  8. Optimal Search • Finding the best path • Find all paths and choose the best • What’s the problem?

  9. Branch and Bound • Extend the shortest partial path • When you find a path, you must extend all partial paths until their lengths are longer than the path you found, or you find a shorter path

  10. B&B • Form a one-element queue containing the root node • Until the first path in the queue terminates at the goal node or the queue is empty • Remove the first path from the queue, create new paths by extending the first path to all the neighbors of the terminal node • Reject all new paths with loops • Add the remaining new paths, if any, to the queue • Sort the entire queue by path length with the least-cost paths in front • If the goal node is found, announce success; otherwise failure

  11. Underestimates • In addition to partial path length, let us also use distance remaining • Distance remaining is an admissable heuristic • It always underestimates the true remaining distance. Why is this property important?

  12. Underestimates help • E(total path length) = D(already travelled) + E(remaining distance) • What if your estimate is wrong? • Overestimate • Underestimate • Other

  13. Underestimates • Overestimate: you could hide the optimal path • Underestimate: you will not miss finding the optimal path • Other: your mileage may vary

  14. B&B with underestimates • Form a one-element queue containing the root node • Until the first path in the queue terminates at the goal node or the queue is empty • Remove the first path from the queue, create new paths by extending the first path to all the neighbors of the terminal node • Reject all new paths with loops • Add the remaining new paths, if any, to the queue • Sort the entire queue by the sum of the path length and a lower bound estimate of the cost remaining, with least cost paths in front. • If the goal node is found, announce success; otherwise failure

  15. Dynamic Programming • Eliminate redundant paths that slow search efficiency • The dynamic programming principle • The best way through a particular, intermediate node is the best way to it, followed by the best way from it to the goal.

  16. B&B with DP • Form a one-element queue containing the root node • Until the first path in the queue terminates at the goal node or the queue is empty • Remove the first path from the queue, create new paths by extending the first path to all the neighbors of the terminal node • Reject all new paths with loops • Add the remaining new paths, if any, to the queue • If two or more paths reach a common node, delete all those paths except the one that reaches the common node with the min cost • Sort the entire queue by the path length with least cost paths in front. • If the goal node is found, announce success; otherwise failure

  17. A* Search • Branch and bound, with understimates, and using the dynamic programming principle

  18. B&B + underestimates + DP • Form a one-element queue containing the root node • Until the first path in the queue terminates at the goal node or the queue is empty • Remove the first path from the queue, create new paths by extending the first path to all the neighbors of the terminal node • Reject all new paths with loops • Add the remaining new paths, if any, to the queue • If two or more paths reach a common node, delete all those paths except the one that reaches the common node with the min cost • Sort the entire queue by the sum of the path length and a lower-bound estimate of the cost remaining, with least cost paths in front. • If the goal node is found, announce success; otherwise failure

  19. Game Trees • How do you represent a game situation in a search tree? • Minimax search • Alpha-Beta pruning • Tic-Tac-Toe, Chess

  20. Game Tree Original board New boards New boards

  21. Minimax search • Evaluation of board position summarized into a single number. • Positive numbers indicate favor to one player. • Negative numbers indicate favor to other player • Static evaluator evaluates board position, computes static evaluation score • Maximizing player, Minimizing player

  22. Minimax Example Max Min Max 2 7 1 8

  23. Minimax Procedure • If the limit of the search has been reached, compute the static value of the current position relative to the appropriate player. Report the result • Otherwise, if the level is a minimizing level, use MINIMAX on the children of the current position. Report the MINIMUM of the results • Otherwise, if the level is a maximizing level, use the MINIMAX on the children of the current position. Report the MAXIMUM of the results

  24. Alpha-Beta with Minimax • If you have an idea that is truly bad, do not take the time to see how truly awful it is

  25. Alpha-Beta Example Max Min Max 2 7

  26. Big Alpha-Beta example • Figure 6.4

  27. Heuristics for minimax • Progressive deepening • Heuristic continuation • Heuristic pruning

  28. Alpha-Beta effect • Best case analysis • 2b ^d/2 - 1 if d is even • B^(d+1)/2 - b^(d-1)/2 – 1 if d is odd • Does not change exponential explosion

More Related