Presentation is loading. Please wait.

Presentation is loading. Please wait.

Chapter 3.5 Heuristic Search. Learning Objectives Heuristic search strategies –Best-first search –A* algorithm Heuristic functions.

Similar presentations


Presentation on theme: "Chapter 3.5 Heuristic Search. Learning Objectives Heuristic search strategies –Best-first search –A* algorithm Heuristic functions."— Presentation transcript:

1 Chapter 3.5 Heuristic Search

2 Learning Objectives Heuristic search strategies –Best-first search –A* algorithm Heuristic functions

3 So let’s try it again… Consider a state space where the start state is number 1 and the successor function for state n returns two states, numbers 2n and 2n+1. –Suppose the goal state is 11. List the order in which nodes will be visited in depth limited search with limit 3 For iterative deepening.

4 Solution Depth Limited, l=3 –1, 2, 4, 8, 16, 17, 9, 18, 19, 5, 10, 20, 21, 11 Iterative Deepening –1, 1, 2, 3, 1, 2, 4, 5, 3, 6, 7, 1, 2, 4, 8, 9, 5, 10, 11

5 Review Review: tree search a strategy is defined by picking the order of node expansion

6 Summary of algorithms

7 7 Bidirectional Search

8 Review Review: tree search a strategy is defined by picking the order of node expansion Even when we try to use knowledge about the problem (uniform cost search) we are limited to what we have “learned” This makes it a “backward looking” search.

9 But, when I ask you to get from Arad to Bucharest, what do you do?

10 Heuristic Search Heuristic searches use knowledge about the problem to include “forward looking” information. That is, which move do I THINK would get me closest to the goal.

11 Heuristic Search Best-first search: use an evaluation function for each node –Estimate of “desirability” –Expand most desirable unexpanded node –Implementation: fringe is a queue sorted in decreasing order of desirability –Special cases: Greedy search A* search

12 Heuristic Search Romania with step costs in km

13 Heuristic Search Greedy search –Evaluation function h(n) (heuristic) = estimate of cost from n to closest goal –Example: h SLD (n) = straight-line distance from n to Bucharest –Greedy search expands the node that appears to be closest to goal

14 Heuristic search Greedy search example

15 Heuristic Search Greedy search example

16 Heuristic Search Greedy search example

17 Heuristic Search Properties of greedy search –Complete??

18 Heuristic Search Complete?? No – can get stuck in loops, e.g., start in Iasi with Oradea as goal…. Iasi  Neamt  Complete in finite space with repeated-state checking

19 Heuristic Search Properties of greedy search –Complete?? No – can get stuck in loops, e.g., Complete in finite space with repeated-state checking –Time??

20 Heuristic Search Properties of greedy search –Complete?? No – can get stuck in loops, e.g., Complete in finite space with repeated-state checking –Time?? O(b m ), but a good heuristic can give dramatic improvement

21 Heuristic Search Properties of greedy search –Complete?? No – can get stuck in loops, e.g., Complete in finite space with repeated-state checking –Time?? O(b m ), but a good heuristic can give dramatic improvement –Space??

22 Heuristic Search Properties of greedy search –Complete?? No – can get stuck in loops, e.g., 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

23 Heuristic Search Properties of greedy search –Complete?? No – can get stuck in loops, e.g., 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??

24 Heuristic Search Properties of greedy search –Complete?? No – can get stuck in loops, e.g., 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

25 Heuristic Search A* search –Premise - Avoid expanding paths that are already expansive –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

26 Heuristic Search A* search –A* search uses an admissible heuristic i.e., h(n)  h*(n) where h*(n) is the true cost from n. (also require h(n)  0, so h(G) = 0 for any goal G.) example, h SLD (n) never overestimates the actual road distance.

27 Heuristic Search A* search example

28 Heuristic Search A* search example

29 Heuristic Search A* search example

30 Heuristic Search A* search example

31 Heuristic Search A* search example

32 Heuristic Search Properties of A* –Complete?? Yes, unless there are infinitely many nodes with f  f(G) –Time?? Exponential in [relative error in h x length of solution.] –Space?? Keeps all nodes in memory –Optimal?? Yes – cannot expand f i+1 until f i is finished A* expands all nodes with f(n) C*


Download ppt "Chapter 3.5 Heuristic Search. Learning Objectives Heuristic search strategies –Best-first search –A* algorithm Heuristic functions."

Similar presentations


Ads by Google