← COIN Knight’s Tourภาษาไทย
COINCIDENCE · DIVIDE & CONQUER PUZZLE

A very large closed
Knight’s Tour

Optimize one 8×8 subboard at a time, fold the macro path down and back, then constrain the final endpoint to make one legal knight move to the first square.

8×8 → 64×64 → loop64 local Hamiltonian paths · 4,096 unique squares · 4,096 verified moves
Statusready
Subboards0 / 64
Unique squares0
Legal moves0

Incrementally constructed tour

locked tilecurrent optimizationinter-tile connector
ALGORITHM NOTE

Fold back into one verified cycle

The macro order crosses the top row, folds through the interior, and returns along the left edge. Every local path must reach a legal connector to the next subboard; the last path must end where it can jump back to the fixed first square.

local uniqueness + legal connectors + fold-back macro cycle + closing moveglobal closed tour

DIVIDE & CONQUER · ALGORITHM NOTE

From one learned tile to one verified large cycle

This laboratory decomposes an N×N board into 8×8 subboards. It solves one constrained Hamiltonian path per tile, locks that path, and passes only a legal exit–entry knight move to the next tile. The final tile is constrained to reconnect to the fixed start.

DIVIDE

Geometry becomes an interface

Each tile is a subproblem, but its entry and allowed exits are its contract with neighboring tiles. Independent local tours alone do not guarantee a global tour.

CONQUER

COIN–Warnsdorff Hybrid

COIN learns directed edge weights from rewarded and punished candidates. Warnsdorff supplies a local prior favoring destinations with fewer onward moves. It guides rather than replaces COIN learning.

COMBINE + VERIFY

Check every seam

64 unique cells/tile
63 legal local moves
+ legal connector
+ final closing move

P(next=j | current=i) ∝ W[i,j] / (1 + OnwardDegree(j))⁴

Terminology: the learning option is COIN–Warnsdorff Hybrid. The Warnsdorff baseline uses randomized minimum-onward-degree selection without learning an edge matrix.

MACRO PATH ATLAS

Folding even and odd tile grids

Let q=N/8 be the number of subboards per side. A row-by-row snake is an intuitive open path, but its last tile need not be adjacent to its first. A closed construction must reserve a return corridor or search directly for a macro Hamiltonian cycle.

EVEN q · PERIMETER FOLD
→ → → ↓
↑ ↓ ← ↓
↑ → → ↓
↑ ← ← ←

Cross the top, fold through the interior, and reserve a boundary column for returning beside the first tile.

ODD q · DIAGONAL SEAM
1 → 2 → 3
↑   ↙   ↓
8 ← 7   4
  ↖ 6 ← 5

A plain snake cannot simply fold onto its start. This lab searches an 8-neighbor macro graph and may use a diagonal neighboring tile; the exact cells must still differ by a legal (1,2) knight move.

GENERAL q · SEARCH THE GRAPH
tile = vertex
seam = edge
cycle = fold plan

Find a macro Hamiltonian cycle first, then solve each 8×8 tile under its interface. If a seam is unrealizable, backtrack or choose another cycle.

Odd q does not imply that the large board has no closed tour: N=8q remains even. Only the simplest serpentine fold fails. Macro adjacency is also not enough—the cell-to-cell connector must be verified.

RESEARCH CONTEXT

Large tours are constructed, not searched blindly

Parberry’s divide-and-conquer algorithm recursively builds closed tours in quadrants and splices selected edges, using O(n²) work for an n×n board—linear in the number of cells. Later work shows structured and obfuscated tours up to 2,000×2,000. This lab instead exposes each constrained 8×8 solve and lets a learning COIN model work locally, so students can inspect the boundary contract.

  1. Parberry, I. (1997). An efficient algorithm for the Knight’s Tour Problem. Discrete Applied Mathematics, 73, 251–260.
  2. Schwenk, A. J. (1991). Which Rectangular Chessboards Have a Knight’s Tour? Mathematics Magazine, 64(5), 325–332.
  3. Parberry, I. (2020). Tourneys and the Fast Generation and Obfuscation of Closed Knight’s Tours.
  4. Warnsdorff heuristic analysis: How good is Warnsdorff’s knight’s tour heuristic?
  5. Gilith 64×64 Knight’s Tour — large-board visualization example.