170 likes | 197 Views
Informed Search. CS 171/271 (Chapter 4) Some text and images in these slides were drawn from Russel & Norvig’s published material. Search Strategies Revisited. Strategy defines order of node expansion
E N D
Informed Search CS 171/271 (Chapter 4) Some text and images in these slides were drawn fromRussel & Norvig’s published material
Search Strategies Revisited • Strategy defines order of node expansion • We can view BFS, Uniform-Cost, DFS, and others as strategies that select nodes according to an evaluation function • f(n): some measure on node n • Select the node with minimum f(n)
Search Strategies Revisited • Uninformed search • Evaluation function dependent on states and successor function only • Improvements achieved if repeated states are detected • Informed (heuristic) search • Problem-specific information may be incorporated in the evaluation function
Informed Search • Greedy Best-First Search • A* Search • Local Search Algorithms
Greedy Best-First Search • Strategy: expand node that is closest to goal • Based on a heuristic function on each node that represents closeness to goal • Closeness measure not necessarily accurate (of course!), but has some basis
Example 1: Route Finding • Straight-line distance heuristic • Direct distance from node to goal • Actual cost is not always this distance since not all nodes are connected by a straight line path • Practical significance • You have a map where straight-line distances are more obvious than the sums of connections
Example 2: 8-puzzle • Sum of Manhattan distances • Select the move that yields the minimum sum of distances of tiles from their goal positions (horizontal/vertical steps only) • Number of misplaced tiles • Select the move that renders a configuration with the fewest number of misplaced tiles
Sum of Manhattan distances: 3+1+2+2+2+3+3+2 = 18 Sum of misplaced tiles: 8
About Greedy Best-First Search • Not always optimal/complete • Completeness depends on heuristic • Example? (see page 97) • Implementation requires a priority queue • Uninformed (and Informed) Search Algorithms are in fact special cases of Greedy Best-First search
A* Search • Greedy Best-First Search where the evaluation function is g(n) + h(n) • Guaranteed to be optimal as long as h is admissible heuristic: node to goal cost to reach node
Admissible Heuristics • A heuristic is admissible if it never overestimates the cost to reach the goal • Examples • Straight-line distance • Manhattan distance • Number of misplaced tiles • Note: a relaxed version of a problem yields an admissible heuristic
Local Search • Most appropriate when the path-cost is not relevant • Strategy: start with an initial complete state, and then improve incrementally • Example: n-queens • use complete-state formulation instead of incremental formulation • Repeatedly move to a successor (move a queen within a column) that has the fewest queen-pairs that attack each other (hill-climbing)
Climb Illustration Number of “hostile” queen-pairs: 17 Several possible moves improve this measure to 12
Getting Stuck in aLocal Maximum Not a goal state but improvement is not possible
Escaping Local Maxima • Simulated Annealing • Select successors randomly • Allow “downhill” moves in early iterations • Local Beam Search • Keep k states instead of just one • Choose top states from all successors • Mimics natural selection (survival of the fittest)