Hey you guys, I made a video of a program that creates solutions on how to solve the Tower of Hanoi in the least amount of moves. Check it out and see what you think.
If you have a solution for moving all discs from peg A to peg B, using C as intermediary then it is trivial to have the solution for moving A to C via B by simply swapping B with C in all the moves.
As explained in the book of Aho, the solution presented here is based on the strategy "advance the smallest disc, then make the move that doesn't involve the smallest disc". With this strategy the pile of discs goes to B or C depending on wether the number of discs is even or odd.
Hey you guys, I made a video of a program that creates solutions on how to solve the Tower of Hanoi in the least amount of moves. Check it out and see what you think.
MeeSmartYooDumDum 2 weeks ago
i thought the whole tower was to be from one end to another not only one over?
megamindstorm101 2 years ago
If you have a solution for moving all discs from peg A to peg B, using C as intermediary then it is trivial to have the solution for moving A to C via B by simply swapping B with C in all the moves.
As explained in the book of Aho, the solution presented here is based on the strategy "advance the smallest disc, then make the move that doesn't involve the smallest disc". With this strategy the pile of discs goes to B or C depending on wether the number of discs is even or odd.
mariostorti 2 years ago