A* algorithm refers to the form of the Best first search. This finds the shortest path using the heuristic function with the cost function for reaching the end node. The steps are:
Step 1
Place the first node in the OPEN list.
Step 2
Inspect if the OPEN list is empty or not. However, if the list is empty, then return failure and stops.
Step 3
Select the node from the OPEN list with the smallest value of the evaluation function (g+h). However, if node n is goal node then return success and stop, otherwise
Step 4
Enlarge node n and create all of its successors, and place n into the closed list. For each successor n’, examine whether n’ is already in the OPEN or CLOSED list. However, if not, then compute the evaluation function for n’ and place it into the Open list.
Step 5
Else if node n’ is already in the OPEN and CLOSED list, then it should be attached to the back pointer, which reflects the lowest g(n’) value.
Step 6:
Go back to Step 2.