In [[mathematical optimization]], '''constrained optimization''' (in some contexts called '''constraint optimization''') is the process of optimizing an objective function with respect to some [[variable (mathematics)|variables]] in the presence of [[Constraint (mathematics)|constraints]] on those variables. The objective function is either a [[Loss function|cost function]] or [[energy function]], which is to be [[Maxima and minima|minimized]], or a [[reward function]] or [[utility function]], which is to be [[maximize]]d. Constraints can be either '''hard constraints''', which set conditions for the variables that are required to be satisfied, or '''soft constraints''', which have some variable values that are penalized in the objective function if, and based on the extent that, the conditions on the variables are not satisfied.
===Relation to Constraintconstraint-satisfaction Satisfaction Problemsproblems===
ConstraintThe Optimizationconstrained-optimization Problemproblem (COP) is the mosta significant generalizationsgeneralization of the classic [[Constraint constraint-satisfaction problem|Constraint Satisfaction Problems]] (CSP) model<ref>{{Citation|last=Rossi|first=Francesca|title=Chapter 1 -– Introduction|date=2006-01-01|url=http://www.sciencedirect.com/science/article/pii/S1574652606800052|work=Foundations of Artificial Intelligence|volume=2|pages=3–12|editor-last=Rossi|editor-first=Francesca|series=Handbook of Constraint Programming|publisher=Elsevier|doi=10.1016/s1574-6526(06)80005-2|access-date=2019-10-04|last2=van Beek|first2=Peter|last3=Walsh|first3=Toby|editor2-last=van Beek|editor2-first=Peter|editor3-last=Walsh|editor3-first=Toby}}</ref>. Actually, COP is a CSP solvethat withincludes an ''objective function''. An ''optimal solution'' to abe minimizationoptimized. (maximization) COP is a solution that minimizes (maximizes) the value of the ''objective function''. Many algorithms are used to handle the optimization part.