The Conic Optimization Solver
Getting Started: Conic Optimization Solver
The example in this section illustrates how you can use the OPTMODEL procedure to solve conic optimization problems. Suppose you want to solve the following second-order cone problem:
The fifth constraint is a rotated second-order cone that is defined on the variables ,
,
, and
. This cone constraint together with the fourth constraint transforms the following general nonlinear constraint into a second-order cone programming formulation:
You can use the following statements to call the OPTMODEL procedure to solve this SOCP problem:
/* getting started example for conic solver */
proc optmodel;
/* declare variables */
var x {1..6} >= 0;
/* objective function */
min Z = 5*x[1] + x[4] + x[5] + x[6];
/* linear constraints */
con c1: -3*x[3] + x[4] + x[5] >= 0;
con c2: x[3] - 0.1*x[5] - 0.25*x[6] >= 0;
con c3: x[4] + x[5] + x[6] >= 2;
con c4: x[2] = 0.5;
/* rotated second-order cone constraint */
con cone: rsoc(x[1], x[2], x[3] x[4]);
/* bounds on variables */
x[3].lb = 0.2;
x[3].ub = 1;
for{i in 5..6} x[i].ub = 1;
/* specify conic solver */
solve with conic;
/* print optimal primal solution and dual cone solution */
print x x.dcone;
quit;
The output and optimal solution are displayed in Figure 1. The dual cone values are returned in each variable.dcone suffix.
Figure 1: Summaries and Optimal Solution
| Problem Summary | |
|---|---|
| Objective Sense | Minimization |
| Objective Function | Z |
| Objective Type | Linear |
| Number of Variables | 6 |
| Bounded Above | 0 |
| Bounded Below | 3 |
| Bounded Below and Above | 3 |
| Free | 0 |
| Fixed | 0 |
| Number of Constraints | 5 |
| Linear LE (<=) | 0 |
| Linear EQ (=) | 1 |
| Linear GE (>=) | 3 |
| Linear Range | 0 |
| Rotated Second-Order Cone | 1 |
| Solution Summary | |
|---|---|
| Solver | Conic |
| Algorithm | Interior Point |
| Objective Function | Z |
| Solution Status | Optimal |
| Objective Value | 2.576470543 |
| Primal Infeasibility | 2.7662483E-8 |
| Dual Infeasibility | 0 |
| Bound Infeasibility | 0 |
| Duality Gap | 4.6776548E-8 |
| Complementarity | 6.4866402E-8 |
| Iterations | 8 |
| Presolve Time | 0.00 |
| Solution Time | 0.00 |
| [1] | x | x.DCONE |
|---|---|---|
| 1 | 0.115294 | 5.00000 |
| 2 | 0.500000 | 1.15348 |
| 3 | 0.329415 | -3.29488 |
| 4 | 0.082341 | -0.82372 |
| 5 | 1.000000 | . |
| 6 | 0.917659 | . |
The iteration log that displays problem statistics, the progress of the solution, and the optimal objective value is shown in Figure 2.
Figure 2: Log
| NOTE: Problem generation will use 4 threads. |
| NOTE: The problem has 6 variables (0 free, 0 fixed). |
| NOTE: The problem has 4 linear constraints (0 LE, 1 EQ, 3 GE, 0 range). |
| NOTE: The problem has 10 linear constraint coefficients. |
| NOTE: The problem has 0 nonlinear constraints (0 LE, 0 EQ, 0 GE, 0 range). |
| NOTE: The problem has 1 predicate constraints. |
| NOTE: The conic presolver value AUTOMATIC is applied. |
| NOTE: The conic presolver removed 0 variables and 1 constraints. |
| NOTE: The conic presolver removed 1 constraint coefficients. |
| NOTE: The presolved problem has 6 variables, 4 constraints, and 11 constraint |
| coefficients. |
| NOTE: The presolved problem has 1 second-order cone constraints. |
| NOTE: The conic solver is called. |
| NOTE: The Interior Point algorithm is used. |
| NOTE: The deterministic parallel mode is enabled. |
| NOTE: The Interior Point algorithm is using up to 4 threads. |
| Primal Bound Dual |
| Iter Complement Duality Gap Infeas Infeas Infeas Time |
| 0 1.2000E+01 6.3355E+00 1.1554E+00 9.5998E-01 9.9645E-01 0 |
| 1 6.2502E+00 2.3692E+00 4.3206E-01 3.5899E-01 3.7262E-01 0 |
| 2 1.9365E+00 6.9667E-01 1.7791E-01 1.4782E-01 1.5344E-01 0 |
| 3 2.1123E-01 8.1739E-02 3.4021E-02 2.8266E-02 2.9340E-02 0 |
| 4 5.8675E-02 2.5400E-02 1.1679E-02 9.7038E-03 1.0072E-02 0 |
| 5 4.5766E-03 2.0031E-03 9.3971E-04 7.8077E-04 8.1043E-04 0 |
| 6 2.0916E-04 9.2153E-05 4.3295E-05 3.5972E-05 3.7339E-05 0 |
| 7 1.6809E-05 7.4083E-06 3.4809E-06 2.8921E-06 3.0020E-06 0 |
| 8 2.2432E-07 9.8865E-08 4.6453E-08 3.8596E-08 4.0062E-08 0 |
| NOTE: Optimal. |
| NOTE: Objective = 2.576470543. |
| NOTE: The Interior Point solve time is 0.00 seconds. |