Introduction to Artificial Intelligence Lecture 6 Blind Search
Introduction to Artificial Intelligence Lecture # 6
Blind Search vs. Informed Search • In blind search (also called an uninformed search) has no information about its domain. The only thing that a blind search can do is distinguish a nongoal state from a goal state. • In informed search a node is selected for expansion based on an evaluation function that estimates cost to goal in informed search.
Heuristic Search • Heuristic or informed search exploits additional knowledge about the problem that helps direct search to more promising paths. • A heuristic function, h(n), provides an estimate of the cost of the path from a given node to the closest goal state. Must be zero if node represents a goal state. • Example: Straight-line distance from current location to the goal location in a road navigation problem.
Heuristic Search Informed Methods Add Domain-Specific Information • • • Add domain-specific information to select what is the best path to continue searching along Define a heuristic function, h(n), that estimates the "goodness" of a node n. • Specifically, h(n) = estimated cost (or distance) of minimal cost path from n to a goal state. The term heuristic means "serving to aid discovery" and is an estimate, based on domain-specific information that is computable from the current state description, of how close we are to a goal
Informed Search • h(n) >= 0 for all nodes n • h(n) = 0 implies that n is a goal node • h(n) = infinity implies that n is a dead-end from which a goal cannot be reached • All domain knowledge used in the search is encoded in the heuristic function h.
Characteristics of heuristics: • Allow to reduce the number of states considering during search • Demand additional information about the quality of states in a state space • Can lead to the best solution, but also can lead only to acceptable solution • Can be fallible, that is, do not find solution at all
Informed Methods • Best First search • A* Search • Hill Climbing
Best First Search • Use an evaluation function f(n) for node n. • Always choose the node from fringe that has the lowest f value.
Best-first search • A search strategy is defined by picking the order of node expansion • Idea: use an evaluation function f(n) for each node – estimate of "desirability“ • Expand most desirable unexpanded node • Implementation: Order the nodes in fringe in decreasing order of desirability
Best-first search • Evaluation function f(n) = h(n) (heuristic) = estimate of cost from n to goal e. g. , h. SLD(n) = straight-line distance from n to Bucharest • Greedy best-first search expands the node that appears to be closest to goal
Example
Example
Solution (Best First Search) Does not find shortest path to goal (through Rimnicu) since it is only focused on the cost remaining rather than the total cost.
A* Search • 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
Example
A* for Romanian Shortest Path
Hill climbing • Hill climbing expands the current node, located in the OPEN list, and evaluates its direct descendants. • On the basis of heuristic values of the descendants, the best one of them is selected for further expansion, but others are placed in the CLOSED list. • Search finishes when the node whose heuristic value is better than values of its descendants is found, or the goal is reached or the terminal node which is not the goal is reached. Note: The OPEN list always contains only one node
Hill Climbing (Data Driven)
Hill Climbing (Goal Driven)
Hill Climbing (Data Driven)
Admissible heuristics • • • If the heuristic function always underestimates the distance to the goal, it is said to be admissible. If h is admissible, then f(n) never overestimates the actual cost of the best solution through n. 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 over-estimates 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
Admissible heuristics E. g. , for the 8 -puzzle: • h 1(n) = number of misplaced tiles • h 2(n) = total Manhattan distance (i. e. , no. of squares from desired location of each tile) • h 1(S) = ? • h 2(S) = ?
Admissible heuristics E. g. , for the 8 -puzzle: • h 1(n) = number of misplaced tiles • h 2(n) = total Manhattan distance (i. e. , no. of squares from desired location of each tile) • h 1(S) = ? 8 • h 2(S) = ? 3+1+2+2+2+3+3+2 = 18
Dominance • If h 2(n) ≥ h 1(n) for all n (both admissible) then h 2 dominates h 1 • h 2 is better for search: it is guaranteed to expand less or equal number of nodes. Typical search costs (average number of nodes expanded): • d=12 • d=24 A*(h 1) = 227 nodes A*(h 2) = 73 nodes A*(h 1) = 39, 135 nodes A*(h 2) = 1, 641 nodes
- Slides: 27