Backtracking
Backtracking is a general algorithmic technique for solving constraint satisfaction problems and various combinatorial search tasks. It solves problems by constructing candidates incrementally and abandoning a partial candidate as soon as it becomes clear that it cannot be extended to a valid solution. The search typically proceeds in a depth-first manner, exploring one branch completely before moving to the next.
The method follows a simple pattern: select a variable, assign a value from its domain, and check
Backtracking is exponential in the worst case, since it may explore all possible assignments. Its practicality
Common applications include puzzle solving and CSPs such as the N-Queens problem, Sudoku, graph coloring, Hamiltonian
Enhancements to backtracking include forward checking, arc consistency, and other forms of constraint propagation, as well
---