Professional Documents
Culture Documents
Objectives
To Answer Explain A* algorithm in detail Comparison with Best First/Hill Climbing Problems of overestimating & Underestimating h(n) Admissibility condition in A* Compare A* and AO*
Evaluation Function : a value that estimates how far a particular node is from the goal.
Cost Function : how much resources like time, money, energy have been spent in reaching a particular node from start. The sum of the evaluation function value and the cost along the path leading to that state is called as Fitness number
In Best first search we used Evaluation function alone but in A* we decide the next state to be selected based upon both Evaluation function and Cost Function.
For state space tree problems g(n) = g(n) Therefore, heuristic function for state space tree problem f(n)=g(n)+h(n)
By introducing g(n) into f(n) we will not be always choosing the node to expand that appears to be the closest to the goal.
A* can be used when we need to find a minimal-cost overall path or simply any path as quickly as possible.
h(n) is a measure of the cost of getting from the node to a solution. Therefore good nodes get low values and bad nodes get high values.
What happens if h(n) is neither perfect nor zero? Two possibilities
h(n) underestimates h(n) h(n) overestimates h(n)
h Underestimating h
h overestimating h
4+1
C
5+1
D
Algorithm For A*
1: Put the initial node on a list OPEN 2: If ( OPEN is empty ) or ( OPEN = GOAL) terminate search. 3: Remove the first node from OPEN. Call this node a. 4: If (a=GOAL) terminate search with success. 5: Else if node a has successors, generate all of them. Estimate the fitness number of the successors by totaling the evaluation function value and cost-function value. Sort the list by fitness number. 6: Name the new list as CLOSED 7: Replace OPEN with CLOSED 8: Goto Step 2.
Only if these three conditions are satisfied A* is guaranteed to find an optimal(least) cost path.