順列生成アルゴリズムによる魔方陣の総当たり探索
Round robin search of magic square by permutation generation algorithm
本稿では順列生成アルゴリズムを作成し、その応用例として魔方陣の総当たり探索を行った。 順列生成アルゴリズムの作成については、数々のウェブページで紹介されているが、 そのほとんどが再帰関数によって作られている。 本稿では再帰関数を用いずに順列の生成を行う方法を考える。
In this report, I made permutation generation algorithm and searched the magic square by round robin method as the applied example. The making of the permutation generation algorithm is introduced in many web pages, but the most are made by recursive function. Therefore, I tried to make the permutation generation algorithm without recursive function.
![]() |
![]() |
![]() (日本科学未来館「フカシギの数え方」より引用) |