informed search algorithms and beyond
play

Informed Search Algorithms and Beyond R&N 3.53.6, 4.1 Jacques - PowerPoint PPT Presentation

N I V E U R S E I H T T Y O H F G R E U D I B N Informed Search Algorithms and Beyond R&N 3.53.6, 4.1 Jacques Fleuriot University of Edinburgh, School of Informatics jdf@ed.ac.uk Jacques Fleuriot Informed Search


  1. N I V E U R S E I H T T Y O H F G R E U D I B N Informed Search Algorithms and Beyond R&N 3.5–3.6, 4.1 Jacques Fleuriot University of Edinburgh, School of Informatics jdf@ed.ac.uk Jacques Fleuriot Informed Search Algorithms and Beyond, R&N 3.5–3.6, 4.1 1/26

  2. Overview N I V E U R S E I H T T Y O H F G R E U D I B N Review: General search Best-first search Greedy search A ∗ search Hill-climbing Simulated annealing Jacques Fleuriot Informed Search Algorithms and Beyond, R&N 3.5–3.6, 4.1 2/26

  3. Review: General search N I V E U R S E I H T T Y O H F G R E U D I B N function GENERIC-SEARCH( problem ) returns a solution, or failure frontier ← a queue initially containing one path, for the problem ’s initial state reached ← a table of { state : the best path that reached state } ; initially empty solution ← failure while frontier is not empty and solution can possibly be improved do parent ← some node that we choose to remove from frontier for child in successors( parent ) do s ← child .state if s is not in reached or child is a cheaper path than reached [ s ] then reached [ s ] ← child add child to frontier if child is a goal and is cheaper than solution then solution = child return solution Jacques Fleuriot Informed Search Algorithms and Beyond, R&N 3.5–3.6, 4.1 3/26

  4. Best-first search N I V E U R S E I H T T Y O H F G R E U D I B N Instance of general search search strategy Idea: use an evaluation function f ( n ) for each node n – estimate of “desirability” ⇒ Expand most desirable unexpanded node, usually the node with the lowest evaluation Implementation : Order the nodes in frontier in decreasing order of desirability Special cases: Greedy best-first search A ∗ search Jacques Fleuriot Informed Search Algorithms and Beyond, R&N 3.5–3.6, 4.1 4/26

  5. Romania with step costs in km N I V E U R S E I H T T Y O H F G R E U D I B N Straight−line distance Oradea to Bucharest 71 Neamt Arad 366 Bucharest 0 87 Zerind 151 Craiova 160 75 Dobreta Iasi 242 Arad Eforie 140 161 92 Fagaras 178 Sibiu 99 Fagaras Giurgiu 77 118 Hirsova 151 Vaslui 80 Iasi 226 Rimnicu Vilcea Lugoj 244 Timisoara Mehadia 241 142 211 111 Neamt 234 Pitesti 97 Lugoj Oradea 380 70 98 Pitesti 98 Hirsova 146 85 101 Rimnicu Vilcea 193 Mehadia Urziceni Sibiu 86 253 75 138 Timisoara Bucharest 329 120 Dobreta Urziceni 80 90 Vaslui Craiova 199 Eforie Giurgiu Zerind 374 Jacques Fleuriot Informed Search Algorithms and Beyond, R&N 3.5–3.6, 4.1 5/26

  6. Greedy best-first search N I V E U R S E I H T T Y O H F G R E U D I B N Evaluation function h ( n ) (heuristic) = estimated cost of cheapest path from from state at node n to goal state Example: h SLD ( n ) = straight-line distance from n to Bucharest Greedy search expands the node that appears to be closest to goal Jacques Fleuriot Informed Search Algorithms and Beyond, R&N 3.5–3.6, 4.1 6/26

  7. Greedy search example N I V E U R S E I H T T Y O H F G R E U D I B N Jacques Fleuriot Informed Search Algorithms and Beyond, R&N 3.5–3.6, 4.1 7/26

  8. Greedy search example N I V E U R S E I H T T Y O H F G R E U D I B N Jacques Fleuriot Informed Search Algorithms and Beyond, R&N 3.5–3.6, 4.1 7/26

  9. Greedy search example N I V E U R S E I H T T Y O H F G R E U D I B N Jacques Fleuriot Informed Search Algorithms and Beyond, R&N 3.5–3.6, 4.1 7/26

  10. Greedy search example N I V E U R S E I H T T Y O H F G R E U D I B N Jacques Fleuriot Informed Search Algorithms and Beyond, R&N 3.5–3.6, 4.1 7/26

  11. Properties of greedy search N I V E U R S E I H T T Y O H F G R E U D I B N Complete? Time? Space? Optimal? Jacques Fleuriot Informed Search Algorithms and Beyond, R&N 3.5–3.6, 4.1 8/26

  12. Properties of greedy search N I V E U R S E I H T T Y O H F G R E U D I B N Complete? No – can get stuck in loops, e.g. Iasi → Neamt → Iasi → Neamt → Complete in finite space with repeated-state checking Time? Space? Optimal? Jacques Fleuriot Informed Search Algorithms and Beyond, R&N 3.5–3.6, 4.1 8/26

  13. Properties of greedy search N I V E U R S E I H T T Y O H F G R E U D I B N Complete? No – can get stuck in loops, e.g. Iasi → Neamt → Iasi → Neamt → Complete in finite space with repeated-state checking Time? O ( b m ), but a good heuristic can give dramatic improvement Space? Optimal? Jacques Fleuriot Informed Search Algorithms and Beyond, R&N 3.5–3.6, 4.1 8/26

  14. Properties of greedy search N I V E U R S E I H T T Y O H F G R E U D I B N Complete? No – can get stuck in loops, e.g. Iasi → Neamt → Iasi → Neamt → Complete in finite space with repeated-state checking Time? O ( b m ), but a good heuristic can give dramatic improvement Space? O ( b m )—keeps all nodes in memory Optimal? Jacques Fleuriot Informed Search Algorithms and Beyond, R&N 3.5–3.6, 4.1 8/26

  15. Properties of greedy search N I V E U R S E I H T T Y O H F G R E U D I B N Complete? No – can get stuck in loops, e.g. Iasi → Neamt → Iasi → Neamt → Complete in finite space with repeated-state checking Time? O ( b m ), but a good heuristic can give dramatic improvement Space? O ( b m )—keeps all nodes in memory Optimal? No Jacques Fleuriot Informed Search Algorithms and Beyond, R&N 3.5–3.6, 4.1 8/26

  16. A ∗ search N I V E U R S E I H T T Y O H F G R E U D I B N Idea: avoid expanding paths that are already expensive Evaluation function f ( n ) = g ( n ) + h ( n ) g ( n ) = cost so far to reach n h ( n ) = estimated cost to goal from n f ( n ) = estimated total cost of path through n to goal A ∗ is both complete and optimal if h ( n ) satisfies certain conditions Jacques Fleuriot Informed Search Algorithms and Beyond, R&N 3.5–3.6, 4.1 9/26

  17. A ∗ search example N I V E U R S E I H T T Y O H F G R E U D I B N Jacques Fleuriot Informed Search Algorithms and Beyond, R&N 3.5–3.6, 4.1 10/26

  18. A ∗ search example N I V E U R S E I H T T Y O H F G R E U D I B N Jacques Fleuriot Informed Search Algorithms and Beyond, R&N 3.5–3.6, 4.1 10/26

  19. A ∗ search example N I V E U R S E I H T T Y O H F G R E U D I B N Jacques Fleuriot Informed Search Algorithms and Beyond, R&N 3.5–3.6, 4.1 10/26

  20. A ∗ search example N I V E U R S E I H T T Y O H F G R E U D I B N Jacques Fleuriot Informed Search Algorithms and Beyond, R&N 3.5–3.6, 4.1 10/26

  21. A ∗ search example N I V E U R S E I H T T Y O H F G R E U D I B N Jacques Fleuriot Informed Search Algorithms and Beyond, R&N 3.5–3.6, 4.1 10/26

  22. A ∗ search example N I V E U R S E I H T T Y O H F G R E U D I B N Jacques Fleuriot Informed Search Algorithms and Beyond, R&N 3.5–3.6, 4.1 10/26

  23. Admissible heuristics N I V E U R S E I H T T Y O H F G R E U D I B N A heuristic h ( n ) is admissible if for every node n , h ( n ) ≤ h ∗ ( n ), where h ∗ ( n ) is the true cost to reach the goal state from n. A ∗ search uses an admissible heuristic An admissible heuristic never overestimates the cost to reach the goal, i.e., it is optimistic. Thus for A ∗ , f ( n ) = g ( n ) + h ( n ) never overestimates the true cost of a solution. Example: h SLD ( n ) never overestimates the actual road distance. Theorem : A ∗ search is optimal Jacques Fleuriot Informed Search Algorithms and Beyond, R&N 3.5–3.6, 4.1 11/26

  24. Optimality of A ∗ (standard proof) N I V E U R S E I H T T Y O H F G R E U D I B N Suppose some suboptimal goal G 2 has been generated and is in the frontier. Let n be an unexpanded node in the frontier such that n is on a shortest path to an optimal goal G . Start n G G 2 f ( G 2 ) = g ( G 2 ) since h ( G 2 ) = 0 g ( G ) since G 2 is suboptimal > f ( G ) = g ( G ) since h ( G ) = 0 f ( G 2 ) f ( G ) from above > Jacques Fleuriot Informed Search Algorithms and Beyond, R&N 3.5–3.6, 4.1 12/26

  25. Optimality of A ∗ (standard proof) N I V E U R S E I H T T Y O H F G R E U D I B N Suppose some suboptimal goal G 2 has been generated and is in the frontier. Let n be an unexpanded node in the frontier such that n is on a shortest path to an optimal goal G . Start n G G 2 f ( G 2 ) f ( G ) from above > h ∗ ( n ) h ( n ) since h is admissible ≤ g ( n ) + h ∗ ( n ) g ( n ) + h ( n ) ≤ f ( n ) f ( G ) ≤ Jacques Fleuriot Informed Search Algorithms and Beyond, R&N 3.5–3.6, 4.1 12/26

  26. Optimality of A ∗ (standard proof) N I V E U R S E I H T T Y O H F G R E U D I B N Suppose some suboptimal goal G 2 has been generated and is in the frontier. Let n be an unexpanded node in the frontier such that n is on a shortest path to an optimal goal G . Start n G G 2 Hence f ( G 2 ) > f ( n ), and A ∗ will never select G 2 for expansion Jacques Fleuriot Informed Search Algorithms and Beyond, R&N 3.5–3.6, 4.1 12/26

Recommend


More recommend