Is there a way for a chess knight to start at the top-left corner from a N x N chessboard, visit all the squares of the board exactly once and end at the lower-right corner.
We need to traverse all the squares of the chessboard exactly once. Also, the moves of the knight are L-shaped, that is, traverse two squares vertically or horizontally. A simple observation to take from this is that in one move, the knight starts and ends at two different colored squares.
Consider two cases:
Case N is even: Let the value of N be 8. Hence, total number of squares on the board will be 64. Now, to visit all the squares of the board exactly once the knight would have to make 63 moves. Since, total number of moves are odd, the journey will start and end on the squares of the opposite color. Since, the squares on the top-left corner and lower-right corner are both coloured the same, hence the journey is impossible.
Case N is odd: Let the value of N be 9. Hence, total number of squares on the board will be 81. Now, to visit all the squares of the board exactly once the knight would have to make 80 moves. Since, total number of moves are even, the journey will start and end on the squares of the same color. Since, the squares on the upper-left corner and lower-right corner are of the same color, hence the journey on 9 x 9 board is possible.
Hence, on a N x N chessboard, a knight will have to make (N2 – 1) moves to visit each square exactly once. So, if N is even, the journey is impossible and for odd values of N, the journey is possible.
- Minimum steps to reach target by a Knight | Set 1
- Minimum steps to reach target by a Knight | Set 2
- Puzzle | Dividing a Square into N smaller squares
- Possible moves of knight
- Probability of Knight to remain in the chessboard
- The Knight's tour problem | Backtracking-1
- Warnsdorff's algorithm for Knight’s tour problem
- Number of blocks in a chessboard a knight can move to in exactly k moves
- Puzzle 51| Cheryl’s Birthday Puzzle and Solution
- Puzzle 81 | 100 people in a circle with gun puzzle
- Puzzle | 3 Priests and 3 devils Puzzle
- Puzzle 85 | Chain Link Puzzle
- Puzzle 34 | (Prisoner and Policeman Puzzle)
- Puzzle 15 | (Camel and Banana Puzzle)
- Puzzle | Elevator Puzzle
- Puzzle 39 | (100 coins puzzle)
- Puzzle 36 | (Matchstick Puzzle)
- Puzzle 24 | (10 Coins Puzzle)
- Puzzle 29 | (Car Wheel Puzzle)
- Puzzle 27 | (Hourglasses Puzzle)
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.