Astar
Astar
Algorithm:
Step 1: Place the starting node into OPEN and find its f (n) value.
Step 2: Remove the node from OPEN, having the smallest f (n) value. If it is a goal node then
stop and return success.
Step 3: Else remove the node from OPEN, find all its successors.
Step 4: Find the f (n) value of all successors; place them into OPEN and place the removed
node into CLOSE.
Step 5: Go to Step-2.
Step 6: Exit.
Program:
aStarAlgo('A', 'J')
Output:
Path Found : [‘A’, ‘F’, ‘G’, ‘I’, ‘J’]