Download presentation
Presentation is loading. Please wait.
Published byAvice Ward Modified over 8 years ago
1
Informed Search Strategies Lecture # 8 & 9
2
Outline 2 Best-first search Greedy best-first search A * search Heuristics
3
Introduction 3 So far, we have looked at different blind search strategies. Uninformed search strategies look for solutions by systematically generating new states and checking each of them against the goal. This approach is very inefficient in most cases. Most successor states are “obviously” a bad choice. Such strategies do not know that because they have minimal problem- specific knowledge. Using problem-specific knowledge can dramatically improve the search speed. Informed search strategies exploit problem-specific knowledge as much as possible to drive the search. At the heart of such algorithms there is the concept of a heuristic function.
4
Heuristics 4 “Heuristics are criteria, methods or principles for deciding which among several alternative courses of action promises to be the most effective in order to achieve some goal”. In heuristic search or informed search, heuristics are used to identify the most promising search path. Heuristics can estimate the “goodness” of a particular node (or state) n: How close is n to a goal node? What might be the minimal cost path from n to a goal node? h(n) = estimated cost of the cheapest path from node n to a goal node
5
Example of Heuristic Function 5 8-puzzle: (i) Misplaced Tiles Heuristics: - number of tiles out of place. The first picture shows the current state n, and the second picture the goal state. h(n) = 5 : because the tiles 2, 8, 1, 6 and 7 are out of place. (ii) Manhattan Distance Heuristic: This heuristic sums the distance that the tiles are out of place. The distance of a tile is measured by the sum of the differences in the x-positions and the y-positions. h(n) = 1 + 1 + 0 + 0 + 0 + 1 + 1 + 2 = 6
6
Best First Search 6 The algorithm maintains a priority queue of nodes to be explored. A cost function f(n) is applied to each node. The nodes are put in OPEN in the order of their f values. Nodes with smaller f(n) values are expanded earlier. The generic best first search algorithm is outlined on next slide Special cases: greedy search A ∗ search
7
Best Search Algorithm 7 We will now consider different ways of defining the function f. This leads to different search algorithms.
8
Greedy best-first Search 8 In greedy search, the idea is to expand the node with the smallest estimated cost to reach the goal. We use a heuristic function f(n) = h(n) h(n) estimates the distance remaining to a goal. Greedy algorithms often perform very well. They tend to find good solutions quickly, although not always optimal ones. Considering an example of a route finding problem: S is the starting state, G is the goal state. A good heuristic for the route-finding problem would be straight-line distance to the goal.
9
Greedy best-first Search 9 The straight line distance heuristic estimates for the nodes are shown in the following figure:
10
Illustration of Greedy Search Example 10
11
Greedy best-first Search 11 The algorithm is not optimal. The algorithm is also incomplete, and it may fail to find a solution even if one exists. This can be seen by running greedy search on the following example – using straight-line distance heuristic for the route- finding problem
12
12 The nodes expanded are expanded in following order: A, B, E, G, H --- and the path obtained is A-B-E-G-H with its path cost 99 … Where as path A-B-C-F-H is optimal with cost 39.
13
Example 13
14
Properties of greedy best-first search 14 Complete? No – can get stuck in loops, Time? O(b m ), but a good heuristic can give dramatic improvement Space? O(b m ) -- keeps all nodes in memory Optimal? No
15
A * search 15 A best-first search algorithm by Nilsson & Rafael in 1968 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 from n to goal f(n) = estimated total cost of path through n to goal
16
Example 16
17
A* Example 17
18
18
19
19
20
20
21
21
22
22
23
23
24
Admissible heuristics 24 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, i.e., it is optimistic Example: h SLD (n) (never overestimates the actual road distance) Theorem: If h(n) is admissible, A * using TREE-SEARCH is optimal
25
Properties of A * 25 Complete? Yes (unless there are infinitely many nodes with f ≤ f(G) ) Time? Exponential Space? Keeps all nodes in memory Optimal? Yes
26
Properties of Heuristics 26 Dominance: h2 is said to dominate h1 iff h2(n) ≥ h1(n) for any node n. A* will expand fewer nodes on average using h2 than h1.
27
Using multiple heuristics 27 Suppose you have identified a number of non-overestimating heuristics for a problem: h1(n), h2(n), …, hk(n) Then max (h1(n), h2(n), …, hk(n)) is a more powerful non-overestimating heuristic. This follows from the property of dominance
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.