Skip to Main Content
A genetic algorithm is used to find solutions to the standard 8×8 knight's tour problem, and its performance is compared against standard depth-first search with backtracking. The binary encoding is described, along with a simple repair technique which can be used to extend tours that have reached impasse. The repair method is powerful enough on its own to find complete tours, given randomly generated bitstrings. But when used in conjunction with a genetic algorithm, considerably more solutions are found. Depth-first search is shown to find more solutions under certain conditions, but the genetic algorithm finds solutions more consistently for arbitrary initial conditions.