菜单图标 主题
Search

骑士图


KnightGraphChessboard

m×n 骑士图是 mn 个顶点上的图,其中每个顶点代表一个 m×n 棋盘上的一个方格,每条边对应于骑士的合法移动(骑士的移动方式为沿一个轴移动一格,同时沿另一个轴移动两格)。因此,它是一个 (1,2)-跳跃者图

KnightsTourGraph

上面展示了从棋盘抽象出来的 n×n 骑士图,其中 n=3, ..., 6。 1×1 骑士图是 单例图 K_1,而 2×2 骑士图与空图 K^__4 同构(因为骑士无法从任何一个方格到达另一个方格)。

3×3 骑士图由一个 8-环 以及一个(与其他所有方格无法到达的)孤立中心顶点组成。

n×n 骑士图中的边数为 4(n-2)(n-1)(是 三角形数的 8 倍),因此对于 n=1, 2, ..., 前几个值为 0, 0, 8, 24, 48, 80, 120, ... (OEIS A033996)。

骑士图是 二分图,因此也是 完美图

下表总结了一些命名的骑士图的补图。

GG^_
(2,3)-骑士图(2,3)-皇后图
(3,3)-骑士图(3,3)-皇后图

m×n 骑士图在 Wolfram 语言中实现为KnightTourGraph[m, n],并且可以使用以下方式获得预先计算的属性GraphData[{"Knight", {m, n}}].

对于 c_kk-图环的数量的闭合公式,n×n 骑士图由 c_k=0 给出,对于 k 为奇数,以及

c_4={0 for n<=3; 2(3n^2-18n+26) otherwise
(1)

(E. Weisstein,2014 年 11 月 16 日)。

骑士路径是骑士的一系列移动,使得棋盘上的每个方格恰好访问一次。因此,它是相应骑士图上的 哈密顿路径。Conrad et al. (1994) 表明,n×n 棋盘上存在骑士路径 当且仅当 n>=5

KnightsTours

以上图示显示了 8×8 棋盘上的六条骑士路径,除了第一条之外,其余都是重入的。最后一条路径还具有额外的属性,即它是一个 半魔方,其行和列之和为 260,主对角线之和为 348 和 168 (Steinhaus 1999, p. 30)。

如果路径的最终位置与骑士的初始位置相隔一个骑士步,则该路径称为重入或封闭路径,并对应于底层骑士图上的 哈密顿环。Conrad et al. (1994) 表明,n×n 棋盘上存在骑士巡游 当且仅当 n>=6n 为偶数。

回溯算法(其中允许骑士尽可能远地移动,直到遇到死胡同,此时它会后退若干步,然后尝试不同的路径)可用于查找骑士巡游,但这种方法可能非常慢。Warnsdorff (1823) 提出了一种算法,该算法通过计算每个位置的“后继”步骤的评分来找到路径,而无需任何回溯。在这里,一个位置的后继是那些尚未访问过且可以通过从给定位置一步到达的方格。对于后继数最少的后继,评分最高。通过这种方式,倾向于孤立的方格首先被访问,因此防止了被孤立(Roth)。此算法所需的时间大致与棋盘的方格数成线性增长,但不幸的是,计算机实现表明,对于大于 76×76 的棋盘,此算法会遇到死胡同,尽管它在较小的棋盘上效果良好(Roth)。

KnightsTours5-8

Conrad et al. (1994) 发现了另一种线性时间算法,并证明它解决了所有 n>=5 的哈密顿路径问题。Conrad et al. 算法通过将棋盘分解为更小的棋盘(不一定是正方形)来工作,对于这些棋盘,显式解是已知的。该算法相当复杂,因为它必须处理许多特殊情况,但 A. Roth 已在 Wolfram 语言中实现了该算法。上面的示例巡游图示了 n×n 棋盘,其中 n=5 到 8。

对于 (2n)×(2n) 棋盘,(无向) 封闭骑士巡游(即哈密顿环)的数量,其中 n=1, 2, ... 分别是 0, 0, 9862, 13267364410532, ... (OEIS A001230; Ball 和 Coxeter 1987; Wegener 2000, p. 369; Elkies 和 Stanley 2003)。对于 m×m 棋盘,其中 m 为奇数,则没有封闭巡游。Kraitchik (1942, pp. 264-265) 还指出,在 5×5 方格上共有 1728 条路径,其中 8 条是对称的,而在 6×6 方格上有 5 条双重对称路径。Wegener 和 Löbbing (1996) 计算了 8×8 棋盘的定向骑士图的环数,结果为 8121130233753702400。他们还计算了无向巡游的数量,得到一个不正确的答案 33439123484294(它不能被 4 整除,因为它必须被 4 整除)。Wegener 随后的书中给出了正确的值 13267364410532 (Wegener 2000),并且也与 B. D. McKay 未发表的计算结果一致。

对于 n×n 棋盘,最长的“不交叉”骑士巡游,其中 n=3, 4, ... 分别为 2, 5, 10, 17, 24, 35, ... (OEIS A003192)。

下表扩展并更正了 Kraitchik (1942, pp. 264-265) 给出的一些其他结果。此处,DHP 表示几何上不同的哈密顿路径,DSHP 表示几何上不同的对称路径,HP 表示总的(定向)哈密顿路径,DHC 表示几何上不同的哈密顿环,HC 表示总的(定向)哈密顿环。

尺寸DHPDSHPHPDHCHC
SloaneA118067A158074
3×200000
3×300000
3×431600
3×50000
3×60000
3×714210400
3×810479200
3×914616112000
3×107736096832
3×112698582134400
3×121435011449628352
3×133229625772800
3×143072
3×1500
3×1630848

令人惊讶的是,3×n 骑士图上的哈密顿环的数量由 21 阶线性递归方程给出

 a_n=6a_(n-1)+64a_(n-2)-200a_(n-3)-1000a_(n-4)+3016a_(n-5)+3488a_(n-6)-24256a_(n-7)+23776a_(n-8)+104168a_(n-9)-203408a_(n-10)-184704a_(n-11)+443392a_(n-12)+14336a_(n-13)-151296a_(n-14)+145920a_(n-15)-263424a_(n-16)+317440a_(n-17)+36864a_(n-18)-966656a_(n-19)+573440a_(n-20)+131072a_(n-21)
(2)

具有相应的闭合形式 生成函数

G(z)=(P(z))/(Q(z))
(3)
=32z^5+352z^6+3072z^7+30848z^8+295456z^9+...,
(4)

其中

P(z)=32(2048z^(22)+5120z^(21)-22016z^(20)-3328z^(19)+2784z^(18)+13888z^(17)+15360z^(16)-13392z^(15)-8176z^(14)+9536z^(13)-4z^(12)-3179z^(11)+616z^10+505z^9-116z^8-34z^7+5z^6+z^5)
(5)
Q(z)=-131072z^(21)-573440z^(20)+966656z^(19)-36864z^(18)-317440z^(17)+263424z^(16)-145920z^(15)+151296z^(14)-14336z^(13)-443392z^(12)+184704z^(11)+203408z^(10)-104168z^9-23776z^8+24256z^7-3488z^6-3016z^5+1000z^4+200z^3-64z^2-6z+1.
(6)

这个结果是由 D. E. Knuth 和 N. D. Elkies 在 1994 年 4 月独立获得的,他们都使用了所谓的传递矩阵方法 (Stanley 1999, Ch. 4.7; Elkies 和 Stanley 2003)。

对于 4×k 棋盘,可能的(定向)封闭巡游的数量,其中 k=3, 4, ... 分别为 16, 0, 164, 1488, 12756, 62176, 379376, 2426224, ... (OEIS A123935; Kraitchik 1942, p. 263)。与 3×(2n) 情况一样,已知此序列由具有常系数的线性递归关系给出,尽管似乎尚未显式计算出此递归关系。

m×n 骑士图是 哈密顿可编织图 当且仅当 m>=6, n>=6,并且 m, n 中至少有一个是偶数 (Dupuis and Wagon 2014)。


另请参阅

羚羊图, 主教图, 黑主教图, 骆驼图, 国际象棋, 五跳图, 长颈鹿图, 哈密顿环, 哈密顿路径, 国王图, 国王问题, 骑士问题, 跳跃者图, 魔术巡游, 皇后图, 皇后问题, 车图, 巡游, 三角蜂窝锐角骑士图, 三角蜂窝钝角骑士图, 白主教图, 斑马图

使用 Wolfram|Alpha 探索

参考文献

Ahrens, W. Mathematische Unterhaltungen und Spiele. Leipzig, Germany: Teubner, p. 381, 1910.Ball, W. W. R. and Coxeter, H. S. M. Mathematical Recreations and Essays, 13th ed. New York: Dover, pp. 175-186, 1987.Chartrand, G. "The Knight's Tour." §6.2 in Introductory Graph Theory. New York: Dover, pp. 133-135, 1985.Conrad, A.; Hindrichs, T.; Morsy, H.; and Wegener, I. "Solution of the Knight's Hamiltonian Path Problem on Chessboards." Discr. Appl. Math. 50, 125-134, 1994.de Polignac. Comtes Rendus Acad. Sci. Paris, Apr. 1861.de Polignac. Bull. Soc. Math. de France 9, 17-24, 1881.Dudeney, H. E. Amusements in Mathematics. New York: Dover, pp. 96 and 102-103, 1970.Dupuis, M. and Wagon, S. "Laceable Knights." To appear in Ars Math Contemp.Elkies, N. D. and Stanley, R. P. "The Mathematical Knight." Math. Intell. 25, No. 1, 22-34, Winter 2003.Euler, L. "Solution d'une question curieuse qui ne paroit soumise a aucune analyse." Mémoires de l'Académie Royale des Sciences et Belles Lettres de Berlin, Année 1759 15, 310-337, 1766.Euler, L. Commentationes Arithmeticae Collectae, Vol. 1. Leningrad, pp. 337-355, 1849.Friedel, F. "The Knight's Tour." http://www.chessbase.com/columns/column.asp?pid=163.Gardner, M. "Knights of the Square Table." Ch. 14 in Mathematical Magic Show: More Puzzles, Games, Diversions, Illusions and Other Mathematical Sleight-of-Mind from Scientific American. New York: Vintage, pp. 188-202, 1978.Gardner, M. The Sixth Book of Mathematical Games from Scientific American. Chicago, IL: University of Chicago Press, pp. 98-100, 1984.Guy, R. K. "The n Queens Problem." §C18 in Unsolved Problems in Number Theory, 2nd ed. New York: Springer-Verlag, pp. 133-135, 1994.更新链接Jelliss, G. "Knight's Tour Notes." http://www.ktn.freeuk.com/更新链接Jelliss, G. "Chronology of Knight's Tours." http://www.ktn.freeuk.com/cc.htmKaravaev, A. M. "FlowProblem: Statistics of Simple Cycles." http://flowproblem.ru/paths/statistics-of-simple-cycles.Knuth, D. E. Problem 205 in §7.2.2.3 in The Art of Computer Programming, Vol. 4. Pre-Fascicle 7A, Dec. 5, pp. 133 and 201-202, 2024.Kraitchik, M. "The Problem of the Knights." Ch. 11 in Mathematical Recreations. New York: W. W. Norton, pp. 257-266, 1942.Kyek, O.; Parberry, I.; and Wegener, I. "Bounds on the Number of Knight's Tours." Discr. Appl. Math. 74, 171-181, 1997.Lacquière. Bull. Soc. Math. de France 8, 82-102 and 132-158, 1880.Madachy, J. S. Madachy's Mathematical Recreations. New York: Dover, pp. 87-89, 1979.Murray, H. J. R. "The Knight's Tour, Ancient and Oriental." British Chess Magazine, pp. 1-7, 1902.Pegg, E. Jr. "Leapers (Chess Knights and the Like)" http://www.mathpuzzle.com/leapers.htm.Roget, P. M. Philos. Mag. 16, 305-309, 1840.Rose, C. "The Distribution of the Knight." http://www.tri.org.au/knightframe.html. Roth, A. "The Problem of the Knight: A Fast and Simple Algorithm." http://library.wolfram.com/infocenter/MathSource/909/.Rubin, F. "A Search Procedure for Hamilton Paths and Circuits." J. ACM 21, 576-580, 1974.Ruskey, F. "Information on the n Knight's Tour Problem." http://www.theory.csc.uvic.ca/~cos/inf/misc/Knight.html.Skiena, S. Implementing Discrete Mathematics: Combinatorics and Graph Theory with Mathematica. Reading, MA: Addison-Wesley, p. 166, 1990.Sloane, N. J. A. Sequences A001230, A003192/M1369, A006075/M3224, A033996, A118067, A123935, and A158074 in "The On-Line Encyclopedia of Integer Sequences."Stanley, R. P. Enumerative Combinatorics, Vol. 1. Cambridge, England: Cambridge University Press, 1999.Steinhaus, H. Mathematical Snapshots, 3rd ed. New York: Dover, p. 30, 1999.Thomasson, D. "The Knight's Tour." http://www.borderschess.org/KnightTour.htm.van der Linde, A. Geschichte und Literatur des Schachspiels, Vol. 2. Berlin: Springer-Verlag, pp. 101-111, 1874.Vandermonde, A.-T. "Remarques sur les Problèmes de Situation." L'Histoire de l'Académie des Sciences avec les Mémoires, Année 1771. Paris: Mémoirs, pp. 566-574 and Plate I, 1774.Velucchi, M. "Knight's Tour: The Ultimate Knight's Tour Page of Links." http://www.velucchi.it/mathchess/knight.htm.Volpicelli, P. "Soluzione completa e generale, mediante la geometria di situazione, del problema relativo alle corse del cavallo sopra qualunque scacchiere." Atti della Reale Accad. dei Lincei 25, 87-162, 1872.Warnsdorff, H. C. von Des Rösselsprungs einfachste und allgemeinste Lösung. Schmalkalden, 1823.Watkins, J. Across the Board: The Mathematics of Chessboard Problems. Princeton, NJ: Princeton University Press, 2004.Watkins, J. J. and Hoenigman, R. L. "Knight's Tours on a Torus." Math. Mag. 70, 175-184, 1997.Wegener, I. Branching Programs and Binary Decision Diagrams. Philadelphia, PA: SIAM, 2000.Wegener, I. and Löbbing, M. "The Number of Knight's Tours Equals 33439123484294--Counting with Binary Decision Diagrams." Electronic J. Combinatorics 3, No. 1, R5, 1-4, 1996. http://www.combinatorics.org/Volume_3/Abstracts/v3i1r5.html.

请引用本文为

Weisstein, Eric W. "骑士图。" 来自 MathWorld--Wolfram Web 资源。 https://mathworld.net.cn/KnightGraph.html

学科分类