Professional Documents
Culture Documents
Artificial Intelligence
Outline
Best-first search.
Greedy best-first search
A* search.
Characteristics of Heuristics
Variations of A*
Memory Bounded A*.
Online (Real Time) A*.
Local search algorithms
Hill-climbing search.
Simulated annealing search.
Gradient descent search.
Review: Tree Search
Implementation:
Order the nodes in fringe in decreasing order of
desirability.
Special cases:
greedy best-first search
A* search.
Best-First Search
Romania with step costs in km
Greedy Best-First 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.
Greedy Best-First Search example
Greedy Best-First Search example
Greedy Best-First Search example
Greedy Best-First Search example
Properties of Greedy BFS
If h is consistent, we have
f(n') = g(n') + h(n')
= g(n) + c(n,a,n') + h(n')
≥ g(n) + h(n)
= f(n)
i.e., f(n) is non-decreasing along any path.
Theorem: If h(n) is consistent, A* using GRAPH-SEARCH is optimal
Optimality of A*
A* expands nodes in order of increasing f value
h1(S) = ?
h2(S) = ?
Admissible Heuristics
E.g., for the 8-puzzle:
h (n) = number of misplaced tiles
1
h (n) = total Manhattan distance
2
(i.e., no. of squares from desired location of each tile)
h1(S) = ? 8
h2(S) = ? 3+1+2+2+2+3+3+2 = 18
Dominance
If h2(n) ≥ h1(n) for all n (both admissible)
then h2 dominates h1
h2 is better for search
Or
xk = xk + 1 – x k = kp k
xk +1
kp k
xk
pk - search direction
x k + 1 = xk – k g k
Example
2 2
F x = x1 + 2 x1 x 2 + 2x 2 + x1
x 0 = 0.5 = 0.1
0.5
F x
F x =
x1
=
2x 1 + 2x2 + 1 g0 = F x = 3
x= x0 3
2x 1 + 4x 2
F x
x2
-1
-2
-2 -1 0 1 2
Simulated Annealing Search
Idea: escape local maxima by allowing some
"bad" moves but gradually decrease their
frequency
Properties of SA Search
One can prove: If T decreases slowly enough,
then simulated annealing search will find a global
optimum with probability approaching 1.