Teaching a Knight to File a Flight Plan

VFR Knight's Tour Grid Flights
🎮 Play: Knight's Tour VFR Planner

You’re going to look back at this notebook and wonder what possessed you to overlay an 8×8 chessboard on the Edmonton VFR Terminal Area Chart. Let me explain while it still makes sense.

Warnsdorff’s rule. That’s the thread. Two weeks ago I stood in a frozen field and watched an 1823 heuristic guide a telescope mount through sixty-four tiles of sky, stitching a mosaic that hid a Hamiltonian path in starlight. The algorithm was elegant: always move to the square with the fewest onward options. Don’t paint yourself into a corner at tile 47.

And somewhere between tile 50 and tile 64, while my toes were numb and my breath was fog, I thought: what if the tiles were airfields?

So here I am with a VNC chart spread across the desk, a 100 NM grid pencilled in Chinagraph, and a Python script that doesn’t yet understand the difference between a chessboard and controlled airspace. Each cell is roughly 12.5 nautical miles on a side. A knight’s move—that familiar L-shape—covers about 28 NM. Short cross-country legs, the kind you’d log for currency.

The romance of it is obvious. Chess geometry drawn across prairie. A flight plan that reads like algebraic notation: CEF3-g1, g1-e2, e2-c1. GPS tracks that trace an enormous L over farmland.

The problem—and you probably already know this, future me—is that a VNC chart is not a clean 64-square board.

Calgary’s Class C transition zone alone bleeds into four cells. CYR 220 near Cold Lake is military restricted. CYR 203 at Suffield is worse. Mark those as blocked and suddenly you’re not running Warnsdorff on an 8×8 board anymore. You’re running it on an irregular graph with 40-something valid nodes and holes in uncomfortable places. The heuristic that “almost always” completes on a standard chessboard fails more often than it succeeds on an airspace-constrained grid.

I’ve spent the evening adding a constraint layer. NOTAMs first—the active ones scraped from NAV CANADA’s feed, parsed into cell coordinates, flagged as blocked. Then terrain: cells where the minimum safe altitude exceeds what a 172 wants to be doing casually. Then the permanent restrictions. What’s left is a Swiss cheese board, and Warnsdorff keeps getting stuck at node 23.

The fix is backtracking. When you hit a dead end, retreat and try the next-best square. It’s slower. It’s less elegant. It works.

Future me, here’s what I want you to remember: this is the first hobby where the algorithm has to negotiate. The starfield mosaic was cooperative—the sky didn’t file NOTAMs. The orthomosaic grids over Rundle Park had overlap math, sure, but the ground didn’t suddenly declare restricted airspace halfway through the mission. This is different. This is constraint satisfaction with a regulatory layer that updates daily.

I haven’t flown any of it yet. Today was just the routing problem. The script finally produced a complete tour at 11:47 PM—41 valid squares, start at Cooking Lake, end at Josephburg. The path looks absurd on screen, all those L-shapes crossing and recrossing the same airspace. But the distances work out. Every leg is under 35 NM. Total tour is just over 600 NM across eight hypothetical days.

Some advice, while I’m thinking of it:

The return leg. If you want to land back at your origin, you need a closed tour—the final square must be a knight’s move from the start. Enforce that constraint upfront or you’ll end up stranded 30 NM from home, which is not illegal but is embarrassing.

Also: Euler worked on this in 1759. A half-blind mathematician doing recreational chess problems 144 years before the Wright brothers. Now you’re planning to actually fly his puzzle. That connection alone is worth the headache of parsing NOTAMs.

I don’t know yet if I’ll fly it real or simulate it in X-Plane first. Probably simulate. The GPS track logs work either way—the notation is the same, the path is the same, only the fuel burn is imaginary.

But somewhere out there is a future where I’ve flown all 41 legs. A logbook with algebraic notation in the remarks column. A KML file that renders as an enormous, absurd knight’s tour over central Alberta.

It’s late. The script runs clean. Warnsdorff finally found a path that doesn’t paint itself into CYR 203.

Remember this feeling, future me. Before the first engine start. Before the first leg. When the whole tour was just potential energy and a Python script that couldn’t read a NOTAM.

—S.