A - Algorithm - A - Algorithm Example in AI - Gate Vidyalay
A - Algorithm - A - Algorithm Example in AI - Gate Vidyalay
AI
Artificial Intelligence
A* Algorithm-
Working-
Here,
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:
Step-03:
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.
Problem-01:
Solution-
Problem-02:
Solution-
Step-01:
f(B) = 6 + 8 = 14
f(F) = 3 + 6 = 9
Path- A → F
Step-02:
f(G) = (3+1) + 5 = 9
f(H) = (3+7) + 3 = 13
Path- A → F → G
Step-03:
f(I) = (3+1+3) + 1 = 8
It decides to go to node I.
Path- A → F → G → I
Step-04:
Node E, Node H and Node J can be reached from node
I.
f(E) = (3+1+3+5) + 3 = 15
f(H) = (3+1+3+2) + 3 = 12
f(J) = (3+1+3+3) + 0 = 10
Path- A → F → G → I → J
Important Note-
To gain better understanding about A* Search
Algorithm,
Summary
Publisher Logo