Backtracking: Definition Constraints
Backtracking: Definition Constraints
Definition
Constraints
• Explicit constraints
• Implicit constraints
Backtracking Algorithm:
Examples
Definition
• Backtracking is one of the most general algorithm design
technique useful for optimizing search under some
constraints.
• Many problems which deal with searching for a set of
solutions or for a optimal solution satisfying some
constraints can be solved using the backtracking
formulation.
• To apply backtracking method, the desired
solution must be expressible as an n-tuple (x1…
xn) where xi is chosen from some finite set Si.
Backtrack approach,
• Requires less than m trials to determine the solution
i) Explicit constraints
• Graph coloring.
• Hamiltonian cycle.
• N-Queens problem.