Solve 4 Pegs Hanoi Tower: Algorithm & Best Move Ideas

  • Thread starter Thread starter Stephanus
  • Start date Start date
  • Tags Tags
    tower
Click For Summary

Discussion Overview

The discussion centers around finding an algorithm for solving the Tower of Hanoi problem with 4 pegs, particularly under the condition of a random initial configuration. Participants explore various approaches and express challenges in identifying an optimal solution that avoids brute force methods.

Discussion Character

  • Exploratory
  • Technical explanation
  • Debate/contested

Main Points Raised

  • Steven inquires about an algorithm for the 4 pegs Tower of Hanoi, emphasizing the need for a solution that finds the best move without using brute force.
  • One participant suggests a recursive algorithm based on moving disks to spare pegs, but questions whether this approach yields the shortest move.
  • Another participant notes that the optimal solution for the 4 pegs problem is considered an unsolved problem, complicating the search for a solution with random starting positions.
  • There is mention of an existing algorithm for sorted initial positions, but uncertainty remains regarding its applicability to random configurations.
  • A later reply encourages the idea of publishing a paper if an efficient algorithm is discovered.

Areas of Agreement / Disagreement

Participants express differing views on the existence of an optimal algorithm for the 4 pegs Tower of Hanoi, with some acknowledging the complexity and unsolved nature of the problem, while others focus on potential recursive methods. No consensus is reached on a definitive solution.

Contextual Notes

The discussion highlights limitations related to the assumptions of initial configurations and the unresolved status of optimal solutions for the 4 pegs scenario.

Stephanus
Messages
1,316
Reaction score
104
Dear PF Forum,
Do anybody know the algorithm for 4 pegs Hanoi Tower?
In regular initial, we can use array.
But what if the initial configuration is random?
I can do it in 3 pegs, but I've been searching algorithm for 4 pegs every day, on my bed, before I go to sleep. But I can't find any.
The algorithm should find the best move. Not using "brute force"!

Thanks for any idea.

Steven
 
Technology news on Phys.org
The standard way is to use a recursive algorithm:
  1. 3 disks can be done directly.
  2. Assume that you have found how to do it with n disks
    • Use this to move n disks to one of the spare pegs
    • Move the bottom disk to the goal peg
    • Move the n disks from the spare peg to the goal peg.
 
  • Like
Likes   Reactions: Stephanus
Svein said:
The standard way is to use a recursive algorithm:
  1. 3 disks can be done directly.
  2. Assume that you have found how to do it with n disks
    • Use this to move n disks to one of the spare pegs
    • Move the bottom disk to the goal peg
    • Move the n disks from the spare peg to the goal peg.
Yes, of course Svein. But it's not the best/shortest move is it?
 
According to Wikipedia, the optimal solution with 4 pegs is an unsolved problem. And randomizing the starting position certainly does not help.
 
Last edited:
  • Like
Likes   Reactions: Stephanus
mfb said:
According to Wikipedia, the optimal solution with 4 pegs http://Tower_of_Hanoi#With_four_pegs_and_beyond . And randomizing the starting position certainly does not help.

Thanks mfb,
There is, actually, an algorithm for a sorted initial position, but for a random position, well... Maybe? I've been trying for two months before I sleep. Still can't find solutions. Perhaps you're right.
 
Last edited by a moderator:
(I fixed the link in the previous post)

On the positive side, if you find an efficient algorithm, you can write a paper about it.
 
  • Like
Likes   Reactions: Stephanus

Similar threads

  • · Replies 25 ·
Replies
25
Views
5K
Replies
14
Views
3K
Replies
2
Views
3K
  • · Replies 11 ·
Replies
11
Views
5K
Replies
2
Views
8K
  • · Replies 16 ·
Replies
16
Views
7K
  • · Replies 2 ·
Replies
2
Views
4K
Replies
29
Views
6K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 65 ·
3
Replies
65
Views
8K