The MOSEK Python optimizer API manual Version 7.0 (Revision 141)
Optimizer API for Python - Documentation - Mosek Optimizer API for Python - Documentation - Mosek
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
- Page 151 and 152: 10.2. CONIC QUADRATIC OPTIMIZATION
- Page 153 and 154: 10.3. SEMIDEFINITE OPTIMIZATION 131
- Page 155 and 156: 10.4. QUADRATIC AND QUADRATICALLY C
- Page 157 and 158: Chapter 11 The optimizers for conti
- Page 159 and 160: 11.1. HOW AN OPTIMIZER WORKS 137 11
- Page 161 and 162: 11.2. LINEAR OPTIMIZATION 139 11.2.
- Page 163 and 164: 11.2. LINEAR OPTIMIZATION 141 Whene
- Page 165 and 166: 11.2. LINEAR OPTIMIZATION 143 11.2.
- Page 167 and 168: 11.2. LINEAR OPTIMIZATION 145 • R
- Page 169 and 170: 11.5. NONLINEAR CONVEX OPTIMIZATION
- Page 171 and 172: 11.6. SOLVING PROBLEMS IN PARALLEL
- Page 173 and 174: 11.6. SOLVING PROBLEMS IN PARALLEL
- Page 175 and 176: 11.6. SOLVING PROBLEMS IN PARALLEL
- Page 177 and 178: Chapter 12 The optimizers for mixed
- Page 179 and 180: 12.3. THE MIXED-INTEGER CONIC OPTIM
- Page 181 and 182: 12.5. TERMINATION CRITERION 159 •
- Page 183 and 184: 12.7. UNDERSTANDING SOLUTION QUALIT
- Page 185 and 186: Chapter 13 The analyzers 13.1 The p
- Page 187 and 188: 13.1. THE PROBLEM ANALYZER 165 Cons
- Page 189 and 190: 13.2. ANALYZING INFEASIBLE PROBLEMS
- Page 191 and 192: 13.2. ANALYZING INFEASIBLE PROBLEMS
- Page 193 and 194: 13.2. ANALYZING INFEASIBLE PROBLEMS
- Page 195 and 196: 13.2. ANALYZING INFEASIBLE PROBLEMS
- Page 197 and 198: 13.2. ANALYZING INFEASIBLE PROBLEMS
- Page 199 and 200: Chapter 14 Primal feasibility repai
- Page 201: 14.2. AUTOMATIC REPAIR 179 One way
- Page 205 and 206: 14.3. FEASIBILITY REPAIR IN MOSEK 1
- Page 207 and 208: Chapter 15 Sensitivity analysis 15.
- Page 209 and 210: 15.4. SENSITIVITY ANALYSIS FOR LINE
- Page 211 and 212: 15.4. SENSITIVITY ANALYSIS FOR LINE
- Page 213 and 214: 15.4. SENSITIVITY ANALYSIS FOR LINE
- Page 215 and 216: 15.5. SENSITIVITY ANALYSIS FROM THE
- Page 217 and 218: 15.6. SENSITIVITY ANALYSIS WITH THE
- Page 219 and 220: 15.6. SENSITIVITY ANALYSIS WITH THE
- Page 221 and 222: Appendix A API reference This chapt
- Page 223 and 224: 201 • Task.relaxprimal Obtain inf
- Page 225 and 226: A.1. EXCEPTIONS 203 • Task.putvar
- Page 227 and 228: A.2. CLASS TASK 205 Arguments which
- Page 229 and 230: A.2. CLASS TASK 207 See also • Ro
- Page 231 and 232: A.2. CLASS TASK 209 Description: Ap
- Page 233 and 234: A.2. CLASS TASK 211 Description: If
- Page 235 and 236: A.2. CLASS TASK 213 A.2.16 Task.com
- Page 237 and 238: A.2. CLASS TASK 215 subj : int[] In
- Page 239 and 240: A.2. CLASS TASK 217 firsti : int In
- Page 241 and 242: A.2. CLASS TASK 219 A.2.27 Task.get
- Page 243 and 244: A.2. CLASS TASK 221 valijkl : Descr
- Page 245 and 246: A.2. CLASS TASK 223 A.2.33 Task.get
- Page 247 and 248: A.2. CLASS TASK 225 idx : long Inde
- Page 249 and 250: A.2. CLASS TASK 227 A.2.41 Task.get
- Page 251 and 252: A.2. CLASS TASK 229 i : int Index o
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