Moment based relaxation of polynomials programsYALMIP comes with a built-in module for polynomial programming using moment relaxations. This can be used for finding lower bounds on constrained polynomial programs (inequalities and equalities, element-wise and semidefinite), and to extract the corresponding optimizers. The implementation is entirely based on high-level YALMIP code, and can be somewhat inefficient for large problems (the inefficiency would then show in the setup of the problem, not actually solving the semidefinite resulting program). For very large problems, you might want to check out the dedicated software package Gloptipoly (the solution time will be the same, but the setup time might be reduced). For the underlying theory of moment relaxations, the reader is referred to [Lasserre]. Solving polynomial problems by relaxationsThe following code calculates a lower bound on a concave quadratic optimization problem. As you can see, the only difference compared to solving the problem using a standard solver, such as fmincon or penbmi, is that we call solvemoment instead of solvesdp.
Notice that YALMIP does not recover variables by default, a fact showing up in the
difference between lifted variables and actual nonlinear variables (lifted
variables are the variables used in the semidefinite relaxation to model
nonlinear variables) The lifted variables can be obtained by using the
command
An tighter relaxation can be obtained by using a higher order relaxation (the lowest possible is used if it is not specified).
The obtained bound can be used iteratively to improve the bound by adding dynamically generated cuts.
The known true minima, -4, is found in the fourth order relaxation.
The true global minima is however not recovered with the lifted variables, as we can see if we check the current solution (still violates the nonlinear constraint).
Extracting solutionsTo extract a (or several) globally optimal solution, we need two output arguments. The first output is a diagnostic structure (standard solution structure from the semidefinite solver), the second output is the (hopefully) extracted globally optimal solutions and the third output is a data structure containing all data that was needed to extract the solution.
We can easily check that these are globally optimal solutions since they reach the lower bound -4 and satisfy the constraints (up to numerical precision).
Extracting sum of squares decompositions.Moment based approaches and sum of squares computations are directly linked through duality. Given the solution to the moment problem, a sum of squares decomposition is easily derived from dual variables. Consider a simple unconstrained problem.
A sum of squares decomposition of p can be obtained by using solvesos
The decomposition can alternatively be computed from the moment results. If we minimize the polynomial using moments, solvemoment will automatically extract t, v and Q in the decomposition p(x)-t=vTQv
In the more general constrained case, the polynomial multipliers for the constraints will also be returned. Polynomial semidefinite constraintsNonlinear semidefinite constraints can be added using exactly the same notation and syntax. The following example is taken from [D. Henrion, J. B. Lasserre].
Advanced featuresA number of advanced features are available. We just briefly introduce these here by a quick example where we refine the extracted solution using a couple of Newton steps on an algebraic systems defining the global solutions given the optimal moment matrices, and change the numerical tolerance in the extraction algorithm. Finally, we calculate some different global solutions using the optimal moment matrices. Please check the moment relaxation example in yalmipdemo for details.
The moment relaxation solver can also be called using a more standard
YALMIP notation, by simply defining the solver as
The semidefinite programs rapidly grows when the number of variables and the polynomial degree increase, so be careful when you model your problem. The two most useful practical tips when working semidefinite relaxations seem to be to de-symmetrize your objective function, and compactify your feasible region. These two tricks typically increase the likelihood that you will be able to extract global solutions. By adding a perturbation to the polynomial, symmetry is lost, which generically means that there will not be infinitely many optima, and the extraction algorithm is more likely to work. Most theory in moment relaxations assumes that the feasible set is compact, and this is also affecting practical performance. By adding redundant compactifying constraints, you typically increase the likelihood of success. As an example, a simple redundant constraint which often work well in practice is an upper bound on the objective function based on a known feasible sub-optimal solution. |