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.
For example, consider the following Knight’s Tour problem.
The knight is placed on the empty board and, moving according to the rules of chess, must visit each square exactly once.
Refer : http://www.geeksforgeeks.org/archives/12916
For example, consider the following Knight’s Tour problem.
The knight is placed on the empty board and, moving according to the rules of chess, must visit each square exactly once.
Refer : http://www.geeksforgeeks.org/archives/12916
No comments:
Post a Comment