기둥이 4개, 5개인 하노이탑

inseck1121의 이미지

기둥이 4개, 5개인 하노이탑 알고리즘좀 알려주세요....ㅠㅠ

klenui의 이미지

Wikipedia에 따르면

http://en.wikipedia.org/wiki/Tower_of_Hanoi

Although the three-peg version has a simple recursive solution as outlined above, the optimal solution for the Tower of Hanoi problem with four pegs (called Reve's puzzle), let alone more pegs, is still an open problem.

이랍니다...

질문을 보자마자 종이에 끄적거려 봤는데.. 정신이 아득해지네요..

일단 위키피디아에서는 다음과 같이 이야기 합니다...

The fact that the problem with four or more pegs is an open problem does not imply that no algorithm exists for finding (all of) the optimal solutions. Simply represent the game by an undirected graph, the nodes being distributions of disks and the edges being moves and use breadth first search to find one (or all) shortest path(s) moving a tower from one peg onto another one. ... ... There is also a "presumed-optimal solution" given by the Frame-Stewart algorithm, discovered independently by Frame and Stewart in 1941

바로 이어서 Frame-Stewart algorithm 을 설명해 놨으니 읽어보시면 될듯.