The MOSEK Python optimizer API manual Version 7.0 (Revision 141)

Optimizer API for Python - Documentation - Mosek Optimizer API for Python - Documentation - Mosek

25.11.2015 Views

180 CHAPTER 14. PRIMAL FEASIBILITY REPAIR minimize x + z subject to x = − 1, x ≥ 0 is repaired then it will be unbounded. Hence, a repaired problem may not have an optimal solution. (14.6) Another and more important caveat is that only a minimial repair is perfomed i.e. the repair that just make the problem feasible. Hence, the repaired problem is barely feasible and that sometimes make the repaired problem hard to solve. 14.3 Feasibility repair in MOSEK MOSEK includes a function that repair an infeasible problem using the idea described in the previous section simply by passing a set of weights to MOSEK. This can be used for linear and conic optimization problems, possibly having integer constrained variables. 14.3.1 An example using the command line tool Consider the example linear optimization minimize − 10x 1 − 9x 2 , subject to 7/10x 1 + 1x 2 ≤ 630, 1/2x 1 + 5/6x 2 ≤ 600, 1x 1 + 2/3x 2 ≤ 708, 1/10x 1 + 1/4x 2 ≤ 135, x 1 , x 2 ≥ 0, x 2 ≥ 650 (14.7) which is infeasible. Now suppose we wish to use MOSEK to suggest a modification to the bounds that makes the problem feasible. Given the assumption that all weights are 1 then the command mosek -primalrepair -d MSK IPAR LOG FEAS REPAIR 3 feasrepair.lp will form the repaired problem and solve it. The parameter MSK IPAR LOG FEAS REPAIR controls the amount of log output from the repair. A value of 2 causes the optimal repair to printed out. The output from running the above command is: Copyright (c) 1998-2013 MOSEK ApS, Denmark. WWW: http://mosek.com Open file ’feasrepair.lp’ Read summary Type Objective sense : LO (linear optimization problem) : min

14.3. FEASIBILITY REPAIR IN MOSEK 181 Constraints : 4 Scalar variables : 2 Matrix variables : 0 Time : 0.0 Computer Platform : Windows/64-X86 Cores : 4 Problem Name : Objective sense : min Type : LO (linear optimization problem) Constraints : 4 Cones : 0 Scalar variables : 2 Matrix variables : 0 Integer variables : 0 Primal feasibility repair started. Optimizer started. Interior-point optimizer started. Presolve started. Linear dependency checker started. Linear dependency checker terminated. Eliminator started. Total number of eliminations : 2 Eliminator terminated. Eliminator - tries : 1 time : 0.00 Eliminator - elim’s : 2 Lin. dep. - tries : 1 time : 0.00 Lin. dep. - number : 0 Presolve terminated. Time: 0.00 Optimizer - threads : 1 Optimizer - solved problem : the primal Optimizer - Constraints : 2 Optimizer - Cones : 0 Optimizer - Scalar variables : 6 conic : 0 Optimizer - Semi-definite variables: 0 scalarized : 0 Factor - setup time : 0.00 dense det. time : 0.00 Factor - ML order time : 0.00 GP order time : 0.00 Factor - nonzeros before factor : 3 after factor : 3 Factor - dense dim. : 0 flops : 5.40e+001 ITE PFEAS DFEAS GFEAS PRSTATUS POBJ DOBJ MU TIME 0 2.7e+001 1.0e+000 4.8e+000 1.00e+000 4.195228609e+000 0.000000000e+000 1.0e+000 0.00 1 2.4e+001 8.6e-001 1.5e+000 0.00e+000 1.227497414e+001 1.504971820e+001 2.6e+000 0.00 2 2.6e+000 9.7e-002 1.7e-001 -6.19e-001 4.363064729e+001 4.648523094e+001 3.0e-001 0.00 3 4.7e-001 1.7e-002 3.1e-002 1.24e+000 4.256803136e+001 4.298540657e+001 5.2e-002 0.00 4 8.7e-004 3.2e-005 5.7e-005 1.08e+000 4.249989892e+001 4.250078747e+001 9.7e-005 0.00 5 8.7e-008 3.2e-009 5.7e-009 1.00e+000 4.249999999e+001 4.250000008e+001 9.7e-009 0.00 6 8.7e-012 3.2e-013 5.7e-013 1.00e+000 4.250000000e+001 4.250000000e+001 9.7e-013 0.00 Basis identification started. Primal basis identification phase started. ITER TIME 0 0.00 Primal basis identification phase terminated. Time: 0.00 Dual basis identification phase started. ITER TIME

180 CHAPTER 14. PRIMAL FEASIBILITY REPAIR<br />

minimize x + z<br />

subject to x = − 1,<br />

x ≥ 0<br />

is repaired then it will be unbounded. Hence, a repaired problem may not have an optimal solution.<br />

(14.6)<br />

Another and more important caveat is that only a minimial repair is perfomed i.e. the repair that just<br />

make the problem feasible. Hence, the repaired problem is barely feasible and that sometimes make<br />

the repaired problem hard to solve.<br />

14.3 Feasibility repair in <strong>MOSEK</strong><br />

<strong>MOSEK</strong> includes a function that repair an infeasible problem using the idea described in the previous<br />

section simply by passing a set of weights to <strong>MOSEK</strong>. This can be used for linear and conic optimization<br />

problems, possibly having integer constrained variables.<br />

14.3.1 An example using the command line tool<br />

Consider the example linear optimization<br />

minimize − 10x 1 − 9x 2 ,<br />

subject to 7/10x 1 + 1x 2 ≤ 630,<br />

1/2x 1 + 5/6x 2 ≤ 600,<br />

1x 1 + 2/3x 2 ≤ 708,<br />

1/10x 1 + 1/4x 2 ≤ 135,<br />

x 1 , x 2 ≥ 0,<br />

x 2 ≥ 650<br />

(14.7)<br />

which is infeasible. Now suppose we wish to use <strong>MOSEK</strong> to suggest a modification to the bounds that<br />

makes the problem feasible.<br />

Given the assumption that all weights are 1 then the command<br />

mosek -primalrepair -d MSK IPAR LOG FEAS REPAIR 3 feasrepair.lp<br />

will form the repaired problem and solve it. <strong>The</strong> parameter<br />

MSK IPAR LOG FEAS REPAIR<br />

controls the amount of log output from the repair. A value of 2 causes the optimal repair to printed<br />

out.<br />

<strong>The</strong> output from running the above command is:<br />

Copyright (c) 1998-2013 <strong>MOSEK</strong> ApS, Denmark. WWW: http://mosek.com<br />

Open file ’feasrepair.lp’<br />

Read summary<br />

Type<br />

Objective sense<br />

: LO (linear optimization problem)<br />

: min

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!