選單圖示 主題
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)。


另請參閱

羚羊圖, 主教圖, 黑主教圖, 駱駝圖, 國際象棋, 五跳圖, 長頸鹿圖, 哈密頓環, 哈密頓路徑, 國王圖, 國王問題, 騎士問題, 跳躍者圖, 魔術巡遊, 皇后圖, 皇后問題, 車圖, 巡遊, 三角蜂窩銳角騎士圖, 三角蜂窩鈍角騎士圖, 白主教圖, 斑馬圖

使用 探索

參考文獻

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. "騎士圖。" 來自 Web 資源。 https://mathworld.tw/KnightGraph.html

學科分類