Professional Documents
Culture Documents
A Algorithm
A Algorithm
com/tag/a-algorithm-for-8-puzzle-problem/
Working-
Here,
Algorithm-
1 of 8 9/12/2022, 4:44 PM
A* Algorithm for 8 Puzzle Problem | Gate Vidyalay https://www.gatevidyalay.com/tag/a-algorithm-for-8-puzzle-problem/
Step-01:
Step-02:
Step-03:
Step-04:
Expand node n.
Step-05:
2 of 8 9/12/2022, 4:44 PM
A* Algorithm for 8 Puzzle Problem | Gate Vidyalay https://www.gatevidyalay.com/tag/a-algorithm-for-8-puzzle-problem/
Step-06:
Step-07:
Go back to Step-02.
Problem-01:
Find the most cost-effective path to reach the final state from
3 of 8 9/12/2022, 4:44 PM
A* Algorithm for 8 Puzzle Problem | Gate Vidyalay https://www.gatevidyalay.com/tag/a-algorithm-for-8-puzzle-problem/
Solution-
Problem-02:
4 of 8 9/12/2022, 4:44 PM
A* Algorithm for 8 Puzzle Problem | Gate Vidyalay https://www.gatevidyalay.com/tag/a-algorithm-for-8-puzzle-problem/
Solution-
Step-01:
• f(B) = 6 + 8 = 14
• f(F) = 3 + 6 = 9
Path- A → F
5 of 8 9/12/2022, 4:44 PM
A* Algorithm for 8 Puzzle Problem | Gate Vidyalay https://www.gatevidyalay.com/tag/a-algorithm-for-8-puzzle-problem/
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:
• f(E) = (3+1+3+5) + 3 = 15
6 of 8 9/12/2022, 4:44 PM
A* Algorithm for 8 Puzzle Problem | Gate Vidyalay https://www.gatevidyalay.com/tag/a-algorithm-for-8-puzzle-problem/
• f(H) = (3+1+3+2) + 3 = 12
• f(J) = (3+1+3+3) + 0 = 10
Path- A → F → G → I → J
Important Note-
7 of 8 9/12/2022, 4:44 PM
A* Algorithm for 8 Puzzle Problem | Gate Vidyalay https://www.gatevidyalay.com/tag/a-algorithm-for-8-puzzle-problem/
LearnVidFun.
8 of 8 9/12/2022, 4:44 PM