6. Combining cost-so-far and heuristic function
• Since what we're really looking for is the optimal path
between the initial state, and some goal state, a better
measure of how promising a state is, is the sum of the
cost-so-far, and our best estimate of the cost from there to
the nearest goal state.
• For a state n, with a cost-so-far g(n), and a heuristic
estimate of the cost to goal of h(n), what we want is:
• f(n) = g(n) + h(n)
6
7. Algorithm A*
•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
•
•This proves to be a very effective strategy for controlling
state-space search. When used with best-first search, as a way
of sorting the agenda where the agenda is sorted so that the
states with the lowest values of f(n) come first, and are
therefore expanded first-> this is known as Algorithm A*.
8. A* Algorithm
H.C. and B.F. (given heuristics) can find solutions faster
than exhaustive searches.
However, it can’t tell whether the found solution is the
best one.
Problem:
The heuristic guides us to the good nodes but doesn’t give
enough information to guarantee we’ve found the optimum.
Solution: Branch and bound method
The cost of the path to a node serves as a lower bound on the
cost of the nodes below it.
We need a heuristic function ev(n,p) with this property to
guarantee optimum solution.
15. A* search and admissibility
• The choice of an appropriate heuristic evaluation
function, h(n), is still crucial to the behaviour of the
search algorithm.
• In general, we want to choose a heuristic evaluation
function h(n) which is as close as possible to the
actual cost of getting to a goal state.
• A heuristic is admissible if it never overestimates the
cost to the goal.
16. • The A* algorithm always finds the optimal solution
path whenever a path from the start to a goal state
exists.
• When the agenda is sorted according to the function
f(n) = g(n) + h(n) and where the function h(n) is
admissible, can be proven to always find an optimal
solution.
17. Dominance
• We say that a search strategy which searches less of the
state-space in order to find a goal state is more informed.
Ideally, we'd like a search strategy which is both admissible
(so it will find us an optimal path to the goal state), and
informed (so it will find the optimal path quickly.)
• Admissibility requires that the heuristic evaluation function,
h(n) doesn't overestimate, but we do want a function which
is as close as possible to the actual cost of getting to the
goal.
18. Admissible
Heuristics
• Finding heuristics:
• Relaxing the problem restrictions (simplifying the problem), e.g. the
rules for moving tiles.
• Learning heuristics from experience: learning a function as weighted
sum of features (quantitative properties of the states).
• e.g. 8’s puzzle
• Number of tiles out of place
• h1= the number of tiles that are in the wrong position. This is
admissible because any tile that is out of place must be moved
at least once.
2 8
1 6 4
7 5
1 2 3
8 4
7 6 5
(4)
3
27. Inexact Search
When all leaf nodes are feasible(even some are
better than others), H.C. needs no backtracking.
We then must use Forgetful H.C.
Forgetful H.C.: keeps track of current node
and forget where we’ve been [no open list].
28. Why Inexact Search
• As the search space become very large
(exhaustive) even when guided by
heuristics it’ll be impractical.
29. Blind Search VS Heuristic Search
• Blind Search:
Very basic. Follow an algorithm, taking no
account of how close we might be to a
solution.
• Informed (Heuristic) Search:
Uses guesses, rules to aid the search.
It involves making an estimate of how far we
are from a solution after each possible next
move & going to the move with the lowest
estimate.
30. Informed Search Summary
• Best-first search
Is general search where the minimum cost nodes (according to some measure)
are expanded first.
• Hill-climbing search
• When chose to follow a node, it continues to do so in depth first way.
• Even though the children of the node(say a) has heuristic information worst
than that for a node in the same level of node (say a).
• Forgetful Hill-climbing search
keep only a single state in memory, but can get stuck on local optima.
31. A* search
• A* algorithm is a modified form of best first algorithm.
• It is a branch and bound method with cost associated by path.
• It’s used in path problems where the cost of a path is the sum of the costs of the
moves.
• Guarantee to find best solution.
• f(n) = g(n) + h(n) and handles state repetitions and h(n) never overestimates.
• A* is complete, optimal and optimally efficient but its space complexity is still bad.