SlideShare a Scribd company logo
1 of 22
Download to read offline
Knight’s Tour




           Kelum Senanayake
Outline
 What is „Knight‟s Tour
 Theory
 Knight's graph
 Computer Algorithms
 Warnsdorff's Algorithm
 Magic Knight‟s Tours
 Knight‟s Tours and Cryptography
 Longest uncrossed knight's path
What is ‘Knight’s Tour?
 Chess problem involving a knight


 Start on a random square


 Visit each square exactly ONCE according to rules


 Tour called closed, if ending square is same as the starting.


 Variations of the knight's tour problem.
    Different sizes than the usual 8 × 8
    Irregular (non-rectangular) boards.
A Knights Tour – Legal Moves
Theory
 Knight‟s tour can be represented as a graph.
 The vertices - Represent the squares of the board.
 The edges - Represent a knight‟s legal moves between
  squares.
 Knight‟s tour is simply an instance of Hamiltonian path.
 A closed tour is a Hamiltonian cycle.
 Knight's tour problem can be solved in linear time.
Knight's graph
Computer Algorithms
 Brute-force search ???
   Iterates through all possible move sequences.
   For a regular 8x8 chess board, there are approximately 4×1051
    possible move sequences.
   Brute force approach can never be applied to the Knight's Tour
    problem.
 Neural network solutions.
   Can be solved by a neural network implementation.
   Every legal knight's move is represented by a neuron.


 Warnsdorff's algorithm
Warnsdorff's Algorithm
 Heuristic Method.
 Introduced by H. C. Warnsdorff in 1823.
 Any initial position of the knight on the board.
 Each move is made to the adjacent vertex with the least
  degree.
 May also more generally be applied to any graph.
 On many graphs that occur in practice this heuristic is able to
  successfully locate a solution in linear time.
Warnsdorff's Algorithm
Warnsdorff's Algorithm
 Some definitions:
   A position Q is accessible from a position P if P can move to Q by a
    single knight's move, and Q has not yet been visited.
   The accessibility of a position P is the number of positions accessible
    from P.
 Algorithm:
  1.        set P to be a random initial position on the board
  2.        mark the board at P with the move number "1"
  3.        for each move number from 2 to the number of squares on the
            board:
       1.     let S be the set of positions accessible from the input position
       2.     set P to be the position in S with minimum accessibility
       3.     mark the board at P with the current move number
  4.        return the marked board – each square will be marked with the
            move number on which it is visited.
Warnsdorff's Algorithm
 Warnsdorff‟s rule is heuristic
   It is not guaranteed to find a solution.
   It can fail for boards larger than 76x76.
 The reason for using these heuristics instead of an algorithm
  guaranteed to work is speed.
 Improvements by decomposing;
  1. Decompose a large board into smaller rectangles.
  2. Solve those sub rectangles.
  3. Smaller solutions are then joined to form a knight‟s tour.
A 60x60 Knight’s Tour generated by decomposition
Magic Knight’s Tours
 The squares of the chess board are numbered in the order of
  the knight‟s moves.
 Each column, row, and diagonal must sum to the same
  number.
 The first magic knight‟s tour (with sum 260) by William
  Beverley (1848 ).
Beverley’s tour


                 1                                     18
                     48   31     50    33   16    63        260
                                                                  What’s the
            30       51   46      3    62    19   14   35   260     magic
                                                                   number?
            47       2    49     32    15    34   17   64   260

            52       29   4      45    20   61    36   13   260

            5        44   25      56   9    40    21   60   260

            28       53   8      41    24   57    12   37   260

            43       6    55     26    39   10    59   22   260
n (n  1)   54       27   42      7    58   23    38   11   260
                                                                  64 x 65
   16       260 260 260 260 260 260 260 260
                                                                    16
a)     First semi-magic knight‟s tour
b)     In each quadrant, the sum of the numbers equals 520 and each of the rows and
       columns adds to 130
c)     The sum of the numbers in each 2x2 section is 130

     Existence of full magic knight‟s tour on 8x8 was a 150-year-old unsolved
     problem.
     In August 5, 2003, after nearly 62 computation-days, a search
     showed that no 8x8 fully magic knight’s tour is possible.
     http://mathworld.wolfram.com/news/2003-08-06/magictours/
Knight’s Tours and Cryptography
 A cryptotour is a puzzle in which the 64 words or syllables of
  a verse are printed on the squares of a chessboard and are to
  be read in the sequence of a knight‟s tour.
 The earliest known examples of a cryptotour were printed in
  the mid 1800s in a French magazine.
 Published before the invention of crossword puzzles (1890).
Example of a cryptotour from 1870
Longest uncrossed knight's path
 The problem is to find the longest path the knight can take on
  nxn board, such that the path does not intersect itself.
References
 “Knight's tour” [Online]. Available:
  http://en.wikipedia.org/wiki/Knight%27s_tour
 “Longest uncrossed knight's path” [Online]. Available:
  http://en.wikipedia.org/wiki/Longest_uncrossed_knight%
  27s_path
 Ben Hill and Kevin Tostado (Dec 18 2004), “Knight’s Tours”.
  [Online]. Available:
  http://faculty.olin.edu/~sadams/DM/ktpaper.pdf
Thank You

More Related Content

What's hot

heap Sort Algorithm
heap  Sort Algorithmheap  Sort Algorithm
heap Sort AlgorithmLemia Algmri
 
Constraint Satisfaction Problem (CSP) : Cryptarithmetic, Graph Coloring, 4- Q...
Constraint Satisfaction Problem (CSP) : Cryptarithmetic, Graph Coloring, 4- Q...Constraint Satisfaction Problem (CSP) : Cryptarithmetic, Graph Coloring, 4- Q...
Constraint Satisfaction Problem (CSP) : Cryptarithmetic, Graph Coloring, 4- Q...Mahbubur Rahman
 
sum of subset problem using Backtracking
sum of subset problem using Backtrackingsum of subset problem using Backtracking
sum of subset problem using BacktrackingAbhishek Singh
 
3.8 quick sort
3.8 quick sort3.8 quick sort
3.8 quick sortKrish_ver2
 
Analysis of Algorithm (Bubblesort and Quicksort)
Analysis of Algorithm (Bubblesort and Quicksort)Analysis of Algorithm (Bubblesort and Quicksort)
Analysis of Algorithm (Bubblesort and Quicksort)Flynce Miguel
 
Lecture 19 sma star algorithm
Lecture 19 sma star algorithmLecture 19 sma star algorithm
Lecture 19 sma star algorithmHema Kashyap
 
01 knapsack using backtracking
01 knapsack using backtracking01 knapsack using backtracking
01 knapsack using backtrackingmandlapure
 
0-1 KNAPSACK PROBLEM
0-1 KNAPSACK PROBLEM0-1 KNAPSACK PROBLEM
0-1 KNAPSACK PROBLEMi i
 
Backtracking Algorithm.ppt
Backtracking Algorithm.pptBacktracking Algorithm.ppt
Backtracking Algorithm.pptSalmIbrahimIlyas
 
Spanning trees & applications
Spanning trees & applicationsSpanning trees & applications
Spanning trees & applicationsTech_MX
 
Towers Hanoi Algorithm
Towers Hanoi AlgorithmTowers Hanoi Algorithm
Towers Hanoi AlgorithmJorge Jasso
 

What's hot (20)

Knapsack Problem
Knapsack ProblemKnapsack Problem
Knapsack Problem
 
heap Sort Algorithm
heap  Sort Algorithmheap  Sort Algorithm
heap Sort Algorithm
 
A* Algorithm
A* AlgorithmA* Algorithm
A* Algorithm
 
Quick sort
Quick sortQuick sort
Quick sort
 
convex hull
convex hullconvex hull
convex hull
 
Quick sort
Quick sortQuick sort
Quick sort
 
Approximation Algorithms
Approximation AlgorithmsApproximation Algorithms
Approximation Algorithms
 
Heap and heapsort
Heap and heapsortHeap and heapsort
Heap and heapsort
 
Heap sort
Heap sortHeap sort
Heap sort
 
Constraint Satisfaction Problem (CSP) : Cryptarithmetic, Graph Coloring, 4- Q...
Constraint Satisfaction Problem (CSP) : Cryptarithmetic, Graph Coloring, 4- Q...Constraint Satisfaction Problem (CSP) : Cryptarithmetic, Graph Coloring, 4- Q...
Constraint Satisfaction Problem (CSP) : Cryptarithmetic, Graph Coloring, 4- Q...
 
sum of subset problem using Backtracking
sum of subset problem using Backtrackingsum of subset problem using Backtracking
sum of subset problem using Backtracking
 
3.8 quick sort
3.8 quick sort3.8 quick sort
3.8 quick sort
 
Analysis of Algorithm (Bubblesort and Quicksort)
Analysis of Algorithm (Bubblesort and Quicksort)Analysis of Algorithm (Bubblesort and Quicksort)
Analysis of Algorithm (Bubblesort and Quicksort)
 
Lecture 19 sma star algorithm
Lecture 19 sma star algorithmLecture 19 sma star algorithm
Lecture 19 sma star algorithm
 
01 knapsack using backtracking
01 knapsack using backtracking01 knapsack using backtracking
01 knapsack using backtracking
 
0-1 KNAPSACK PROBLEM
0-1 KNAPSACK PROBLEM0-1 KNAPSACK PROBLEM
0-1 KNAPSACK PROBLEM
 
Backtracking Algorithm.ppt
Backtracking Algorithm.pptBacktracking Algorithm.ppt
Backtracking Algorithm.ppt
 
Spanning trees & applications
Spanning trees & applicationsSpanning trees & applications
Spanning trees & applications
 
Minimum spanning tree
Minimum spanning treeMinimum spanning tree
Minimum spanning tree
 
Towers Hanoi Algorithm
Towers Hanoi AlgorithmTowers Hanoi Algorithm
Towers Hanoi Algorithm
 

Viewers also liked

Building a Library Website with WordPress
Building a Library Website with WordPressBuilding a Library Website with WordPress
Building a Library Website with WordPressNicole C. Engard
 
American Mass Media - Website Development Pitch Outline
American Mass Media - Website Development Pitch Outline American Mass Media - Website Development Pitch Outline
American Mass Media - Website Development Pitch Outline Meier Marketing
 
Saayam website Outline
Saayam website OutlineSaayam website Outline
Saayam website OutlineBharath Reddy
 
Digital Marketing for the Travel Industry in the Web 2.0. Scenario
Digital Marketing for the Travel Industry in the Web 2.0. ScenarioDigital Marketing for the Travel Industry in the Web 2.0. Scenario
Digital Marketing for the Travel Industry in the Web 2.0. Scenariodelhibloggers
 
What to do before you launch a website
What to do before you launch a websiteWhat to do before you launch a website
What to do before you launch a websiteA Website Designer
 
Creating a Website Sitemap
Creating a Website SitemapCreating a Website Sitemap
Creating a Website SitemapJeannie Melinz
 
Travel agency and tour operations lecture
Travel agency and tour operations lectureTravel agency and tour operations lecture
Travel agency and tour operations lectureJheffrey Palma
 

Viewers also liked (8)

Building a Library Website with WordPress
Building a Library Website with WordPressBuilding a Library Website with WordPress
Building a Library Website with WordPress
 
American Mass Media - Website Development Pitch Outline
American Mass Media - Website Development Pitch Outline American Mass Media - Website Development Pitch Outline
American Mass Media - Website Development Pitch Outline
 
Saayam website Outline
Saayam website OutlineSaayam website Outline
Saayam website Outline
 
Digital Marketing for the Travel Industry in the Web 2.0. Scenario
Digital Marketing for the Travel Industry in the Web 2.0. ScenarioDigital Marketing for the Travel Industry in the Web 2.0. Scenario
Digital Marketing for the Travel Industry in the Web 2.0. Scenario
 
What to do before you launch a website
What to do before you launch a websiteWhat to do before you launch a website
What to do before you launch a website
 
Website Outline
Website OutlineWebsite Outline
Website Outline
 
Creating a Website Sitemap
Creating a Website SitemapCreating a Website Sitemap
Creating a Website Sitemap
 
Travel agency and tour operations lecture
Travel agency and tour operations lectureTravel agency and tour operations lecture
Travel agency and tour operations lecture
 

More from Kelum Senanayake

Couchbase - Yet Another Introduction
Couchbase - Yet Another IntroductionCouchbase - Yet Another Introduction
Couchbase - Yet Another IntroductionKelum Senanayake
 
What you need to know about GC
What you need to know about GCWhat you need to know about GC
What you need to know about GCKelum Senanayake
 
A Searchable Symmetric Key Cipher System
A Searchable Symmetric Key Cipher SystemA Searchable Symmetric Key Cipher System
A Searchable Symmetric Key Cipher SystemKelum Senanayake
 
EJB 3.0 - Yet Another Introduction
EJB 3.0 - Yet Another IntroductionEJB 3.0 - Yet Another Introduction
EJB 3.0 - Yet Another IntroductionKelum Senanayake
 
Security Risks & Vulnerabilities in Skype
Security Risks & Vulnerabilities in SkypeSecurity Risks & Vulnerabilities in Skype
Security Risks & Vulnerabilities in SkypeKelum Senanayake
 
The NFS Version 4 Protocol
The NFS Version 4 ProtocolThe NFS Version 4 Protocol
The NFS Version 4 ProtocolKelum Senanayake
 

More from Kelum Senanayake (10)

Couchbase - Yet Another Introduction
Couchbase - Yet Another IntroductionCouchbase - Yet Another Introduction
Couchbase - Yet Another Introduction
 
Node.js Introduction
Node.js IntroductionNode.js Introduction
Node.js Introduction
 
What you need to know about GC
What you need to know about GCWhat you need to know about GC
What you need to know about GC
 
A Searchable Symmetric Key Cipher System
A Searchable Symmetric Key Cipher SystemA Searchable Symmetric Key Cipher System
A Searchable Symmetric Key Cipher System
 
Blind Signature Scheme
Blind Signature SchemeBlind Signature Scheme
Blind Signature Scheme
 
EJB 3.0 - Yet Another Introduction
EJB 3.0 - Yet Another IntroductionEJB 3.0 - Yet Another Introduction
EJB 3.0 - Yet Another Introduction
 
Security Risks & Vulnerabilities in Skype
Security Risks & Vulnerabilities in SkypeSecurity Risks & Vulnerabilities in Skype
Security Risks & Vulnerabilities in Skype
 
The NFS Version 4 Protocol
The NFS Version 4 ProtocolThe NFS Version 4 Protocol
The NFS Version 4 Protocol
 
GPU Programming with Java
GPU Programming with JavaGPU Programming with Java
GPU Programming with Java
 
How to Share a Secret
How to Share a SecretHow to Share a Secret
How to Share a Secret
 

Recently uploaded

BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...Sapna Thakur
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Disha Kariya
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfAyushMahapatra5
 
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...fonyou31
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfchloefrazer622
 
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfchloefrazer622
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfagholdier
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphThiyagu K
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104misteraugie
 
General AI for Medical Educators April 2024
General AI for Medical Educators April 2024General AI for Medical Educators April 2024
General AI for Medical Educators April 2024Janet Corral
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 

Recently uploaded (20)

BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdf
 
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdf
 
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdf
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
General AI for Medical Educators April 2024
General AI for Medical Educators April 2024General AI for Medical Educators April 2024
General AI for Medical Educators April 2024
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 

Knight's Tour

  • 1. Knight’s Tour Kelum Senanayake
  • 2. Outline  What is „Knight‟s Tour  Theory  Knight's graph  Computer Algorithms  Warnsdorff's Algorithm  Magic Knight‟s Tours  Knight‟s Tours and Cryptography  Longest uncrossed knight's path
  • 3. What is ‘Knight’s Tour?  Chess problem involving a knight  Start on a random square  Visit each square exactly ONCE according to rules  Tour called closed, if ending square is same as the starting.  Variations of the knight's tour problem.  Different sizes than the usual 8 × 8  Irregular (non-rectangular) boards.
  • 4. A Knights Tour – Legal Moves
  • 5.
  • 6.
  • 7. Theory  Knight‟s tour can be represented as a graph.  The vertices - Represent the squares of the board.  The edges - Represent a knight‟s legal moves between squares.  Knight‟s tour is simply an instance of Hamiltonian path.  A closed tour is a Hamiltonian cycle.  Knight's tour problem can be solved in linear time.
  • 9. Computer Algorithms  Brute-force search ???  Iterates through all possible move sequences.  For a regular 8x8 chess board, there are approximately 4×1051 possible move sequences.  Brute force approach can never be applied to the Knight's Tour problem.  Neural network solutions.  Can be solved by a neural network implementation.  Every legal knight's move is represented by a neuron.  Warnsdorff's algorithm
  • 10. Warnsdorff's Algorithm  Heuristic Method.  Introduced by H. C. Warnsdorff in 1823.  Any initial position of the knight on the board.  Each move is made to the adjacent vertex with the least degree.  May also more generally be applied to any graph.  On many graphs that occur in practice this heuristic is able to successfully locate a solution in linear time.
  • 12. Warnsdorff's Algorithm  Some definitions:  A position Q is accessible from a position P if P can move to Q by a single knight's move, and Q has not yet been visited.  The accessibility of a position P is the number of positions accessible from P.  Algorithm: 1. set P to be a random initial position on the board 2. mark the board at P with the move number "1" 3. for each move number from 2 to the number of squares on the board: 1. let S be the set of positions accessible from the input position 2. set P to be the position in S with minimum accessibility 3. mark the board at P with the current move number 4. return the marked board – each square will be marked with the move number on which it is visited.
  • 13. Warnsdorff's Algorithm  Warnsdorff‟s rule is heuristic  It is not guaranteed to find a solution.  It can fail for boards larger than 76x76.  The reason for using these heuristics instead of an algorithm guaranteed to work is speed.  Improvements by decomposing; 1. Decompose a large board into smaller rectangles. 2. Solve those sub rectangles. 3. Smaller solutions are then joined to form a knight‟s tour.
  • 14. A 60x60 Knight’s Tour generated by decomposition
  • 15. Magic Knight’s Tours  The squares of the chess board are numbered in the order of the knight‟s moves.  Each column, row, and diagonal must sum to the same number.  The first magic knight‟s tour (with sum 260) by William Beverley (1848 ).
  • 16. Beverley’s tour 1 18 48 31 50 33 16 63 260 What’s the 30 51 46 3 62 19 14 35 260 magic number? 47 2 49 32 15 34 17 64 260 52 29 4 45 20 61 36 13 260 5 44 25 56 9 40 21 60 260 28 53 8 41 24 57 12 37 260 43 6 55 26 39 10 59 22 260 n (n  1) 54 27 42 7 58 23 38 11 260 64 x 65 16 260 260 260 260 260 260 260 260 16
  • 17. a) First semi-magic knight‟s tour b) In each quadrant, the sum of the numbers equals 520 and each of the rows and columns adds to 130 c) The sum of the numbers in each 2x2 section is 130 Existence of full magic knight‟s tour on 8x8 was a 150-year-old unsolved problem. In August 5, 2003, after nearly 62 computation-days, a search showed that no 8x8 fully magic knight’s tour is possible. http://mathworld.wolfram.com/news/2003-08-06/magictours/
  • 18. Knight’s Tours and Cryptography  A cryptotour is a puzzle in which the 64 words or syllables of a verse are printed on the squares of a chessboard and are to be read in the sequence of a knight‟s tour.  The earliest known examples of a cryptotour were printed in the mid 1800s in a French magazine.  Published before the invention of crossword puzzles (1890).
  • 19. Example of a cryptotour from 1870
  • 20. Longest uncrossed knight's path  The problem is to find the longest path the knight can take on nxn board, such that the path does not intersect itself.
  • 21. References  “Knight's tour” [Online]. Available: http://en.wikipedia.org/wiki/Knight%27s_tour  “Longest uncrossed knight's path” [Online]. Available: http://en.wikipedia.org/wiki/Longest_uncrossed_knight% 27s_path  Ben Hill and Kevin Tostado (Dec 18 2004), “Knight’s Tours”. [Online]. Available: http://faculty.olin.edu/~sadams/DM/ktpaper.pdf