リソース · ガイド・記事
Knight's Tour
ナイトが盤上のすべてのマスをちょうど1回ずつ訪れるナイト・ツアーの問題を説明し、開いたツアーと閉じたツアーを区別しています。
確認日
元のサイトを開く: Knight's Tour (元のサイトを新しいタブで開きます)ロードマップに追加
取り組んでいるロードマップにこのリソースを追加できます。自分用の追加リソースとして表示され、ロードマップの手順は変わらず、記録した手順数にも数えられません。
出典コンテンツの言語:英語
A knight's tour is a sequence of moves of a knight on a chessboard such that the knight visits every square only once. If the knight ends on a square that is one knight's move from the beginning square (so that it could tour the board again immediately, following the same path), the tour is closed, otherwise it is open. The knight's tour problem is the mathematical problem of finding a knight's tour. Creating a program to find a knight's tour is a common problem given to computer science students. Variations of the knight's tour problem involve chessboards of different sizes than the usual 8×8, as well as irregular (non-rectangular) boards. The knight's tour problem is an instance of the more general Hamiltonian path problem in graph theory. The problem of finding a closed knight's tour is similarly an instance of the Hamiltonian cycle problem.
PrepKit の概要
この概要は PrepKit 編集部がソースリポジトリをもとに執筆・確認したもので、リソース本文の引用ではありません。
- 対象
- ソースにレベルの記載はありません
- 形式
- リファレンス
扱っている内容
- 開いたツアーと閉じたツアーを定義し、標準でない盤の大きさや形にも触れています
- この問題をグラフ理論のハミルトン路とハミルトン閉路に結び付けています
- 8x8 のツアーと 5x5 の開いたツアーのアニメーションを示しています
使い方
PrepKit の学習アドバイスであり、ソースの主張ではありません。
5x5 の盤に対するバックトラック探索を書き、開いたツアーを1つ出力して、それがハミルトン路の探索にどう対応するかを説明してください。
範囲と制約
アルゴリズム、ヒューリスティック、計算量は示されていません。バックトラックの方法はリンク先の GeeksForGeeks の記事にしかありません。
利用方法と形式
GitHub の trekhleb/javascript-algorithms(MIT)にある短い README です。英語で、無料です。
PrepKit が 2026/10/02 に確認しました。 リソースの出典のコミット: 85293e3e2b88
この概要の根拠
- src/algorithms/uncategorized/knight-tour/README.md
この項目を掲載しているページ
PrepKit ニュースレターを受け取る
任意です。PrepKit の利用には必要ありません。