This preview shows page 1. Sign up to view the full content.
Unformatted text preview: CS 325 Due: Fri 3 Dec Homework #9 The Knight’s Tour Problem A knight is a chesspiece which can legally move from a square ( i,j ) on a chessboard (where i is the row index, and j is the column index) to any of the eight squares ( i- 1 ,j- 2) , ( i- 1 ,j + 2) , ( i + 1 ,j- 2) , ( i + 1 ,j + 2) , ( i- 2 ,j- 1) , ( i- 2 ,j + 1) , ( i + 2 ,j- 1) , ( i + 2 ,j + 1), as long as they are on the chessboard. You are interested in finding knight’s tours of various n × m gameboards. A knight’s tour is a sequence of squares from the gameboard so that each square appears exactly once in the sequence, and each square is a legal knight’s move from its previous square. A tour is closed if there is a legal knight’s move from the last square of the sequence back to the first square. Otherwise, the tour is open. You will study a heuristic for this problem. A heuristic (without backtracking) will usually find a tour, but may occasionally fail to find a tour. Given a partial tour, you will try to lengthen the tour bytour, but may occasionally fail to find a tour....
View Full Document
This note was uploaded on 12/04/2010 for the course CS 325 taught by Professor Staff during the Fall '08 term at Oregon State.
- Fall '08