This article includes alist of references,related reading, orexternal links,but its sources remain unclear because it lacksinline citations. Please helpimprove this article byintroducing more precise citations.(September 2016) (Learn how and when to remove this message) |
Inmathematics, aconstraint is a condition of anoptimization problem that the solution must satisfy. There are several types of constraints—primarilyequality constraints,inequality constraints, andinteger constraints. The set ofcandidate solutions that satisfy all constraints is called thefeasible set.[1]
The following is a simple optimization problem:
subject to
and
where denotes the vector (x1,x2).
In this example, the first line defines the function to be minimized (called theobjective function, loss function, or cost function). The second and third lines define two constraints, the first of which is an inequality constraint and the second of which is an equality constraint. These two constraints arehard constraints, meaning that it is required that they be satisfied; they define the feasible set of candidate solutions.
Without the constraints, the solution would be (0,0), where has the lowest value. But this solution does not satisfy the constraints. The solution of theconstrained optimization problem stated above is, which is the point with the smallest value of that satisfies the two constraints.
If the problem mandates that the constraints be satisfied, as in the above discussion, the constraints are sometimes referred to ashard constraints. However, in some problems, calledflexible constraint satisfaction problems, it is preferred but not required that certain constraints be satisfied; such non-mandatory constraints are known assoft constraints. Soft constraints arise in, for example,preference-based planning. In aMAX-CSP problem, a number of constraints are allowed to be violated, and the quality of a solution is measured by the number of satisfied constraints.
Global constraints[2] are constraints representing a specific relation on a number of variables, taken altogether. Some of them, such as thealldifferent constraint, can be rewritten as a conjunction of atomic constraints in a simpler language: thealldifferent constraint holds onn variables, and is satisfied if the variables take values which are pairwise different. It is semantically equivalent to the conjunction of inequalities. Other global constraints extend the expressivity of the constraint framework. In this case, they usually capture a typical structure of combinatorial problems. For instance, theregular constraint expresses that a sequence of variables is accepted by adeterministic finite automaton.
Global constraints are used[3] to simplify the modeling ofconstraint satisfaction problems, to extend the expressivity of constraint languages, and also to improve theconstraint resolution: indeed, by considering the variables altogether, infeasible situations can be seen earlier in the solving process. Many of the global constraints are referenced into anonline catalog.