ArticleslgStudy

mathematics

Knight's tour

Knight's tour is a mathematics topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Knight's tour rather than just read about it. In short: A knight's tour is a sequence of moves of a knight on a chessboard such that the knight visits every square exactly once. If the knight ends on a square that is one knight's move from the beginning square (so that it could tour the board again immediately, following the same path), the tour is "closed", or "re-entrant"; otherwise, it is "open".

Knight's tour — main illustration
Knight's tour — illustration

Key takeaways

  • Knight's tour belongs to mathematics; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Knight's tour to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Knight's tour from memory before moving on to harder problems.

Reference excerpt

A knight's tour is a sequence of moves of a knight on a chessboard such that the knight visits every square exactly once. If the knight ends on a square that is one knight's move from the beginning square (so that it could tour the board again immediately, following the same path), the tour is "closed", or "re-entrant"; otherwise, it is "open". The knight's tour problem is the mathematical problem of finding a knight's tour. Creating a program to find a knight's tour is a common problem given to computer science students. Variations of the knight's tour problem involve chessboards of different sizes than the usual 8×8, as well as irregular (non-rectangular) boards.

Theory

The knight's tour problem is an instance of the more general Hamiltonian path problem in graph theory. The problem of finding a closed knight's tour is similarly an instance of the Hamiltonian cycle problem. Unlike the general Hamiltonian path problem, the knight's tour problem can be solved in linear time.

History

The earliest known reference to the knight's tour problem dates back to the 9th century AD. In Rudrata's Kavyalankara (5.15), a Sanskrit work on Poetics, the pattern of a knight's tour on a half-board has been presented as an elaborate poetic figure (citra-alaṅkāra) called the turagapadabandha or 'arrangement in the steps of a horse'. The same verse in four lines of eight syllables each can be read from left to right or by following the path of the knight on tour. Since the Indic writing systems used for Sanskrit are syllabic, each syllable can be thought of as representing a square on a chessboard. Rudrata's example is as follows:

transliterated:

For example, the first line can be read from left to right or by moving from the first square to the second line, third syllable (2.3) and then to 1.5 to 2.7 to 4.8 to 3.6 to 4.4 to 3.2. The Sri Vaishnava poet and philosopher Vedanta Desika, during the 14th century, in his 1,008-verse magnum opus praising the deity Ranganatha's divine sandals of Srirangam, Paduka Sahasram (in chapter 30: Chitra Paddhati) has composed two consecutive Sanskrit verses containing 32 letters each (in Anushtubh meter) where the second verse can be derived from the first verse by performing a Knight's tour on a 4×8 board, starting from the top-left corner. The transliterated 19th verse is as follows:

The 20th verse that can be obtained by performing Knight's tour on the above verse is as follows: sThi thA sa ma ya rA ja thpA ga tha rA mA dha kE ga vi | dhu ran ha sAm sa nna thA dhA sA dhyA thA pa ka rA sa rA || It is believed that Desika composed all 1,008 verses (including the special Chaturanga Turanga Padabandham mentioned above) in a single night as a challenge. A tour reported in the fifth book of Bhagavantabaskaraby by Bhat Nilakantha, a cyclopedic work in Sanskrit on ritual, law and politics, written either about 1600 or about 1700 describes three knight's tours. The tours are not only reentrant but also symmetrical, and the verses are based on the same tour, starting from different squares. Nilakantha's work is an extraordinary achievement being a fully symmetric closed tour, predating the work of Euler (1759) by at least 60 years.

After Nilakantha, one of the first mathematicians to investigate the knight's tour was Leonhard Euler. The first procedure for completing the knight's tour was Warnsdorf's rule, first described in 1823 by H. C. von Warnsdorff. In the 20th century, the Oulipo group of writers used it, among many others. The most notable example is the 10×10 knight's tour which sets the order of the chapters in Georges Perec's novel Life a User's Manual. The sixth game of the World Chess Championship 2010 between Viswanathan Anand and Veselin Topalov saw Anand making 13 consecutive knight moves (albeit using both knights); online commentators jested that Anand was trying to solve the knight's tour problem during the game.

Existence

Schwenk proved that for any m×n board with m ≤ n, a closed knight's tour is always possible unless one or more of these three conditions are met:

m and n are both odd m = 1, 2, or 4 m = 3 and n = 4, 6, or 8. Cull et al. and Conrad et al. proved that on any rectangular board whose smaller dimension is at least 5, there is a (possibly open) knight's tour. For any m×n board with m ≤ n, a (possibly open) knight's tour is always possible unless one or more of these three conditions are met:

m = 1 or 2 m = 3 and n = 3, 5, or 6 m = 4 and n = 4.

Number of tours On an 8×8 board, there are exactly 26,534,728,821,064 directed closed tours (i.e. two tours along the same path that travel in opposite directions are counted separately, as are rotations and reflections). The number of undirected closed tours is half this number, since every tour can be traced in reverse. There are 9,862 undirected closed tours on a 6×6 board.

Finding tours with computers There are several ways to find a knight's tour on a given board with a computer. Some of these methods are algorithms, while others are heuristics.

Brute-force algorithms A brute-force search for a knight's tour is impractical on all but the smallest boards. On an 8×8 board, for instance, there are 13,267,364,410,532 knight's tours, and a much greater number of sequences of knight moves of the same length. It is well beyond the capacity of modern computers (or networks of computers) to perform operations on such a large set. However, the size of this number is not indicative of the difficulty of the problem, which can be solved "by using human insight and ingenuity ... without much difficulty."

Divide-and-conquer algorithms By dividing the board into smaller pieces, constructing tours on each piece, and patching the pieces together, one can construct tours on most rectangular boards in linear time – that is, in a time proportional to the number of squares on the board.

Warnsdorff's rule

… excerpt ends here. Continue reading the full article.

Illustrations

Knight's tour: An open knight's tour of a chessboard
An open knight's tour of a chessboard
Knight's tour: An animation of an open knight's tour on a 5×5 board
An animation of an open knight's tour on a 5×5 board
Knight's tour: Knight's graph showing all possible paths for a knight's tour on a standard 8×8 chessboard. The numbers on each node indicate the number of possible moves that can be made from that position.
Knight's graph showing all possible paths for a knight's tour on a standard 8×8 chessboard. The numbers on each node indicate the number of possible moves that can be made from that position.
Knight's tour: The knight's tour as demonstrated by the Turk, a chess-playing machine hoax. This particular solution is closed (circular), and can thus be completed from any point on the board.[5]
The knight's tour as demonstrated by the Turk, a chess-playing machine hoax. This particular solution is closed (circular), and can thus be completed from any point on the board.[5]
Knight's tour: A semimagic square (its diagonals do not sum to its magic constant, 260) also forming a knight's tour – no fully magic tours exist on an 8x8 board (although they do exist on larger boards)[10]
A semimagic square (its diagonals do not sum to its magic constant, 260) also forming a knight's tour – no fully magic tours exist on an 8x8 board (although they do exist on larger boards)[10]

Worked examples

Example 1 — a first encounter with Knight's tour

Start with the simplest possible case. Write down what Knight's tour claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In mathematics, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Knight's tour before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Knight's tour ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Knight's tour

In research
Knight's tour appears in mathematics research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Knight's tour in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Knight's tour is common in secondary-school and first-year university syllabi. It links to neighbouring topics Chess problems, Graph algorithms, Hamiltonian paths and cycles, so understanding it makes those chapters shorter.
In everyday life
Look for Knight's tour outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Knight's tour” →

How to study Knight's tour in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Knight's tour means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Knight's tour out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Knight's tour in simple terms?

A knight's tour is a sequence of moves of a knight on a chessboard such that the knight visits every square exactly once. If the knight ends on a square that is one knight's move from the beginning square (so that it could tour the board again immediately, following the same path), the tour is "clo…

Why does Knight's tour matter?

Because it connects several mathematics ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Knight's tour?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Knight's tour.

Tags

  • Chess problems
  • Graph algorithms
  • Hamiltonian paths and cycles
  • Mathematical chess problems
  • Mathematical problems

Keep exploring