How to Find the Minimum or Maximum of a Constrained Function
At a glance
- 1. Define the problem
Identify the objective, the feasible set, and whether you need extrema of one function or a minimum of a maximum.
- 2. Check existence
If the feasible set is compact and the objective is continuous, both a minimum and a maximum exist.
- 3. Find candidates
Check interior critical points, boundary points, and corners; use Lagrange multipliers or KKT conditions when appropriate.
- 4. Compare values
Evaluate the objective at every feasible candidate and compare the results.
The phrase “minimum maximum” can mean either finding the minimum and maximum of one function on a constrained domain, or minimizing an objective that is itself the maximum of several functions. The method depends on which problem you have. In either case, you need the function and the constraints to calculate a numerical answer.
First identify the optimization problem
A constrained minimum or maximum of one function has the form
where is the feasible set: the collection of points satisfying all constraints.
A minimax problem instead has an objective such as
Here, at each feasible point , you first take the largest of the values ; then you choose to make that largest value as small as possible. This objective can have corners where the usual derivative test does not apply directly.
When do a minimum and maximum exist?
A useful first check is the extreme value theorem: if is nonempty and compact (in ordinary Euclidean space, closed and bounded) and is continuous on , then attains both a minimum and a maximum on . If the feasible set is not compact, an extremum might not exist. For example, a function can approach a limiting value as grows without ever reaching it.
Existence does not identify the extremizers. To find them, list all possible candidates and compare the function values.
Find constrained extrema of one function
For a differentiable function on a region with an interior, a typical checklist is:
- Find feasible interior points where the gradient is zero: .
- Examine the boundary, including endpoints or corners. The boundary may itself require a constrained optimization problem.
- Evaluate at every candidate and compare the values.
For an equality constraint , Lagrange multipliers can help find candidates. At a regular constrained local extremum, if and are differentiable and , solve
For inequalities, such as , Karush–Kuhn–Tucker (KKT) conditions generalize this approach. They include feasibility, nonnegative multipliers for inequality constraints, complementary slackness, and a stationarity equation. These conditions require suitable regularity assumptions to be necessary, and a candidate they produce need not be a global extremum. You still need to check feasibility and compare objective values (or establish convexity).
Worked example: extrema on a disk
Find the minimum and maximum of subject to . The feasible set is the closed unit disk, so it is compact, and the continuous function has both extrema.
By the Cauchy–Schwarz inequality,
Equality holds at , so the maximum is . Applying the same inequality to gives , with equality at . Thus the minimum is . Both extrema occur on the boundary of the disk, not at its interior critical point , where .
Minimize a maximum using an epigraph variable
For a minimax objective , introduce a new variable and require for every . Then solve
For each fixed , the smallest feasible is exactly . Therefore the reformulation has the same infimum as the original minimax problem, and the same minimum value whenever that minimum is attained. It is especially useful when the functions and constraints are convex, because the reformulated problem is then a convex optimization problem.
Worked example: balance two errors
Minimize for . At , both absolute values equal , so the maximum is . No point can do better: the triangle inequality gives
so the maximum is at least for every . The minimum is therefore , attained at . In epigraph form, minimize subject to , , and .
Common mistakes
- Checking only stationary points: A constrained extremum may lie on the boundary or at a corner.
- Assuming a candidate is global: Lagrange multiplier or KKT equations usually locate candidates; they do not by themselves prove a global optimum.
- Ignoring whether the extremum is attained: On an unbounded or nonclosed feasible set, the infimum or supremum may not be reached.
- Differentiating a maximum as if it were smooth: The active function can change, creating a corner. Use the epigraph formulation or appropriate nonsmooth optimization methods.
- Mixing up min–max and max–min: In general, and are different problems. Equality needs additional assumptions.
References
- Convex Optimization, Stephen Boyd and Lieven Vandenberghe
- Numerical Optimization, Jorge Nocedal and Stephen J. Wright
Spotted an error? Send a correction. Read how we write and check articles in our editorial policy.