Exact Global Optimization
Introduction
Exact global optimization problems can be solved exactly using
Minimize and
Maximize.
This computes the radius of the circle, centered at the origin, circumscribed about the set x^{4}+3 y^{4}≤7.
Out[1]=  

This computes the radius of the circle, centered at the origin, circumscribed about the set a x^{2}+b y^{2}≤1 as a function of the parameters a and b.
Out[2]=  

Algorithms
Depending on the type of problem, several different algorithms can be used.
The most general method is based on the cylindrical algebraic decomposition (CAD) algorithm. It applies when the objective function and the constraints are real algebraic functions. The method can always compute global extrema (or extremal values, if the extrema are not attained). If parameters are present, the extrema can be computed as piecewisealgebraic functions of the parameters. A downside of the method is its high, doubly exponential complexity in the number of variables. In certain special cases not involving parameters, faster methods can be used.
When the objective function and all constraints are linear with rational number coefficients, global extrema can be computed exactly using the simplex algorithm.
For univariate problems, equation and inequality solving methods are used to find the constraint solution set and discontinuity points and zeros of the derivative of the objective function within the set.
Another approach to finding global extrema is to find all the local extrema, using the Lagrange multipliers or the KarushKuhnTucker (KKT) conditions, and pick the smallest (or the greatest). However, for a fully automatic method, there are additional complications. In addition to solving the necessary conditions for local extrema, it needs to check smoothness of the objective function and smoothness and nondegeneracy of the constraints. It also needs to check for extrema at the boundary of the set defined by the constraints and at infinity, if the set is unbounded. This in general requires exact solving of systems of equations and inequalities over the reals, which may lead to CAD computations that are harder than in the optimization by CAD algorithm. Currently
Mathematica uses Lagrange multipliers only for equational constraints within a bounded box. The method also requires that the number of stationary points and the number of singular points of the constraints be finite. An advantage of this method over the CADbased algorithm is that it can solve some transcendental problems, as long as they lead to systems of equations that
Mathematica can solve.
Optimization by Cylindrical Algebraic Decomposition
Examples
This finds the point on the cubic curve which is closest to the origin.
Out[3]=  

This finds the point on the cubic curve x^{3}x+y^{2}a which is closest to the origin, as a function of the parameter a.
Out[4]=  

This visualization shows the point on the cubic curve x^{3}x+y^{2}a which is closest to the origin, and the distance m of the point from the origin. The value of parameter a can be modified using the slider. The visualization uses the minimum computed by Minimize.
Out[13]=  

Customized CAD Algorithm for Optimization
The cylindrical algebraic decomposition (CAD) algorithm is available in
Mathematica directly as
CylindricalDecomposition. The algorithm is described in more detail in
"Real Polynomial Systems". The following describes how to customize the CAD algorithm to solve the global optimization problem.
Reduction to Minimizing a Coordinate Function
Suppose it is required to minimize an algebraic function
f (x, t) over the solution sets of algebraic constraints
(x, t), where
x is a vector of variables and
t is a vector of parameters. Let
y be a new variable. The minimization of
f over the constraints
is equivalent to the minimization of the coordinate function
y over the semialgebraic set given by
yf (x, t) (x, t).
If
f happens to be a monotonic function of one variable
x_{1}, a new variable is not needed, as
x_{1} can be minimized instead.
The Projection Phase of CAD
The variables are projected, with
x first, then the new variable
y, and then the parameters
t.
If algebraic functions are present, they are replaced with new variables; equations and inequalities satisfied by the new variables are added. The variables replacing algebraic functions are projected first. They also require special handling in the lifting phase of the algorithm.
Projection operator improvements by Hong, McCallum, and Brown can be used here, including the use of equational constraints. Note that if a new variable needs to be introduced, there is at least one equational constraint, namely
y=f.
The Lifting Phase of CAD
The parameters
t are lifted first, constructing the algebraic function equation and inequality description of the cells. If there are constraints that depend only on parameters and you can determine that
is identically false over a parameter cell, you do not need to lift this cell further.
When lifting the minimization variable
y, you start with the smallest values of
y, and proceed (lifting the remaining variables in the depthfirst manner) until you find the first cell for which the constraints are satisfied. If this cell corresponds to a root of a projection polynomial in
y, the root is the minimum value of
f, and the coordinates corresponding to
x of any point in the cell give a point at which the minimum is attained. If parameters are present, you get a parametric description of a point in the cell in terms of roots of polynomials bounding the cell. If there are no parameters, you can simply give the sample point used by the CAD algorithm. If the first cell satisfying the constraints corresponds to an interval
(r, s), where
r is a root of a projection polynomial in
y, then
r is the infimum of values of
f, and the infimum value is not attained. Finally, if the first cell satisfying the constraints corresponds to an interval
(, s),
f is unbounded from below.
Strict Inequality Constraints
If there are no parameters, all constraints are strict inequalities, and you only need the extremum value, then a significantly simpler version of the algorithm can be used. (You can safely make inequality constraints strict if you know that
, where
C is the solution set of the constraints.) In this case many lowerdimensional cells can be disregarded; hence, the projection may only consist of the leading coefficients, the resultants, and the discriminants. In the lifting phase, only fulldimensional cells need be constructed; hence, there is no need for algebraic number computations.
Experimental`Infimum[{f,cons},{x,y,...}] 
 find the infimum of values of f on the set of points satisfying the constraints cons. 
Experimental`Supremum[{f,cons},{x,y,...}] 
 find the supremum of values of f on the set of points satisfying the constraints cons. 
Finding extremum values.
This finds the smallest ball centered at the origin which contains the set bounded by the surface x^{4}y z x+2 y^{4}+3 z^{4}1. A full Maximize call with the same input did not finish in 10 minutes.
Out[14]=  

Linear Optimization
When the objective function and all constraints are linear, global extrema can be computed exactly using the simplex algorithm.
This solves a random linear minimization problem with ten variables.
Out[22]=  

Optimization problems where the objective is a fraction of linear functions and the constraints are linear (linear fractional programs) reduce to linear optimization problems. This solves a random linear fractional minimization problem with ten variables.
Out[31]=  

Univariate Optimization
For univariate problems, equation and inequality solving methods are used to find the constraint solution set and discontinuity points and zeros of the derivative of the objective function within the set.
This solves a univariate optimization problem with a transcendental objective function.
Out[32]=  

Here is a visualization of the minimum found.
Out[33]=  

Here Mathematica recognizes that the objective functions and the constraints are periodic.
Out[34]=  

Optimization by Finding Stationary and Singular Points
Here is an example where the minimum is attained at a singular point of the constraints.
Out[35]=  
Out[36]=  

The maximum of the same objective function is attained on the boundary of the set defined by the constraints.
Out[37]=  
Out[38]=  

There are no stationary points in this example.
Out[39]=  

Here is a set of 3dimensional examples with the same constraints. Depending on the objective function, the maximum is attained at a stationary point of the objective function on the solution set of the constraints, at a stationary point of the restriction of the objective function to the boundary of the solution set of the constraints, and at the boundary of the boundary of the solution set of the constraints.
Here the maximum is attained at a stationary point of the objective function on the solution set of the constraints.
Out[40]=  
Out[41]=  

Here the maximum is attained at a stationary point of the restriction of the objective function to the boundary of the solution set of the constraints.
Out[42]=  
Out[43]=  

Here the maximum is attained at the boundary of the boundary of the solution set of the constraints.
Out[44]=  
Out[45]=  

The Lagrange multiplier method works for some optimization problems involving transcendental functions.
Out[46]=  
Out[47]=  

Optimization over the Integers
Integer Linear Programming
An integer linear programming problem is an optimization problem in which the objective function is linear, the constraints are linear and bounded, and the variables range over the integers.
To solve an integer linear programming problem
Mathematica first solves the equational constraints, reducing the problem to one containing inequality constraints only. Then it uses lattice reduction techniques to put the inequality system in a simpler form. Finally, it solves the simplified optimization problem using a branchandbound method.
This solves a randomly generated integer linear programming problem with 7 variables.
Out[58]=  

Optimization over the Reals Combined with Integer Solution Finding
Suppose a function
f[x] needs to be minimized over the integer solution set of constraints
(x). Let
m be the minimum of
f over the real solution set of
(x). If there exists an integer point satisfying
f (x)m (x), then
m is the minimum of
f over the integer solution set of
. Otherwise you try to find an integer solution of
f (x)m+1 (x), and so on. This heuristic works if you can solve the real optimization problem and all the integer solution finding problems, and you can find an integer solution within a predefined number of attempts. (By default
Mathematica tries 10 candidate optimum values. This can be changed using the
IntegerOptimumCandidates system option.)
This finds a point with integer coordinates maximizing x+y among the points lying below the cubic x^{3}+y^{3}1000.
Out[59]=  
Out[60]=  
