Knight’s Tour

Download Report

Transcript Knight’s Tour

4/25/2020

The Knight’s Tour

Presented By: David Miller 1

History

 The Knight's Tour is a classic chess problem which was studied (and probably solved) over 1000 years ago. The famous mathematician, Euler, published the first rigorous mathematical analysis of the problem in 1759.

4/25/2020 2

How Does a Knight Move?

 A knight can move in an “L shape” moving two squares in one direction and one square in a perpendicular direction.

In this position, the black knight can move to any of the squares marked with green dots.

4/25/2020 3

What is The Knight’s Tour Problem?

Problem

: From an arbitrary starting position, move a knight chess piece around a chess board visiting all other squares on the board exactly once.

4/25/2020 4

Definition

If, while constructing a knight’s tour, a knight visits a space that has no move choices left and there are still spaces on the board that have not been visited, the constructor has run into a

dead end

.

4/25/2020 5

4/25/2020

One Possible Path

 There are lots of paths a knight can take to form a knight’s tour.  This simple path is constructed by starting in a corner and moving in the same direction around the board choosing the outermost possible squares first. 6

Re-entrant Knight’s Tours

 If we identify the squares in a chess board with vertices and a knights’ moves with edges in a graph, a knight’s tour forms a Hamilton Path in this graph.

 A re-entrant knight’s tour is a knight’s tour that forms a Hamilton Circuit (there is a valid knight move from the final square in the tour to the starting square).

4/25/2020 7

Not Re-entrant

Examples

Re-entrant Re-entrant 4/25/2020 Re-entrant Re-entrant Re-entrant 8

Re-entrant Rule

 For any

m

x

n

chess board, the number of squares must be even in order for a re-entrant knight’s tour to exist.

 This rule makes sense because…  Every time a knight makes a move on a checker board, they move to a different color square.

 The final move in a re-entrant knight’s tour with an odd number of squares would have to go from one square to another, each of which have the same color.

4/25/2020 9

Rule Explanation

Lets say we make a bipartite graph of this chess board with vertices for the squares and edges for a knight’s tour in progress.

•A re-entrant knight’s tour cannot exist because the edge needed to complete a Hamilton Circuit would be an illegal move for the knight (red square to red square).

•This conclusion can be supported by the fact that if a bipartite graph has an odd number of vertices, it cannot have a Hamilton Circuit.

10 4/25/2020

DeMoivre’s Method

  Move around the outside of the board in one direction only entering the inner section if you are forced.

 Dividing the chessboard into an inner section and an outer section as shown, start in a cell in the outer section.

Once the outer section is completed, enter into the inner section and complete the tour (this step can be done fairly easily with minimal backtracking).

4/25/2020 11

4/25/2020

DeMoivre Example

The tour only crosses inside the green boundary if it has no other choice.

12

Euler’s Method

 Start at some space on a board and try to randomly make a knight’s tour until you run out of possible spaces to visit.

  Label the unvisited spaces

a

,

b

,

c

, … Use the technique in the following example to construct a knight’s tour from what you have already constructed.

4/25/2020 13

4/25/2020

Euler Example

38 39 1 4 50 3 34 5 49 40 27 44 19 22 43 30 21 26 45 28 41 18 23 20 42 31 37

a

8 25 47 16 46 17 9 24 33 36 48

b

7 14 12 15

c

10 35 6 11

d

13 14

4/25/2020

Euler Example

c

15

4/25/2020

Euler Example

6 1 4 3 7 5 2 8 10 13 12 9 14 11 17 23 20 18 21 19 22 16

4/25/2020

Euler Example

40 39 52 35 60 57 36 49 58 53 34 51 38 61 56 59 41 37 48 47 42 54 32 63 33 62 55 29 45 30 46 43 31 44 64 17

Warnsdorff's Rule

 A great way to minimize dead-ends in constructing Knight’s Tours.

Rule

: To avoid dead ends, count the number of free new move choices each possible move has, and then move to the square with the lowest number of new choices. 4/25/2020 http:// web.telia.com

/~u85905224/knight/eWarnsd.htm

18

Many Existing Knight’s Tours

  Over 13 trillion knight’s tours takes a long time to count even with computer technology.

 It has been discovered, that the number of knight’s tours on an 8 x 8 board is 13267364410532.

At a fast rate of 1,000 tours per second, a single computer would take about 420 years to find all of the tours on an 8 x 8 chess board.

4/25/2020 19

Other Tour Problems

  We can extend our study of knight’s tours to problems other chess pieces.

For instance, one other chess piece problem is the queen’s problem.

 In this problem we try to maximize the number of queens that can be placed on a chess board such that no queen is in a position to attack another.

4/25/2020 20

4/25/2020

Class Exercise

Use Warnsdorff’s Rule to find a knight’s tour in this 5x4 board starting in the upper left corner.

Is there more than one possibility for a knight’s tour starting in this corner?

How do you know?

21

Solution

3 4 2 3 2 4/25/2020 Yes there is more than one solution. We know this because sometimes when we look at the number of move choices for each possible “next space”, the lowest number occurs in more than one space. In fact, when using Warnsdorff’s Rule, a single wrong choice usually doesn’t affect the discovery of a knight’s tour anyway.

22