Knight Trail: prove one landing is a dead end
A fully specified partial five-by-five trail shows two legal next moves, but only one leaves an unvisited onward landing.
Worked examples use the Standard board unless a different size is stated. Hard and Expert may change the board dimensions or amount of information to track. Teaching positions are explained separately from the playable board.
A legal move can still end the route too soon
Knight Trail checks whether a proposed landing is an unvisited square one knight move away. That immediate legality test does not promise that the route can visit every remaining square afterward. To reject a branch with confidence, identify a concrete obstruction. The simplest obstruction is landing somewhere with no unvisited legal exit while other squares remain uncovered.
We will use a separate five-by-five teaching position, the board size used on Standard. Rows are numbered 1 to 5 from top to bottom and columns 1 to 5 from left to right. This partial trail is constructed to expose a mistake; it is not an opening recommendation for your generated starting square, and it is not claimed to be extendable into a complete tour.
Reconstruct the visited squares exactly
Follow this eleven-square path in order: (1,1), (2,3), (1,5), (3,4), (1,3), (2,1), (3,3), (1,2), (2,4), (3,2), (4,4). Every consecutive pair changes one coordinate by two and the other by one. No landing repeats. The current square is therefore row 4, column 4, and all eleven listed positions must be excluded when counting possible onward landings.
From (4,4), the geometric moves that stay on this board land at (2,3), (2,5), (3,2) and (5,2). Two are already visited: (2,3) and (3,2). The remaining legal choices are (2,5) and (5,2). Checking only that both buttons represent legal moves would miss the important difference between them. Look one accepted landing beyond each choice.
| Next landing | All geometric onward landings | Unvisited onward landings |
|---|---|---|
| (2,5) | (1,3), (3,3), (4,4) | None |
| (5,2) | (3,1), (3,3), (4,4) | (3,1) only |
Reject the empty exit list
After landing on (2,5), its only in-board knight neighbours are (1,3), (3,3) and (4,4). Every one is already in the path. The trail would stop after twelve visited squares, leaving thirteen unvisited. Because visited squares cannot be used again, no later move can repair that branch. It is a genuine dead end, not merely a move with an unattractive onward count.
After landing on (5,2), the available geometric neighbours are (3,1), (3,3) and (4,4). The last two are visited, but (3,1) is still free. This choice preserves a possible next move. It has passed one necessary check. We have not proved that the remaining thirteen squares can all be visited from there, so the table must not be read as a certificate of eventual success.
Know when zero onward moves is correct
A zero-exit landing is acceptable if it is the very last unvisited square. In that case there is nowhere else the trail needs to go. The teaching example fails because thirteen squares would remain, not because a final square must always have an exit. Always compare the exit count with the number of unvisited squares before applying a pruning rule.
This implementation asks for an open tour: visit every square once. It does not add a requirement to jump from the last square back to the start. Adding that closing condition in your head would reject otherwise valid finishes. Likewise, the knight may jump over previously visited squares; only landing on them is forbidden. The drawn appearance of crossing route segments creates no additional collision rule.
Backtrack to the actual decision
If you test (2,5), Undo removes that latest landing and restores (4,4) as the current endpoint. You can then test the other available branch. Clicking an earlier visited square is not equivalent to Undo, because it does not remove later landings from the path. Use the numbered trail to keep that distinction clear.
Counting onward moves is a practical filter, not a complete solving algorithm. A nonzero count may still lead to a later dead end, and a low count may deserve attention without being forced. The transferable skill is stating the exact rejection: which landings exist, which have already been consumed, and how many squares still require a visit. That explanation makes a failed branch useful information for the next decision.
An original guide for this site's implementation. Found an unclear step? Let us know. How we prepare and correct our guides.