Skip to content

Latest commit

 

History

History

The Knight’s Tour Problem

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

Backtracking is an algorithmic paradigm that tries different solutions until finds a solution that “works”. Problems which are typically solved using backtracking technique have following property in common. These problems can only be solved by trying every possible configuration and each configuration is tried only once. A Naive solution for these problems is to try all configurations and output a configuration that follows given problem constraints. Backtracking works in incremental way and is an optimization over the Naive solution where all possible configurations are generated and tried.

For example, consider the following Knight’s Tour problem.

The knight is placed on the first block of an empty board and, moving according to the rules of chess, must visit each square exactly once.