Presentation is loading. Please wait.

Presentation is loading. Please wait.

Informed Search.

Similar presentations


Presentation on theme: "Informed Search."— Presentation transcript:

1 Informed Search

2 Informed Search Strategies
uses problem-specific knowledge beyond the definition of the problem itself Greedy best-first search A* search

3 Romania with step costs in km

4 Informed Search Idea: use an evaluation function f(n) for each node
estimate of "desirability" Expand most desirable unexpanded node Implementation: Order the nodes in frontier in decreasing order of desirability Special cases: greedy best-first search A* search

5 Greedy best-first search
Evaluation function f(n) = h(n) (heuristic) = estimate of cost from n to goal e.g., hSLD(n) = straight-line distance from n to Bucharest Greedy best-first search expands the node that appears to be closest to goal

6 Romania with step costs in km

7 Greedy best-first search example

8 Greedy best-first search example

9 Greedy best-first search example

10 Greedy best-first search example

11 Properties of greedy best-first search
Complete? Yes Optimal? No Time? O(bm), but a good heuristic can give dramatic improvement Space? O(bm)

12 A* search Best-known form of informed search.
Idea: avoid expanding paths that are already expensive Evaluation function f(n) = g(n) + h(n) f(n) = estimated total cost of path through n to goal g(n) = cost so far to reach n h(n) = estimated cost from n to goal

13 A* search Conditions for optimality: Admissibility Consistency

14 Admissible heuristics
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. An admissible heuristic never overestimates the cost to reach the goal Example: hSLD(n) (never overestimates the actual road distance)

15 Consistency (Monotonicity)
A heuristic h(n) is consistent if, for every node parent and every successor child of parent, h(parent) <= c(parent->child) + h(child) triangle inequality

16 Romania with step costs in km

17 A* search example

18 A* search example

19 A* search example

20 A* search example

21 A* search example

22 A* search example

23 A* Search Optimal Time Complete Yes
The better the heuristic, the better the time Best case h is perfect, O(d) Worst case h = 0, O(bd) same as Uniform Cost Search Space O(bd)

24 Heuristic Functions To use A* a heuristic function must be used that never overestimates the number of steps to the goal

25 Heuristic Function Function h(N) that estimates the cost of the path from node N to goal node. Example: 8-puzzle 1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 8 h1(N) = number of misplaced tiles = 6 N goal

26 Manhattan distances

27 Heuristic Function Function h(N) that estimate the cost of the path from node N to goal node. Example: 8-puzzle h2(N) = sum of the distances of every tile to its goal position = = 13 1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 8 N goal

28 8-Puzzle f(N) = h1(N) = number of misplaced tiles 3 4 3 4 5 3 3 4 2 4
4 4 2 1

29 8-Puzzle f(N) = g(N) + h1 (N) with h1(N) = number of misplaced tiles
3+3 3+4 1+5 1+3 2+3 2+4 5+2 5+0 0+4 3+4 3+2 4+1

30 8-Puzzle f(N) = h2(N) =  distances of tiles to goal 6 4 5 3 2 5 4 2 1

31 8-Puzzle EXERCISE: f(N) = g(N) + h2(N)
with h2(N) =  distances of tiles to goal 0+4

32 Heuristic quality and dominance
1200 random problems with solution lengths from 2 to 24. h2 dominates h1 and is better for search

33 Relaxed problems 1 2 3 4 5 6 7 8 A problem with fewer restrictions on the actions is called a relaxed problem. The cost of an optimal solution to a relaxed problem is an admissible heuristic for the original problem If the rules of the 8-puzzle are relaxed so that a tile can move anywhere, then h1(n) gives the shortest solution If the rules are relaxed so that a tile can move to any adjacent square, then h2(n) gives the shortest solution


Download ppt "Informed Search."

Similar presentations


Ads by Google