Lably
Skip to content

Constraint satisfaction problem

Set of objects whose state must satisfy limits

  • 8 min read
  • 4 chapters

Related on Lably

Through State (computer science), Constraint (mathematics) and Limit (mathematics)

Examples of problems that can be modeled as a constraint satisfaction problem include:

These are often provided with tutorials of CP, ASP, Boolean SAT and SMT solvers. In the general case, constraint problems can be much harder, and may not be expressible in some of these simpler systems. "Real life" examples include automated planning, lexical disambiguation, musicology, product configuration and resource allocation.

The existence of a solution to a CSP can be viewed as a decision problem. This can be decided by finding a solution, or failing to find a solution after exhaustive search (stochastic algorithms typically never reach an exhaustive conclusion, while directed searches often do, on sufficiently small problems). In some cases the CSP might be known to have solutions beforehand, through some other mathematical inference process.

Formal definition

Formally, a constraint satisfaction problem is defined as a triple ⟨X,D,C⟩, where

  • X={X1,…,Xn} is a set of variables,
  • D={D1,…,Dn} is a set of their respective domains of values, and
  • C={C1,…,Cm} is a set of constraints.

Each variable Xi can take on the values in the nonempty domain Di. Every constraint Cj∈C is in turn a pair ⟨tj,Rj⟩, where tj⊆{1,2,…,n} is a set of k indices and Rj is a k-ary relation on the corresponding product of domains ×i∈tjDi where the product is taken with indices in ascending order. An evaluation of the variables is a function from a subset of variables to a particular set of values in the corresponding subset of domains. An evaluation v satisfies a constraint ⟨tj,Rj⟩ if the values assigned to the variables tj satisfy the relation Rj.

An evaluation is consistent if it does not violate any of the constraints. An evaluation is complete if it includes all variables. An evaluation is a solution if it is consistent and complete; such an evaluation is said to solve the constraint satisfaction problem.

Sign in to keep reading

3 more chapters are free with a Lably account.

More in Computing and communication