跳到主要内容

资源 · 指南或文章

Knight's Tour

描述骑士巡游问题:骑士要恰好访问棋盘上的每个格子一次,并区分开放巡游和闭合巡游。

审核日期

打开原站: 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 棋盘编写回溯搜索,打印一条开放巡游路线,并解释它如何对应到哈密顿路径搜索。

范围与局限

没有给出算法、启发式方法或复杂度。回溯方法只在链接的 GeeksForGeeks 文章中。

获取方式与形式

GitHub 上的简短 README,trekhleb/javascript-algorithms(MIT)。英文,免费。

PrepKit 于 2026年10月2日 审核。 资源来源提交: 85293e3e2b88

本概览的依据
  • src/algorithms/uncategorized/knight-tour/README.md

收录此条目的页面

订阅 PrepKit 通讯

可选。使用 PrepKit 并不需要订阅。

我们如何处理你的邮箱