Informed Search

Algorithms

Heuristic / Best First Search BFS algorighms use problem/domain-specific knowledge during search.

f(n)f^*(n)(unknown) true total cost from nn to goal

f(n)f(n)Evaluation function - estimation for f(n)f^*(n) , used for node expansion

g(n)g(n)Path cost from start to nn .

h(n)h(n)Heuristic function - estimated cost of the cheapest path from nn .

Function can not be computed from the problem itself.

Computing it must have a low cost.

Output must be 00 at the goal node.

Greedy BFS

Just like UCS but hh instead of gg for the priority queue ordering - does not take already spent costs into account.

f(n)=h(n)f(n) = h(n)

completeness No - only in finite state spaces with explored set

time complexityO(bm)O(b^m)

space complexityO(bm)O(b^m)

optimality of solution No

A* Search

Solves non-optimality and possibility of non-termination of greedy search.

Just like UCS - but g+hg+h for the priority queue.

f(n)=g(n)+h(n)f(n) = g(n) + h(n) where heuristic must be admissible.

completeness Yes - with finite nodes and bb , costs C\leq C^* , step-costs ε\geq \varepsilon

time complexityO(bεd)O(b^{\varepsilon d}) where bεb^\varepsilon is the effective branching factor with rel. error ε=hff\varepsilon = \frac{h - f^*}{f^*} .

space complexity Exponential, keeps all nodes in memory

optimality of solution Yes

  • non admissible h(n)h(n) for tree-search is not optimal (proof)

    SS \dots start node

    G,HG,H\dots goal nodes

    We immedeately expand non-optimal goal GG because h(G)=0h(G) = 0 although f(G)=5+0f(G) = 5+0 .

    Then we check f(T)=6+1f(T) = 6+1 and terminate search.

  • admissible h(n)h(n) for tree-search is optimal (proof)

    SS\dots start node

    GG\dots optimal goal node

    G2G_2\dots non goal node

    nn\dots unexpanded node on optimal path to GG

    Since there are no unexpanded nodes to G2G_2

    f(G2)=g(G2)+h(G2)f(G_2) = g(G_2) + h(G_2)

    f(G2)=g(G2)+0f(G_2) = g(G_2) + 0

    Because G2G_2 is suboptimal

    f(G2)=g(G2)>g(G)=g(n)+f(n) \textcolor{grey}{f(G_2) =} g(G_2) > g(G) \textcolor{grey}{= g(n)+ f^*(n)}  (cost to nn , and nn to goal)

    f(G2)>g(n)+f(n)f(G_2) > g(n)+ f^*(n)

    Because the heuristic is admissible

    f(G2)>g(n)+f(n)g(n)+h(n)=f(n) f(G_2) > g(n)+ f^*(n) \geq g(n)+ h(n)\textcolor{grey}{= f(n)} 

    f(G2)>f(n)f(G_2) > f(n)

    Therefore A* will never select G2G_2

  • consistent h(n)h(n) for graph search is optimal

    If h(n)h(n) decreases during optimal path to goal it is discarded by graph-search.

    (But in tree search it is not a problem since there is only a single path to the optimal goal).

    Solutions to problem:

    • consistency of hh (non decreasing ff on every path)
    • additional book-keeping

optimal efficiency Yes

A* expands the fewest nodes possible - no other optimal algorithm can expand fewer nodes than A* because not expanding nodes with f(n)<Cf(n) < C^* runs the risk of missing the optimal solution.

Heuristics

Admissibility

Optimistic, never overestimating, never negative.

h(n)f(n)h(n) \leq f^*(n)

h(n)0h(n) \geq 0

g\forall g goals: h(g)=0h(g)=0(follows from the above)

Deriving admissible heuristics

from exact solution cost of a relaxed version of the problem.

Because the optimal solution cost of a relaxed problem is \leq than the optimal solution cost of the real problem. The relaxation should be polynomially computable.

Consistency / Monotonicity

Every consistent heuristic is also admissible. Consistency is stricter than admissibility.

Implies that ff -value is non-decreasing on every path .

For every node nn and its successor nn' :

h(n)c(n,a,n)+h(n)h(n) \leq c(n,a,n') + h(n')

This is a form of the general triangle inequality.

ff is then non-decreasing along every path:

f(n)=g(n)+h(n)=g(n)+c(n,a,n)+h(n)f(n') = g(n') + h(n')= g(n) + {c(n, a,n') + h(n')}

f(n)=g(n)+c(n,a,n)+h(n)g(n)+h(n)=f(n) f(n') = g(n) + \textcolor{pink}{c(n, a,n') + h(n')} \geq g(n) +\textcolor{pink}{ h(n)} = f(n) (because of consistency)

f(n)f(n)f(n') \geq f(n)

Dominance

For two admissible heuristics, we say h2h_2 dominates h1h_1 , if:

n:h2(n)h1(n)\forall n: h_2(n) \geq h_1(n)

Then h2h_2 is better for search.

Local Search

For many (also optimization) problems, paths are irrelevant, only the solution matters.

The aim is an iterative improvement .

We define our state space: set of "complete" but not optimal configurations:

  1. keep a single "current" state - (constant space usage)
  1. try to improve it until goal state is reached - (optimal configuration)

Greedy local search

Also called "hill-climbing":

++ escaping shoulders

- getting stuck in loop at local maximum

Solution: Random-restart hill climbing: restart after step limit overcomes local maxima

Simulated annelaing

Devised in the 1950s for physical process modeling.

Corresponds to "cooling off" process of materials

Idea: Escaping local maxima by gradually allowing less "bad" moves in size and frequency.

Problem: "Slowly enough" can be worse than exhaustive search.

Local beam search

Idea

Problem

often, all kk states end up on same local hill

Solution

choose kk successors randomly, biased towards good ones

Genetic algorithms GA

Stochastic local beam search + successors from pairs of states