Module 2_AIDS1_BFS
Module 2_AIDS1_BFS
Here,
‘n’ is the last node on the path
g(n) is the cost of the path from start node to node ‘n’
h(n) is a heuristic function that estimates cost of the cheapest path from node ‘n’ to the goal
node
Algorithm-
The implementation of A* Algorithm involves maintaining two lists- OPEN and CLOSED.
OPEN contains those nodes that have been evaluated by the heuristic function but have not
been expanded into successors yet.
CLOSED contains those nodes that have already been visited.
Step-01:
Step-02:
Remove node n with the smallest value of f(n) from OPEN and move it to list CLOSED.
If node n is a goal state, return success and exit.
Step-04:
Expand node n.
Step-05:
If any successor to n is the goal node, return success and the solution by tracing the path
from goal node to S.
Otherwise, go to Step-06.
Step-06:
Step-07:
Go back to Step-02.
Solution-
Step-01:
Step-02:
Path- A → F → G
Step-03:
Path- A → F → G → I
Step-04:
Path- A → F → G → I → J