NAG FL Interface
e04ptf (handle_solve_socp_ipm)
Note: this routine uses optional parameters to define choices in the problem specification and in the details of the algorithm. If you wish to use default
settings for all of the optional parameters, you need only read Sections 1 to 10 of this document. If, however, you wish to reset some or all of the settings please refer to Section 11 for a detailed description of the algorithm and to Section 12 for a detailed description of the specification of the optional parameters.
1
Purpose
e04ptf is a solver from the NAG optimization modelling suite for large-scale second-order cone programming (SOCP) problems. It is based on an interior point method (IPM).
2
Specification
Fortran Interface
Subroutine e04ptf ( |
handle, nvar, x, nnzu, u, nnzuc, uc, rinfo, stats, monit, iuser, ruser, cpuser, ifail) |
Integer, Intent (In) |
:: |
nvar, nnzu, nnzuc |
Integer, Intent (Inout) |
:: |
iuser(*), ifail |
Real (Kind=nag_wp), Intent (Inout) |
:: |
x(nvar), u(nnzu), uc(nnzuc), ruser(*) |
Real (Kind=nag_wp), Intent (Out) |
:: |
rinfo(100), stats(100) |
Type (c_ptr), Intent (In) |
:: |
handle, cpuser |
External |
:: |
monit |
|
C Header Interface
#include <nag.h>
void |
e04ptf_ (void **handle, const Integer *nvar, double x[], const Integer *nnzu, double u[], const Integer *nnzuc, double uc[], double rinfo[], double stats[], void (NAG_CALL *monit)(void **handle, const double rinfo[], const double stats[], Integer iuser[], double ruser[], void **cpuser, Integer *inform), Integer iuser[], double ruser[], void **cpuser, Integer *ifail) |
|
C++ Header Interface
#include <nag.h> extern "C" {
void |
e04ptf_ (void *&handle, const Integer &nvar, double x[], const Integer &nnzu, double u[], const Integer &nnzuc, double uc[], double rinfo[], double stats[], void (NAG_CALL *monit)(void *&handle, const double rinfo[], const double stats[], Integer iuser[], double ruser[], void *&cpuser, Integer &inform), Integer iuser[], double ruser[], void *&cpuser, Integer &ifail) |
}
|
The routine may be called by the names e04ptf or nagf_opt_handle_solve_socp_ipm.
3
Description
e04ptf solves a large-scale SOCP optimization problem in the following form
where
is a Cartesian product of
quadratic (second-order type) cones and
-dimensional real space, and
is the number of decision variables. Here
,
,
and
are
-dimensional vectors,
is an
by
sparse matrix, and
and
are
-dimensional vectors. Note that
partitions subsets of variables into quadratic cones and each
can be either a quadratic cone or a rotated quadratic cone. These are defined as follows:
-
•Quadratic cone:
-
•Rotated quadratic cone:
e04ptf solves SOCP problems stored as a handle. The handle points to an internal data structure which defines the problem and serves as a means of communication for routines in the NAG optimization modelling suite. First, the problem handle is initialized by calling
e04raf. Then some of the routines
e04rbf,
e04ref,
e04rff,
e04rhf or
e04rjf may be called to formulate the quadratic cones, linear objective function, bounds of the variables, and the block of linear constraints, respectively. Alternatively, the whole model can be loaded from a file by
e04saf. When the handle is no longer needed,
e04rzf should be called to destroy it and deallocate the memory held within. See
Section 3.1 in the
E04 Chapter Introduction for more details about the NAG optimization modelling suite.
The solver method can be modified by various optional parameters (see
Section 12) which can be set by
e04zmf and
e04zpf anytime between the initialization of the handle and a call to the solver. Once the solver has finished, options may be modified for the next solve. The solver may be called repeatedly with various optional parameters.
The optional parameter
Task may be used to switch the problem to maximization or to ignore the objective function and find only a feasible point.
Several options may have significant impact on the performance of the solver. Even if the defaults were chosen to suit the majority of problems, it is recommended that you experiment in order to find the most suitable set of options for a particular problem, see
Sections 11 and
12 for further details.
3.1
Structure of the Lagrangian Multipliers
The algorithm works internally with estimates of both the decision variables, denoted by , and the Lagrangian multipliers (dual variables), denoted by for bound and linear constraints, and for quadratic cone constraints.
If the simple bounds have been defined (
e04rhf was successfully called), the first
elements of
belong to the corresponding Lagrangian multipliers, interleaving a multiplier for the lower and the upper bound for each
. If any of the bounds were set to infinity, the corresponding Lagrangian multipliers are set to
and may be ignored.
Similarly, the following
elements of
belong to multipliers for the linear constraints (if
e04rjf has been successfully called). The organization is the same, i.e., the multipliers for each constraint for the lower and upper bounds are alternated and zeros are used for any missing (infinite bound) constraints.
Some solvers merge multipliers for both lower and upper inequality into one element whose sign determines the inequality. Negative multipliers are associated with the upper bounds and positive with the lower bounds. An equivalent result can be achieved with this storage scheme by subtracting the upper bound multiplier from the lower one. This is also consistent with equality constraints.
Finally, the elements of
are the corresponding Lagrangian multipliers for the variables in the quadratic cone constraints that have been defined by
e04rbf. All multipliers are stored next to each other in array
uc in the same order as the cone constraints were defined by
e04rbf. For example, if the first cone constraint contains variables
,
,
and the second cone constraint contains variables
,
,
,
, then the dimension of array
uc must be
and the first
elements are the corresponding Lagrangian multipliers for the cone composed of
,
,
, followed by
elements that are the corresponding Lagrangian multipliers for the cone of
,
,
,
.
4
References
Alizadeh F and Goldfarb D (2003) Second-order cone programming Mathematical programming 95(1) 3–51
Andersen E D, Roos C and Terlaky T (2003) On implementing a primal-dual interior-point method for conic quadratic optimization Mathematical programming 95(2) 249–277
Goldfarb D and Scheinberg K (2005) Product-form Cholesky factorization in interior point methods for second-order cone programming Mathematical programming 103(1) 153–179
Goldman A J and Tucker A W (1956) Theory of linear programming Linear inequalities and related systems 38 53–97
Hogg J D and Scott J A (2011) HSL MA97: a bit-compatible multifrontal code for sparse symmetric systems RAL Technical Report. RAL-TR-2011-024
HSL (2011) A collection of Fortran codes for large-scale scientific computation
http://www.hsl.rl.ac.uk/
Karypis G and Kumar V (1998) A fast and high quality multilevel scheme for partitioning irregular graphs SIAM J. Sci. Comput. 20(1) 359–392
Lobo M S, Vandenberghe L, Boyd S and Levret H (1998) Applications of second-order cone programming Linear Algebra and its Applications 284(1-3) 193–228
Lustig I J, Marsten R E and Shanno D F (1992) On implementing Mehrotra's predictor–corrector interior-point method for linear programming SIAM J. Optim. 2(3) 435–449
Mehrotra S (1992) On the implementation of a primal-dual interior point method SIAM J. Optim. 2 575–601
Nesterov Y E and Todd M J (1997) Self-scaled barriers and interior-point methods for convex programming Mathematics of Operations research 22(1) 1–42
Nesterov Y E and Todd M J (1998) Primal-dual interior-point methods for self-scaled cones SIAM J. Optim. 8(2) 324–364
Nocedal J and Wright S J (2006) Numerical Optimization (2nd Edition) Springer Series in Operations Research, Springer, New York
Sturm J F (2002) Implementation of Interior Point Methods for Mixed Semidefinite and Second Order Cone Optimization Problems Optimization Methods and Software 17(6) 151–171
Xu X, Hung P-F and Ye Y (1996) A simplified homogeneous and self-dual linear programming algorithm and its implementation Annals of Operations Research 62(1) 151–171
5
Arguments
-
1:
– Type (c_ptr)
Input
-
On entry: the handle to the problem. It needs to be initialized by
e04raf and the problem formulated by some of the routines
e04rbf,
e04ref,
e04rff,
e04rhf and
e04rjf. It
must not be changed between calls to the NAG optimization modelling suite.
-
2:
– Integer
Input
-
On entry: , the number of variables in the problem.
-
3:
– Real (Kind=nag_wp) array
Input/Output
-
On entry: the input of
x is reserved for future releases of the NAG Library and it is ignored at the moment.
On exit: the final values of the variables .
-
4:
– Integer
Input
-
On entry: the dimension of array
u.
If
,
u will not be referenced; otherwise it needs to match the dimension of constraints defined by
e04rhf and
e04rjf as explained in
Section 3.1.
Constraint:
.
-
5:
– Real (Kind=nag_wp) array
Input/Output
-
Note: if
,
u holds Lagrange multipliers (dual variables) for the bound constraints and linear constraints. If
,
u will not be referenced.
On entry: the input of
u is reserved for future releases of the NAG Library and it is ignored at the moment.
On exit: the final values of the variables .
-
6:
– Integer
Input
-
On entry: the dimension of array
uc.
If
,
uc will not be referenced; otherwise it needs to match the total number of cone variables defined by
e04rbf as explained in
Section 3.1.
Constraint:
.
-
7:
– Real (Kind=nag_wp) array
Input/Output
-
Note: if
,
uc holds Lagrange multipliers (dual variables) for second-order cones as defined by
e04rbf. If
,
uc will not be referenced.
On entry: the input of
uc is reserved for future releases of the NAG Library and it is ignored at the moment.
On exit: the final values of the variables .
-
8:
– Real (Kind=nag_wp) array
Output
-
On exit: error measures and various indicators of the algorithm (see
Section 11 for details) as given in the table below:
|
Value of the primal objective. |
|
Value of the dual objective. |
|
Flag indicating the system formulation used by the solver, : augmented system, : normal equation. |
|
Factorization type, : Cholesky, : Bunch–Parlett. |
– |
Not referenced in this solver. |
|
Relative primal infeasibility, see Section 11.5.1. |
|
Relative duality gap, see Section 11.5.1. |
|
Relative dual infeasibility, see Section 11.5.1. |
|
Accuracy, see Section 11.5.1. |
|
, see (23). |
|
, see (23). |
|
Step length. |
– |
Reserved for future use. |
-
9:
– Real (Kind=nag_wp) array
Output
-
On exit: solver statistics as given in the table below. Note that times are measured in seconds, see optional parameter
Stats Time.
|
Number of iterations. |
|
Not referenced. |
|
Total number of iterative refinements performed. |
|
Value of the perturbation added to the diagonal in the normal equation formulation or the augmented system formulation. |
|
Total number of factorizations performed. |
|
Total time spent in the solver. |
|
Time spent in the presolve phase. |
|
Time spent in the last iteration. |
|
Total time spent factorizing the system matrix. |
|
Total time spent backsolving the system matrix. |
|
Not referenced. |
|
Time spent in the initialization phase. |
|
Number of nonzeros in the system matrix. |
|
Number of nonzeros in the system matrix factor. |
|
Maximum error of the backsolve. |
|
Number of columns in considered dense by the solver. |
|
Number of conic constraints considered dense by the solver. |
– |
Reserved for future use. |
-
10:
– Subroutine, supplied by the NAG Library or the user.
External Procedure
-
monit is provided to enable you to monitor the progress of the optimization and optionally to terminate the solver early if necessary, using argument
inform. It is invoked at the end of every
th iteration where
is given by the optional parameter
SOCP Monitor Frequency (the default is
,
monit is not called).
monit
may be the dummy subroutine
e04ptu (
e04ptu is included in the NAG Library).
The specification of
monit is:
Fortran Interface
Integer, Intent (Inout) |
:: |
iuser(*), inform |
Real (Kind=nag_wp), Intent (In) |
:: |
rinfo(100), stats(100) |
Real (Kind=nag_wp), Intent (Inout) |
:: |
ruser(*) |
Type (c_ptr), Intent (In) |
:: |
handle, cpuser |
|
C++ Header Interface
#include <nag.h> extern "C" {
}
|
-
1:
– Type (c_ptr)
Input
-
On entry: the handle to the problem as provided on entry to
e04ptf. It may be used to query the model during the solve, and extract the current approximation of the solution by
e04rxf.
-
2:
– Real (Kind=nag_wp) array
Input
-
On entry: error measures and various indicators at the end of the current iteration as described in
rinfo.
-
3:
– Real (Kind=nag_wp) array
Input
-
On entry: solver statistics at the end of the current iteration as described in
stats, however, elements
,
,
,
and
refer to the quantities in the last iteration rather than accumulated over all iterations through the whole algorithm run.
-
4:
– Integer array
User Workspace
-
5:
– Real (Kind=nag_wp) array
User Workspace
-
6:
– Type (c_ptr)
User Workspace
-
monit is called with the arguments
iuser,
ruser and
cpuser as supplied to
e04ptf. You should use the arrays
iuser and
ruser, and the data handle
cpuser to supply information to
monit.
-
7:
– Integer
Input/Output
-
On entry: a non-negative value.
On exit: must be set to a value describing the action to be taken by the solver on return from
monit. Specifically, if the value is negative the solution of the current problem will terminate immediately with
; otherwise, computations will continue.
monit must either be a module subprogram USEd by, or declared as EXTERNAL in, the (sub)program from which
e04ptf is called. Arguments denoted as
Input must
not be changed by this procedure.
-
11:
– Integer array
User Workspace
-
12:
– Real (Kind=nag_wp) array
User Workspace
-
13:
– Type (c_ptr)
User Workspace
-
iuser,
ruser and
cpuser are not used by
e04ptf, but are passed directly to
monit and may be used to pass information to this routine. If you do not need to reference
cpuser, it should be initialized to
c_null_ptr.
-
14:
– Integer
Input/Output
-
On entry:
ifail must be set to
,
. If you are unfamiliar with this argument you should refer to
Section 4 in the Introduction to the NAG Library FL Interface for details.
For environments where it might be inappropriate to halt program execution when an error is detected, the value
is recommended. If the output of error messages is undesirable, then the value
is recommended. Otherwise, because for this routine the values of the output arguments may be useful even if
on exit, the recommended value is
.
When the value is used it is essential to test the value of ifail on exit.
On exit:
unless the routine detects an error or a warning has been flagged (see
Section 6).
6
Error Indicators and Warnings
If on entry
or
, explanatory error messages are output on the current error message unit (as defined by
x04aaf).
Errors or warnings detected by the routine:
Note: in some cases e04ptf may return useful information.
-
The supplied
handle does not define a valid handle to the data structure for the NAG optimization modelling suite. It has not been initialized by
e04raf or it has been corrupted.
-
The problem is already being solved.
This solver does not support the model defined in the handle.
-
On entry,
, expected
.
Constraint:
nvar must match the value given during initialization of
handle.
-
On entry,
.
nnzu does not match the size of the Lagrangian multipliers for constraints.
The correct value is
for no constraints.
On entry,
.
nnzu does not match the size of the Lagrangian multipliers for constraints.
The correct value is either
or
.
On entry,
.
nnzuc does not match the size of the Lagrangian multipliers for second-order cone constraints.
when there are no second-order cone constraints.
On entry,
.
nnzuc does not match the size of the Lagrangian multipliers for second-order cone constraints.
The correct value is either
or
.
-
User requested termination during a monitoring step.
-
Maximum number of iterations exceeded.
-
The solver terminated after the maximum time allowed was exceeded.
Maximum number of seconds exceeded. Use optional parameter
Time Limit to reset the limit.
-
No progress, stopping early.
The solver predicted that it is unable to make further progress and stopped prematurely. This might be due to the scaling of the problem, its conditioning or numerical difficulties.
-
Suboptimal solution.
The solver predicted that it is unable to reach a better estimate of the solution. However, the error measures indicate that the point is a reasonable approximation.
-
The problem was found to be primal infeasible.
-
The problem was found to be dual infeasible.
This error indicates that the primal problem is unbounded or infeasible.
An unexpected error has been triggered by this routine. Please
contact
NAG.
See
Section 7 in the Introduction to the NAG Library FL Interface for further information.
Your licence key may have expired or may not have been installed correctly.
See
Section 8 in the Introduction to the NAG Library FL Interface for further information.
Dynamic memory allocation failed.
See
Section 9 in the Introduction to the NAG Library FL Interface for further information.
7
Accuracy
The accuracy of the solution is determined by optional parameters
SOCP Stop Tolerance and
SOCP Stop Tolerance 2If
on the final exit, the returned point satisfies Karush–Kuhn–Tucker (KKT) conditions to the requested accuracy (under the default settings close to
) and thus it is a good estimate of the solution. If
, some of the convergence conditions were not fully satisfied but the point is a reasonable estimate and still usable. Please refer to
Section 11.5 and the description of the particular options.
8
Parallelism and Performance
e04ptf is threaded by NAG for parallel execution in multithreaded implementations of the NAG Library.
e04ptf makes calls to BLAS and/or LAPACK routines, which may be threaded within the vendor library used by this implementation. Consult the documentation for the vendor library for further information.
Please consult the
X06 Chapter Introduction for information on how to control and interrogate the OpenMP environment used within this routine. Please also consult the
Users' Note for your implementation for any additional implementation-specific information.
This SOCP solver can solve several common convex problems covering a large variety of applications. However, in this release, the cone constraints need to be specified explicitly which means that in certain cases a reformulation is needed. In this section, we cover QCQP, norm minimization problems and robust linear programming, see
Alizadeh and Goldfarb (2003) and
Lobo et al. (1998) for further details.
9.1.1
Quadratically Constrained Quadratic Programming
Convex quadratically constrained quadratic programming (QCQP) appears in applications such as modern portfolio theory and wireless sensor network localization. The general convex QCQP problem has the following form
where
,
for
, are symmetric and positive semidefinite matrices, hence there exist matrices
such that
In many practical problems this decomposition is already available. Otherwise it needs to be computed, for example, via Cholesky or eigenvalue decomposition, such as
f07fdf for positive definite matrices, and
f07kdf or
f08fcf for positive semidefinite matrices. Let's introduce new artificial variables
such that
, then we have an equivalent characterization of cone constraints as
By the definition of rotated quadratic cone
(3) we have
Therefore, model
(4) can be transformed equivalently to the following SOCP problem
See
Section 10 for an example of how to formulate and solve a QCQP problem.
9.1.2
Norm Minimization Problems
Consider the following problem that minimizes the sum of Euclidean norms
where
and
. Problem
(6) can be formulated as SOCP by introducing
auxiliary variables
, for
, and adding constraints
Then the resulting SOCP is
Observe that if
(6) had non-negative weights in the sum, the problem would still be an SOCP.
Similarly, minimizing the maximum of Euclidean norms can be expressed as SOCPs. By introducing one auxiliary variable
, the problem
is equivalent to
Hence, problem
(8) can be cast as the following SOCP
As an interesting special case, an
-norm minimization problem can also be solved by SOCP. Consider the following unconstrained problem
where
and
, introduce an auxiliary variable
such that
, then problem
(11) is transformed to
By adding an auxiliary variable
, the above problem is equivalent to
Note that the inequality
is equivalent to
, therefore the final SOCP is
9.1.3
Robust Linear Programming
Consider a linear programming problem
where
and
are given but there is some uncertainty in parameter
. In such a situation you might want to solve problem
(15) in the worst-case sense, i.e., find the best solution
with respect to the most adverse choice of
. Introducing uncertainty set to some or all your data and solving the problem in the worst-case scenario helps to avoid high sensitivity of your results even for a small perturbation in the input data. Assume
are known to lie in given ellipsoids around its known centre
where
are positive semidefinite matrices, this problem is also known as robust linear programming which can be modelled as
Constraints
are equivalent to
Using the definition of the dual norm of the Euclidean norm we can write down the equivalent for problem
(16) as
By adding auxiliary variables
,
that
, we have the final equivalent SOCP as
Note we can also get SOCP formulation if there is some uncertainty or variation in the parameters and following a similar procedure.
The solver can print information to give an overview of the problem and of the progress of the computation. The output may be sent to two independent streams (files) which are set by optional parameters
Print File and
Monitoring File. Optional parameters
Print Level,
Monitoring Level,
Print Solution and
Print Options determine the exposed level of detail. This allows, for example, a detailed log file to be generated while the condensed information is displayed on the screen.
By default (
,
), six sections are printed to the standard output:
- Header
- Optional parameters list (if )
- Problem statistics
- Iteration log
- Summary
- Solution (if )
Header
The header is a message indicating the start of the solver. It should look like:
------------------------------------------------
E04PT, Interior point method for SOCP problems
------------------------------------------------
Optional parameters list
The list shows all options of the solver, each displayed on one line. The output contains the option name, its current value and an indicator for how it was set. The options unchanged from the default setting are noted by ‘d’, options you set are noted by ‘U’, and options reset by the solver are noted by ‘S’. Note that the output format is compatible with the file format expected by
e04zpf. The output might look as follows:
Stats Time = Yes * U
Task = Minimize * d
Socp Iteration Limit = 100 * d
Socp Presolve = Yes * d
Problem statistics
If
, statistics on the original and the presolved problems are printed. More detailed statistics, as well as a list of the presolve operations, are also printed for
Print Level or above, for example:
Original Problem Statistics
Number of variables 2111
Number of linear constraints 2110
Number of nonzeros 3428
Number of cones 20
Presolved Problem Statistics
Number of variables 1268
Number of linear constraints 1199
Number of nonzeros 1676
Number of cones 20
Iteration log
If , the solver prints the status of each iteration.
If
, the output shows the iteration number (
represents the starting point), the current primal and dual objective value, convergence measures (primal infeasibility, dual infeasibility and duality gap defined in
Section 11.5.1) and the value of the additional variable
(see
Section 11.1). The output might look as follows:
------------------------------------------------------------------------
it| pobj | dobj | p.inf | d.inf | d.gap | tau | I
------------------------------------------------------------------------
0 2.34871E+00 0.00000E+00 8.89E-01 1.09E-01 1.80E-01 1.0E+00
1 5.95233E+00 7.97442E+00 1.49E-01 1.83E-02 3.00E-02 1.9E-01
2 1.71247E+01 1.59748E+01 1.10E-01 1.35E-02 2.22E-02 3.0E-01
3 2.55291E+01 2.53467E+01 1.61E-02 1.98E-03 3.25E-03 2.9E-01
If
, the solver also prints for each iteration
(defined in
Section 11.5.1), the value of the variable
(see
Section 11.1), the step size, the maximum error of the backsolves performed as well as the total number of iterative refinements performed. The output takes the following form:
----------------------------------------------------------------------------------------------------------------------
it| pobj | dobj | p.inf | d.inf | d.gap | rhoa | tau | kappa | step | errbs | nrefi | I
----------------------------------------------------------------------------------------------------------------------
0 2.34871E+00 0.00000E+00 8.89E-01 1.09E-01 1.80E-01 2.3E+00
1 5.95233E+00 7.97442E+00 1.49E-01 1.83E-02 3.00E-02 2.3E-01 1.9E-01 9.5E-01 8.44E-01 1.07E-14 9
2 1.71247E+01 1.59748E+01 1.10E-01 1.35E-02 2.22E-02 6.8E-02 3.0E-01 6.5E-02 4.30E-01 9.24E-15 9
3 2.55291E+01 2.53467E+01 1.61E-02 1.98E-03 3.25E-03 6.9E-03 2.9E-01 7.9E-03 8.67E-01 3.04E-14 7
Occasionally, when numerical instabilities are too big, the solver will restart the iteration and switch to an augmented system formulation. In such cases the letters RS will be printed in the information column (I).
If
, each iteration produces more information that expands over several lines. This additional information contains:
- the method used (normal equation, augmented system);
- the number of factorizations performed at the current iteration;
- the type of factorization performed (Cholesky, Bunch–Parlett);
- the value of the perturbation added to the diagonal in the normal equation formulation or on the zero block in the augmented system formulation;
- the total time spent in the iteration if Stats Time is not set to .
The output might look as follows:
------------ Details of Iteration 1 ------------
method Augmented System
iterative refinements 9
factorizations 1
matrix type Bunch-Parlett
diagonal perturbation 7.00E-08
time iteration 0.05 sec
--------------------------------------------------
Summary
Once the solver finishes, a detailed summary is produced:
-------------------------------------------------
Status: converged, an optimal solution found
-------------------------------------------------
Final primal objective value 2.688878E+01
Final dual objective value 2.688878E+01
Absolute primal infeasibility 2.264154E-07
Relative primal infeasibility 6.788104E-09
Absolute dual infeasibility 7.639479E-09
Relative dual infeasibility 1.371539E-09
Absolute complementarity gap 2.558237E-08
Relative complementarity gap 8.342957E-10
Iterations 8
It starts with the status line of the overall result which matches the
ifail value and is followed by the final primal and dual objective values as well as the error measures and iteration count.
Optionally, if
, the timings of the different parts of the algorithm are displayed. It might look as follows:
Timing
Total time 0.16 sec
Presolver 0.00 sec ( 1.3%)
Core 0.15 sec ( 98.7%)
Initialization 0.00 sec ( 1.4%)
Factorization 0.13 sec ( 88.2%)
Compute directions 0.02 sec ( 10.4%)
Iterative refinement 0.01 sec ( 9.7%)
Solution
If
, the values of the primal variables and their bounds on the primary and secondary outputs. It might look as follows:
Primal variables:
x_idx Lower bound Value Upper bound
1 0.00000E+00 1.02411E-08 inf
2 0.00000E+00 1.43619E-08 inf
3 4.00000E+00 1.00000E+01 1.00000E+01
4 0.00000E+00 2.05523E+00 4.00000E+00
5 -1.00000E+01 -6.28719E+00 1.00000E+01
6 -8.00000E+00 -7.49982E+00 8.00000E+00
7 1.00000E+00 2.08866E+00 3.00000E+00
8 5.00000E-01 2.52602E+00 5.00000E+00
If
or
, the values of the dual variables are also printed. It should look as follows:
Box bounds dual variables:
x_idx Lower bound Value Upper bound Value
1 0.00000E+00 1.03294E+01 inf 0.00000E+00
2 0.00000E+00 4.77419E+00 inf 0.00000E+00
3 4.00000E+00 0.00000E+00 1.00000E+01 4.00326E+00
4 0.00000E+00 0.00000E+00 4.00000E+00 1.88512E-08
5 -1.00000E+01 9.77434E-09 1.00000E+01 0.00000E+00
6 -8.00000E+00 1.18996E-07 8.00000E+00 0.00000E+00
7 1.00000E+00 0.00000E+00 3.00000E+00 2.13077E-08
8 5.00000E-01 2.00243E-09 5.00000E+00 0.00000E+00
Linear constraints dual variables:
idx Lower bound Value Upper bound Value
1 7.00000E+00 0.00000E+00 9.00000E+00 1.73118E+00
2 -1.00000E+01 0.00000E+00 -8.00000E+00 1.20039E+00
3 -1.50000E+01 0.00000E+00 -1.10000E+01 4.30107E-02
Cone constraints dual variables:
idgroup x_idx Value
1 6 2.02570E+00
5 -2.02453E-01
4 -2.50000E-01
7 1.99999E+00
2 8 7.11750E+00
2 -7.11749E+00
10
Example
As described in
Section 9.1, second-order cone programming has many applications, however, a reformulation might be needed. This example demonstrates how to formulate and solve a quadratically constrained quadratic programming problem via SOCP. See also
Section 10 in
e04rbf for a simpler example where the cone constraints are explicitly defined, and
Section 10 in
e04saf where the input is read from a file.
This example solves a quadratically constrained quadratic programming problem
where
and
. We factorize
and
using an eigenvalue decomposition, then we have the following second-order cone programming problem
as in
Section 9.1.1. By adding artificial variables
,
,
, and
to the above formulation, we have the following standard SOCP problem
10.1
Program Text
10.2
Program Data
10.3
Program Results
11
Algorithmic Details
This section contains the description of the underlying algorithms used in
e04ptf, which implements the standard primal-dual path-following interior point method with Nesterov–Todd scaling and self-dual embedding. For further details, see
Nesterov and Todd (1998),
Nesterov and Todd (1997) and
Andersen et al. (2003).
For simplicity, we consider the following primal second-order cone programming formulation
where
,
,
,
with full row rank, and
. The dual formulation for problem
(19) is given by
where
and
denote the dual variables and
is as defined above (it is a self-dual cone). Solutions of the primal
(19) and dual
(20) problem are connected by the strong duality theory (see, for example,
Nocedal and Wright (2006)) and are characterized by the first-order optimality conditions, the so-called Karush–Kuhn–Tucker (KKT) conditions, which are stated as follows:
where
is the multiplication operator defined in a special case of a so-called Euclidean Jordan algebra
with the following definition
If
(19) and
(20) have a strictly feasible solution (i.e., there is a feasible solution
such that
and
), then they both have optimal solutions and the duality gap is zero. Moreover, a feasible solution pair
is optimal if, and only if, the KKT conditions
(21) hold at this point, see
Alizadeh and Goldfarb (2003) for more details.
The underlying algorithm applies an iterative method to find an optimal solution
of the system
(21) employing variants of Newton's method and modifying the search direction and step length so that the cone constraints are preserved at every iteration.
11.1
Homogeneous Self-Dual Algorithm
The homogeneous and self-dual (HSD) model was first studied by
Goldman and Tucker (1956) for linear programming and simplified by
Xu et al. (1996). Then a generalization of HSD was employed to solve SOCP problems by
Andersen et al. (2003) and
Sturm (2002). As its name suggests, the HSD model and its dual are equivalent. Self-dual formulations embed the original problem
(19) in a larger conic optimization problem such that the latter is primal and dual feasible, with known feasible points, and from which solution we can extract optimal solutions or certificates of infeasibility of the original problem.
We define the homogeneous and self-dual model for problem
(19) as follows:
Here
and
are two additional variables and we use the notation that
The model
(23) can be viewed as a self-dual optimization problem with a zero objective function. If
is any feasible solution to
(23), then if
, a primal-dual optimal solution to
(19) and
(20) is given by
and the duality gap is given by
. The homogeneous algorithm is an application of the primal-dual method for the computation of a feasible solution to
(23). In order to achieve this, we follow the guideline of path-following interior point method and define a central path that is a smooth curve connecting an initial interior point and a complementary solution. So the set of nonlinear equations
defines the central path of the homogeneous model parameterized by
,
is an initial feasible point and
has the expression
where
is the number of cones.
11.2
The Nesterov–Todd Search Direction
The Newton search direction is only guaranteed to be well-defined in a narrow neighbourhood around the central path. The search direction corresponds to applying Newton's method to
(24) in a scaled space and then scaling the resulting search direction back to the original space so that it is well-defined. A matrix
is a scaling matrix if it satisfies the conditions
and
where
means
is symmetric and positive definite and
is a symmetric block diagonal matrix composed by so called reflection matrices
with the following definition:
It is easy to see that if we scale
to
,
to
,
to
, and
to
, the resulting primal and dual pair is equivalent to
(19) and
(20), see
Alizadeh and Goldfarb (2003) for more details.
An important issue is the choice of the scaling matrix
. According to
Andersen et al. (2003), the best results are obtained for the Nesterov–Todd (NT) scaling suggested by
Nesterov and Todd (1997). In the NT scaling,
is chosen such that
Then the resulting Newton system to be solved to get direction
is
11.3
Mehrotra's Predictor-Corrector Method
When Newton's method is applied to the perturbed complementarity conditions in
(24), the quadratic terms are neglected. Instead of neglecting the quadratic term
Mehrotra (1992) suggested using a second-order correction of the search direction which increases the efficiency of the algorithm significantly in practice (
Lustig et al. (1992)).
To implement this idea, we first solve
(24) for
to get an affine scaling direction and a maximum step size
to the boundary. Then use these directions to estimate the quadratic terms
from
(24) and use
to choose
where
is a constant. Therefore we can choose
dynamically depending on how much progress can be made in the pure Newton (affine scaling) direction.
11.4
Solving the KKT System
The solution of the Newton system of equations
(25) is the most computationally costly operation. To reduce the system, we need the following definition. Associated with each vector
there is an arrow-shaped matrix
defined as:
where
is the identity matrix of dimension
. Together with the definition in
(22), it is not hard to see that
In practice, system
(25) is reduced to the augmented system by eliminating
and
from the system as follows:
and
where
(
eliminated) are the corresponding right-hand side in
(25) and we have that
and
Linear systems
(26) and
(27) are systems of
variables, symmetric and indefinite. Submatrix
is block diagonal and positive definite. Note that systems
(26) and
(27) have the same coefficient matrix so we only need to perform factorization once per iteration.
The system
(27) can be further reduced by eliminating
and
, to a positive definite system usually called normal equations defined as
also system
(26) can be reduced similarly.
Typically, formulation
(28) is preferred for many problems as the system matrix can be factorized by a sparse Cholesky. However, this brings some well-known disadvantages: ill-conditioning of the system is often observed during the final stages of the algorithm. If matrix
contains dense columns (columns with relatively many nonzeros), then
has many nonzeros, which in turn makes the factorization expensive. On the other hand, solving the augmented system by Bunch–Parlett type factorization is usually slower, but it normally avoids the fill-in caused by dense columns.
e04ptf can detect and handle dense columns in the KKT system effectively. Since matrix
in
(28) is block diagonal, so dense columns also come as a linear combination of some columns in
. Depending on the number and the density of the ‘dense’ columns, the solver may either choose to directly use an augmented system formulation or to treat these columns separately in a product-form Cholesky factorization as described by
Goldfarb and Scheinberg (2005). It is also possible to manually override the automatic choice via the optional parameter
SOCP System Formulation and let the solver use a normal equations or an augmented system formulation.
Badly scaled optimal solutions may present numerical challenges, therefore iterative refinement is employed for reducing the roundoff errors produced during the solution of the system. When the condition number of the system
prevents the satisfactory use of iterative refinement,
e04ptf switches automatically to an augmented system formulation, reporting
RS (Restart) in the last column of the iteration log (
I). Furthermore,
e04ptf provides several scaling techniques to adjust the numerical characteristics of the problem data, see optional parameter
SOCP Scaling.
Finally, factorization of the system matrix can degrade sparsity, so the resulting fill-in can be large, therefore several ordering techniques are included to minimize it.
e04ptf uses Harwell packages MA97 (see
Hogg and Scott (2011) and
HSL (2011)) for the underlying sparse linear algebra factorization and MC68 approximate minimum degree algorithm, and METIS (
Karypis and Kumar (1998)) nested dissection algorithm for the ordering.
11.5
Stopping Criteria
11.5.1
Convergence-optimal termination
To measure the infeasibility, the following measures
are defined to measure the relative reduction in the primal, dual and gap infeasibility, respectively. In addition, an extra measure is considered to quantify the accuracy in the objective function, which is given by
The iteration is considered nearly feasible and optimal, and the interior point algorithm is stopped when the following conditions
are satisfied. Here
and
may be set using
SOCP Stop Tolerance and
SOCP Stop Tolerance 2, respectively.
Premature termination is triggered and the returned solution is considered as an optimal solution if the current iteration exhibits fast convergence and the optimality measures lie within a small range of desired precision. In particular, the self-dual algorithm is stopped if the above termination conditions are met within a small factor and . This measure is tracked after the first iterations.
In addition, the solver stops prematurely and reports suboptimal solution when it predicts that the current estimate of the solution will not be improved in subsequent iterations. In most cases the returned solution should be acceptable.
11.5.2
Infeasibility/Unboundedness Detection
The problem is concluded to be primal or dual infeasible if one of the following conditions hold:
-
1..
-
2..
Then the problem is declared dual infeasible if or primal infeasible otherwise.
11.6
Further Details
e04ptf includes an advance preprocessing phase (called presolve) to reduce the dimensions of the problem before passing it to the solver. The reduction in problem size generally improves the behaviour of the solver, shortening the total computation time. In addition, infeasibility may also be detected during preprocessing. The default behaviour of the presolve can be modified by optional parameter
SOCP Presolve.
12
Optional Parameters
Several optional parameters in e04ptf define choices in the problem specification or the algorithm logic. In order to reduce the number of formal arguments of e04ptf these optional parameters have associated default values that are appropriate for most problems. Therefore, you need only specify those optional parameters whose values are to be different from their default values.
The remainder of this section can be skipped if you wish to use the default values for all optional parameters.
The optional parameters can be changed by calling
e04zmf anytime between the initialization of the handle and the call to the solver. Modification of the optional parameters during intermediate monitoring stops is not allowed. Once the solver finishes, the optional parameters can be altered again for the next solve.
The option values can be retrieved by calling
e04znf.
The following is a list of the optional parameters available. A full description of each optional parameter is provided in
Section 12.1.
12.1
Description of the Optional Parameters
For each option, we give a summary line, a description of the optional parameter and details of constraints.
The summary line contains:
- the keywords;
- a parameter value,
where the letters , and denote options that take character, integer and real values respectively;
- the default value, where the symbol is a generic notation for machine precision (see x02ajf).
All options accept the value to return single options to their default states.
Keywords and character values are case and white space insensitive.
This special keyword may be used to reset all optional parameters to their default values. Any argument value given with this keyword will be ignored.
Infinite Bound Size | | Default |
This defines the ‘infinite’ bound in the definition of the problem constraints. Any upper bound greater than or equal to will
be regarded as (and similarly any lower bound less than or equal to will be regarded as ). Note that a modification of this optional parameter does not influence constraints which have already been defined; only the constraints formulated after the change will be affected.
Constraint: .
Monitoring File | | Default |
If
, the
unit number
for the secondary (monitoring) output. If set to
, no secondary output is provided. The following information is output to the unit:
-
–a listing of the optional parameters;
-
–problem statistics, the iteration log, and the final status as set by Monitoring Level;
-
–the solution if set by Print Solution.
Constraint: .
Monitoring Level | | Default |
This parameter sets the amount of information detail that will be printed by the solver to the secondary output. The meaning of the levels is the same as with
Print Level.
Constraint: .
Print File | | Default
|
If
, the
unit number
for the primary output of the solver. If
, the primary output is completely turned off independently of other settings. The default value is the advisory message unit number as defined by
x04abf at the time of the optional parameters initialization, e.g., at the initialization of the handle. The following information is output to the unit:
-
–a listing of optional parameters if set by Print Options;
-
–problem statistics, the iteration log, and the final status from the solver as set by Print Level;
-
–the solution if set by Print Solution.
Constraint: .
This parameter defines how detailed information should be printed by the solver to the primary output.
|
Output |
|
No output from the solver |
|
Only the final status and the primal and dual objective value |
|
Problem statistics, one line per iteration showing the progress of the solution with respect to the convergence measures, final status and statistics |
|
As level but each iteration line is longer, including step lengths and errors |
|
As level but further details of each iteration are presented |
Constraint: .
Print Options | | Default |
If , a listing of optional parameters will be printed to the primary output.
Constraint: or .
Print Solution | | Default |
If , the final values of the primal variables are printed on the primary and secondary outputs.
If or , in addition to the primal variables, the final values of the dual variables are printed on the primary and secondary outputs.
Constraint: , , or .
SOCP Iteration Limit | | Default |
The maximum number of iterations to be performed by e04ptf. Setting the option too low might lead to .
Constraint: .
SOCP Monitor Frequency | | Default |
This parameter defines the frequency of how often subroutine
monit is called. If
, the solver calls
monit at the end of every
th iteration. If it is set to
, the subroutine is not called at all.
Constraint: .
SOCP Presolve | | Default |
This parameter allows you to reduce the level of presolving of the problem or turn it off completely. If the presolver is turned off, the solver will try to handle the problem as given by you. In such a case, the presence of fixed variables or linear dependencies in the constraint matrix can cause numerical instabilities to occur. In normal circumstances, it is recommended to use the full presolve which is the default.
Constraint: , or .
SOCP Scaling | | Default |
This parameter controls the type of scaling to be applied on the constraint matrix before solving the problem. More precisely, the scaling procedure will try to find diagonal matrices and such that the values in are of a similar order of magnitude. The solver is less likely to run into numerical difficulties when the constraint matrix is well scaled.
Constraint: , or .
SOCP Stop Tolerance | | Default |
This parameter sets the value
which is the tolerance for the convergence measures in the stopping criteria, see
Section 11.5.
Constraint: .
SOCP Stop Tolerance 2 | | Default |
This parameter sets the additional tolerance
used in the stopping criteria, see
Section 11.5.
Constraint: .
SOCP System Formulation | | Default |
As described in
Section 11.4,
e04ptf can internally work either with the normal equations formulation
(28) or with the augmented system
(26) and
(27). A brief discussion of advantages and disadvantages is presented in
(27). Setting the option value to
leaves the decision to the solver based on the structure of the constraints and it is the recommended value. This will typically lead to the normal equations formulation unless there are many dense columns or the system is significantly cheaper to factorize as the augmented system. Note that in some cases even if
the solver might switch the formulation through the computation to the augmented system due to numerical instabilities or computational cost.
Constraint: , , , or .
This parameter allows you to turn on timings of various parts of the algorithm to give a better overview of where most of the time is spent. This might be helpful for a choice of different solving approaches. It is possible to choose between CPU and wall clock time. Choice is equivalent to .
Constraint: , , or .
This parameter specifies the required direction of the optimization. If
, the objective function (if set) is ignored and the algorithm stops as soon as a feasible point is found with respect to the given tolerance. If no objective function is set,
Task reverts to
automatically.
Constraint: , or .
A limit to the number of seconds that the solver can use to solve one problem. If during the convergence check this limit is exceeded, the solver will terminate with .
Constraint: .