Problems solved by finding variable assignments that satisfy all defined constraints simultaneously.
A Constraint Satisfaction Problem (CSP) is a mathematical framework in which a solution must be found by assigning values to a set of variables such that every constraint in the problem is satisfied. Each variable has an associated domain of possible values, and constraints specify which combinations of assignments across variables are permissible. This formalism provides a clean, declarative way to represent a wide range of real-world problems, from scheduling and resource allocation to configuration and planning, making it one of the most broadly applicable paradigms in AI.
Solving a CSP typically involves searching through the space of possible variable assignments. The most fundamental approach is backtracking search, which incrementally assigns values to variables and abandons a partial assignment as soon as a constraint violation is detected. This basic strategy is dramatically improved by constraint propagation techniques—such as arc consistency (AC-3)—which prune the domains of unassigned variables by eliminating values that cannot participate in any valid complete solution. Heuristics like minimum remaining values (MRV) and least constraining value further guide the search toward solutions more efficiently.
Beyond exact methods, local search algorithms such as min-conflicts provide scalable alternatives for large CSPs by iteratively adjusting assignments to reduce constraint violations, often finding good solutions quickly even when exhaustive search is infeasible. Modern CSP solvers also incorporate techniques like nogood recording, backjumping, and symmetry breaking to handle industrial-scale problems. These advances have made CSP solvers competitive tools in domains like compiler register allocation, hardware verification, and combinatorial optimization.
CSPs matter to machine learning both as a standalone reasoning tool and as a component within hybrid systems. Constraint-based reasoning is used in neural-symbolic AI to enforce logical or structural rules on model outputs, and CSP techniques underpin many probabilistic graphical model inference algorithms. As AI systems are increasingly required to operate under hard constraints—safety requirements, fairness criteria, physical laws—the CSP framework offers a principled way to integrate such requirements directly into the problem formulation.