Informed Search
Informed Search Strategies uses problem-specific knowledge beyond the definition of the problem itself Greedy best-first search A* search
Romania with step costs in km
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
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
Romania with step costs in km
Greedy best-first search example
Greedy best-first search example
Greedy best-first search example
Greedy best-first search example
Properties of greedy best-first search Complete? Yes Optimal? No Time? O(bm), but a good heuristic can give dramatic improvement Space? O(bm)
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
A* search Conditions for optimality: Admissibility Consistency
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)
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
Romania with step costs in km
A* search example
A* search example
A* search example
A* search example
A* search example
A* search example
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)
Heuristic Functions To use A* a heuristic function must be used that never overestimates the number of steps to the goal
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
Manhattan distances
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 = 2 + 3 + 0 + 1 + 3 + 0 + 3 + 1 = 13 1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 8 N goal
8-Puzzle f(N) = h1(N) = number of misplaced tiles 3 4 3 4 5 3 3 4 2 4 4 4 2 1
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
8-Puzzle f(N) = h2(N) = distances of tiles to goal 6 4 5 3 2 5 4 2 1
8-Puzzle EXERCISE: f(N) = g(N) + h2(N) with h2(N) = distances of tiles to goal 0+4
Heuristic quality and dominance 1200 random problems with solution lengths from 2 to 24. h2 dominates h1 and is better for search
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