The Tower of Hanoi is a game (Artificial intelligence) BFS and DFS

34 Views Asked by At

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:

  1. Only one disk can be moved at a time.

  2. Only the uppermost disk can be moved

  3. The disk can be moved either to the top of another stack or to an empty bar.

  4. Only smaller disks can be moved to larger disks.

enter image description here

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

0

There are 0 best solutions below