Jump to content

Constraint (mathematics): Difference between revisions

From Wikipedia, the free encyclopedia
Content deleted Content added
Added {{no footnotes}} tag to article (TW)
Reverted 2 edits by 2600:1700:A855:C810:61BC:4C3A:C4A:E502 (talk): Unexplained content removal
 
(38 intermediate revisions by 27 users not shown)
Line 1: Line 1:
{{short description|Condition of an optimization problem which the solution must satisfy}}
{{for |constraints in Hamiltonian mechanics|constraint (classical mechanics)|first class constraint|primary constraint|holonomic constraint}}
{{for |constraints in Hamiltonian mechanics|constraint (classical mechanics)|first class constraint|primary constraint|holonomic constraint}}
{{no footnotes|date=September 2016}}
{{no footnotes|date=September 2016}}

In [[mathematics]], a '''constraint''' is a condition of an [[optimization (mathematics)|optimization]] problem that the solution must satisfy. There are several types of constraints—primarily [[Equality (mathematics)|equality]] constraints, [[Inequality (mathematics)|inequality]] constraints, and [[Integer programming|integer constraints]]. The set of [[candidate solution]]s that satisfy all constraints is called the [[feasible set]].
In [[mathematics]], a '''constraint''' is a condition of an [[optimization (mathematics)|optimization]] problem that the solution must satisfy. There are several types of constraints&mdash;primarily [[Equality (mathematics)|equality]] constraints, [[Inequality (mathematics)|inequality]] constraints, and [[Integer programming|integer constraints]]. The set of [[candidate solution]]s that satisfy all constraints is called the [[feasible set]].<ref>{{cite book |first=Akira |last=Takayama |title=Mathematical Economics |location=New York |publisher=Cambridge University Press |edition=2nd |year=1985 |isbn=0-521-31498-4 |page=[https://archive.org/details/mathematicalecon00taka/page/61 61] |url=https://archive.org/details/mathematicalecon00taka |url-access=registration }}</ref>


==Example==
==Example==
The following is a simple optimization problem:
The following is a simple optimization problem:
:<math>\min f(\bold x) = x_1^2+x_2^4</math>
:<math>\min f(\mathbf x) = x_1^2+x_2^4</math>


subject to
subject to
Line 15: Line 17:
:<math>x_2 = 1,</math>
:<math>x_2 = 1,</math>


where <math>\bold x</math> denotes the vector (x<sub>1</sub>, x<sub>2</sub>).
where <math>\mathbf x</math> denotes the vector (''x''<sub>1</sub>, ''x''<sub>2</sub>).


In this example, the first line defines the function to be minimized (called the [[objective 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 are [[hard constraint]]s, meaning that it is required that they be satisfied; they define the feasible set of candidate solutions.
In this example, the first line defines the function to be minimized (called the [[objective 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 are [[hard constraint]]s, 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 <math>f(\bold x)</math> has the lowest value. But this solution does not satisfy the constraints. The solution of the constrained optimization problem stated above is <math>\bold x = (1,1)</math>, which is the point with the smallest value of <math>f(\bold x)</math> that satisfies the two constraints.
Without the constraints, the solution would be (0,0), where <math>f(\mathbf x)</math> has the lowest value. But this solution does not satisfy the constraints. The solution of the [[constrained optimization]] problem stated above is <math>\mathbf x = (1,1)</math>, which is the point with the smallest value of <math>f(\mathbf x)</math> that satisfies the two constraints.


== Terminology ==
== Terminology ==
* If an inequality constraint holds with ''equality'' at the optimal point, the constraint is said to be '''{{visible anchor|binding}}''', as the point ''cannot'' be varied in the direction of the constraint even though doing so would improve the value of the objective function.
* If an inequality constraint holds with ''equality'' at the optimal point, the constraint is said to be '''{{visible anchor|binding}}''', as the point ''cannot'' be varied in the direction of the constraint even though doing so would improve the value of the objective function.
* If an inequality constraint holds as a ''strict inequality'' at the optimal point (that is, does not hold with equality), the constraint is said to be '''{{visible anchor|non-binding}}''', as the point ''could'' be varied in the direction of the constraint, although it would not be optimal to do so. If a constraint is non-binding, the optimization problem would have the same solution even in the absence of that constraint.
* If an inequality constraint holds as a ''strict inequality'' at the optimal point (that is, does not hold with equality), the constraint is said to be '''{{visible anchor|non-binding}}''', as the point ''could'' be varied in the direction of the constraint, although it would not be optimal to do so. Under certain conditions, as for example in convex optimization, if a constraint is non-binding, the optimization problem would have the same solution even in the absence of that constraint.
* If a constraint is not satisfied at a given point, the point is said to be '''[[Feasible region|infeasible]]'''.
* If a constraint is not satisfied at a given point, the point is said to be '''[[Feasible region|infeasible]]'''.


==Hard and soft constraints==
==Hard and soft constraints==


If the problem mandates that the constraints be satisfied, as in the above discussion, the constraints are sometimes referred to as ''hard constraints''. However, in some problems, called [[Constraint satisfaction problem#Flexible CSPs|flexible constraint satisfaction problems]], it is preferred but not required that certain constraints be satisfied; such non-mandatory constraints are known as ''[[Constraint optimization#Definition|soft constraints]]''. Soft constraints arise in, for example, [[preference-based planning]]. In a [[MAX-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.
If the problem mandates that the constraints be satisfied, as in the above discussion, the constraints are sometimes referred to as ''hard constraints''. However, in some problems, called [[Constraint satisfaction problem#Flexible CSPs|flexible constraint satisfaction problems]], it is preferred but not required that certain constraints be satisfied; such non-mandatory constraints are known as ''[[Constraint optimization#General form|soft constraints]]''. Soft constraints arise in, for example, [[preference-based planning]]. In a [[MAX-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 ==
Global constraints<ref>{{Cite book|title=Handbook of constraint programming|last1=Rossi|first1=Francesca|last2=Van Beek|first2=Peter|last3=Walsh|first3=Toby|date=2006|publisher=Elsevier|isbn=9780080463643|edition=1st|location=Amsterdam|chapter=7|oclc=162587579}}</ref> are constraints representing a specific relation on a number of variables, taken altogether. Some of them, such as the [https://sofdem.github.io/gccat/gccat/Calldifferent.html <code>alldifferent</code>] constraint, can be rewritten as a conjunction of atomic constraints in a simpler language: the <code>alldifferent</code> constraint holds on ''n'' variables <math>x_1... x_n</math>, and is satisfied if the variables take values which are pairwise different. It is semantically equivalent to the conjunction of inequalities <math>x_1 \neq x_2, x_1 \neq x_3..., x_2 \neq x_3, x_2 \neq x_4 ... x_{n-1} \neq x_n</math>. Other global constraints extend the expressivity of the constraint framework. In this case, they usually capture a typical structure of combinatorial problems. For instance, the <code>[[Regular constraint|regular]]</code> constraint expresses that a sequence of variables is accepted by a [[deterministic finite automaton]].

Global constraints are used<ref>{{Cite book|title=Principles and Practice of Constraint Programming CP 2003 00 : 9th International Conference, CP 2003, Kinsale, Ireland, September 29 October 3, 2003. Proceedings|date=2003|publisher=Springer-Verlag Berlin Heidelberg|last=Rossi|first=Francesca|isbn=9783540451938|location=Berlin|oclc=771185146}}</ref> to simplify the modeling of [[constraint satisfaction problems]], to extend the expressivity of constraint languages, and also to improve the [[Constraint programming|constraint 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 an [https://sofdem.github.io/gccat/ online catalog.]


== See also ==
== See also ==
{{Div col|colwidth=25em}}
* [[Constraint satisfaction problem]]
* [[Constraint algebra]]
* [[Karush–Kuhn–Tucker conditions]]
* [[Karush–Kuhn–Tucker conditions]]
* [[Lagrange multipliers]]
* [[Lagrange multipliers]]
Line 37: Line 45:
* [[Linear programming]]
* [[Linear programming]]
* [[Nonlinear programming]]
* [[Nonlinear programming]]
* [[Restriction (mathematics)|Restriction]]
* [[Satisfiability modulo theories]]
{{Div col end}}

== References ==
{{Reflist}}

== Further reading ==
* {{cite book |first=Gordon S. G. |last=Beveridge |first2=Robert S. |last2=Schechter |chapter=Essential Features in Optimization |title=Optimization: Theory and Practice |location=New York |publisher=McGraw-Hill |year=1970 |pages=5–8 |isbn=0-07-005128-3 |chapter-url=https://books.google.com/books?id=TfhVXlWtOPQC&pg=PA5 }}


== External links ==
== External links ==
*[http://www.neos-guide.org/non-lp-faq Nonlinear programming FAQ]
*[http://www.neos-guide.org/non-lp-faq Nonlinear programming FAQ] {{Webarchive|url=https://web.archive.org/web/20191030134942/https://neos-guide.org/non-lp-faq |date=2019-10-30 }}
*[http://glossary.computing.society.informs.org/ Mathematical Programming Glossary]
*[http://glossary.computing.society.informs.org/ Mathematical Programming Glossary] {{Webarchive|url=https://web.archive.org/web/20100328165516/http://glossary.computing.society.informs.org/ |date=2010-03-28 }}


[[Category:Mathematical optimization]]
[[Category:Mathematical optimization]]
[[Category:Constraint programming]]


[[ca:Restricció]]
[[ca:Restricció]]

Latest revision as of 20:01, 20 March 2024

In mathematics, a constraint is a condition of an optimization problem that the solution must satisfy. There are several types of constraints—primarily equality constraints, inequality constraints, and integer constraints. The set of candidate solutions that satisfy all constraints is called the feasible set.[1]

Example

[edit]

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 the objective 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 are hard 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 the constrained optimization problem stated above is , which is the point with the smallest value of that satisfies the two constraints.

Terminology

[edit]
  • If an inequality constraint holds with equality at the optimal point, the constraint is said to be binding, as the point cannot be varied in the direction of the constraint even though doing so would improve the value of the objective function.
  • If an inequality constraint holds as a strict inequality at the optimal point (that is, does not hold with equality), the constraint is said to be non-binding, as the point could be varied in the direction of the constraint, although it would not be optimal to do so. Under certain conditions, as for example in convex optimization, if a constraint is non-binding, the optimization problem would have the same solution even in the absence of that constraint.
  • If a constraint is not satisfied at a given point, the point is said to be infeasible.

Hard and soft constraints

[edit]

If the problem mandates that the constraints be satisfied, as in the above discussion, the constraints are sometimes referred to as hard constraints. However, in some problems, called flexible constraint satisfaction problems, it is preferred but not required that certain constraints be satisfied; such non-mandatory constraints are known as soft constraints. Soft constraints arise in, for example, preference-based planning. In a MAX-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

[edit]

Global constraints[2] are constraints representing a specific relation on a number of variables, taken altogether. Some of them, such as the alldifferent constraint, can be rewritten as a conjunction of atomic constraints in a simpler language: the alldifferent constraint holds on n 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, the regular constraint expresses that a sequence of variables is accepted by a deterministic finite automaton.

Global constraints are used[3] to simplify the modeling of constraint satisfaction problems, to extend the expressivity of constraint languages, and also to improve the constraint 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 an online catalog.

See also

[edit]

References

[edit]
  1. ^ Takayama, Akira (1985). Mathematical Economics (2nd ed.). New York: Cambridge University Press. p. 61. ISBN 0-521-31498-4.
  2. ^ Rossi, Francesca; Van Beek, Peter; Walsh, Toby (2006). "7". Handbook of constraint programming (1st ed.). Amsterdam: Elsevier. ISBN 9780080463643. OCLC 162587579.
  3. ^ Rossi, Francesca (2003). Principles and Practice of Constraint Programming CP 2003 00 : 9th International Conference, CP 2003, Kinsale, Ireland, September 29 October 3, 2003. Proceedings. Berlin: Springer-Verlag Berlin Heidelberg. ISBN 9783540451938. OCLC 771185146.

Further reading

[edit]
[edit]