The objective of the game is to shift all the disks from different bars into a single bar, as shown in the right figure 1(b), following these rules:
Only one disk can be moved at a time.
Only the uppermost disk can be moved
The disk can be moved either to the top of another stack or to an empty bar.
Only smaller disks can be moved to larger disks.
I need help to solve it depending on the rules. The deadline is after 5 hours and I couldn’t solve it due a family funeral.
so far I got BFS
Frontier: Tree:
1
2
3
Explored list: 1, 2, 3 Cost: 3
Solution path: 1, 2, 3, 4
DFS
Frontier: Tree:
1
2
3
4
Explored list: 1, 2, 3 Cost: 3
Solution path: 1, 2, 3, 4