Backtracking search is a systematic, depth-first search algorithm that incrementally builds candidate solutions to a constraint satisfaction problem (CSP) and abandons a candidate—'backtracks'—as soon as it determines the candidate cannot be extended to a valid, complete solution. It operates by assigning values to variables one at a time, checking consistency with all constraints after each assignment. This chronological backtracking upon failure makes it a complete algorithm, guaranteed to find a solution if one exists or prove unsatisfiability by exhaustively exploring the search space, albeit often inefficiently for large problems.
