Constrained Optimization
Realistic optimization problems often involve some sort of a constraint:
What is the best product we can make, with a fixed budget?
What is the most efficient rocket we can build of a fixed mass?
What is the least expensive building design, given the external factors of material and labor costs?
Abstractly, all of these questions ask the following: what are the extreme values of
15.1Reducing Dimension by Substitution
The first method is to solve the constraint for one of the variables and substitute it into the function you wish to optimize. This forces the inputs to obey the constraint, reducing the number of variables by one.
Example 15.1 (Substitution on a Line). Maximize
The constraint gives
Since
the only critical point is
This also works in higher dimensions: we can take a problem of three variables with one constraint and turn it into a problem of two variables with no constraints.
Example 15.2 (A Box on a Fixed Budget). Find the maximum value of
The nonnegativity conditions matter: they make
so we maximize
over
The interior critical point is
The product is zero along the boundary of the triangle, while at this point it
is
gives the maximum.
Unfortunately, this method relies on being able to solve the constraint for a given variable and substitute it into the objective function. This is often impossible: many relations of two variables cannot be solved for either variable independently.
15.2Lagrange Multipliers
What are we to do if we cannot substitute the constraint? It helps to think geometrically: in a two-variable problem, we can draw the function
It's even more helpful to draw this as a contour plot with level sets. The constraint (our hiker's trajectory) still appears as a curve, but we can easily read off exactly where our hiker is going uphill or downhill by looking at how they are crossing contours.
Whenever the hiker is crossing a contour they are either increasing or decreasing in elevation, and so cannot be at an extremum. Indeed, at a regular constrained extremum, their path must be tangent to a level set! This is the fundamental insight.
A regular constrained extremum can occur only where the constraint is tangent to a level set of the objective.
Everything follows from this: but the work is in turning this qualitative insight into a system of equations. The first observation we can make is that the constraint itself
But this relation of is tangent to is still difficult to deal with. To help, we remember that the gradient vector is perpendicular to level sets! Thus,
Now we've really made some progress! We just need to remember that parallel means are scalar multiples of each other and give this scalar multiple a name: its traditional name is the Greek letter
Theorem 15.3 (Lagrange Multipliers). If
and
This is now a fully precise, quantitative claim: it tells us that we can find candidates for the constrained extrema by solving a system of equations!
Recalling that the gradient is the vector of partial derivatives, this is just the system of equations
There is no single strategy for solving all such systems beyond the substitution and elimination techniques familiar from precalculus. The solutions are candidates, not automatic maxima or minima: evaluate
The condition
It is illustrative to redo the original example from the substitution section using the method of multipliers.
Example 15.4 (The Line Constraint Revisited). Maximize
Let
The Lagrange equations are
Solving gives
the same point found by substitution. The restriction of
Example 15.5 (An Ellipse on a Circle). Maximize
With
together with
The objective has value
Example 15.6 (The Box Revisited). Find the maximum value of
For an interior candidate with
They imply
15.3Inequality Constraints and Boundaries
For an inequality constraint, we break the problem into two cases. On each smooth boundary component, where the constraint is an equality, we use either Lagrange multipliers or substitution. In the interior, we perform standard unconstrained optimization and consider only critical points inside the domain. Corners, endpoints, and singular boundary points must be checked separately.
A continuous function on a closed and bounded feasible region attains an absolute maximum and minimum. To find them:
Find critical points in the interior.
Optimize on each smooth boundary component using substitution or Lagrange multipliers.
Check corners, endpoints, and singular boundary points separately.
Evaluate the objective at every candidate.
Compare the resulting values.
This will result in several sets of potential extrema: those occurring on the inside, those occurring on smooth boundaries, and possibly corners or singular points. How do you find the absolute max or min? That's easy! Just take the largest or smallest overall result.
Example 15.7 (Optimization on a Closed Disk). Find the absolute maximum and minimum of
subject to
In the interior,
only at
This completes our study of differentiation. In Part IV, we reverse the point of view: instead of measuring local change, we accumulate quantities over two- and three-dimensional regions.