Top Banner
The MOSEK optimization toolbox for MATLAB manual. Version 7.0 (Revision 141).
470

The MOSEK optimization toolbox for MATLAB manual. Version 7.0

Feb 11, 2022

Download

Documents

dariahiddleston
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

The MOSEK optimization toolbox forMATLAB manual.

Version 7.0 (Revision 141).

Page 2: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

ii

• Published by MOSEK ApS, Denmark.

• Copyright c© MOSEK ApS, Denmark. All rights reserved.

Page 3: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

Contents

1 Changes and new features in MOSEK 51.1 Platform support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51.2 General changes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51.3 Optimizers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6

1.3.1 Interior point optimizer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61.3.2 The simplex optimizers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61.3.3 Mixed-integer optimizer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7

1.4 API changes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71.5 Optimization toolbox for MATLAB . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71.6 License system . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71.7 Other changes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71.8 Interfaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71.9 Platform changes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8

2 Introduction 92.1 What is optimization? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92.2 Why you need the MOSEK optimization toolbox . . . . . . . . . . . . . . . . . . . . . 9

2.2.1 Features of the MOSEK optimization toolbox . . . . . . . . . . . . . . . . . . . . 9

3 Supported MATLAB versions 11

4 Installation 134.1 Locating the toolbox functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13

4.1.1 On Windows . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 134.1.2 On Linux/UNIX/MAC OS X . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 144.1.3 Permanently changing matlabpath . . . . . . . . . . . . . . . . . . . . . . . . . . 14

4.2 Verifying that MOSEK works . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 144.3 Troubleshooting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15

4.3.1 Undefined function or variable ’mosekopt’ . . . . . . . . . . . . . . . . . . . . . . 154.3.2 Invalid MEX-file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154.3.3 Output arguments not assigned . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15

5 Getting support and help 175.1 MOSEK documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175.2 Additional reading . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17

iii

Page 4: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

iv CONTENTS

6 MOSEK / MATLAB integration 196.1 MOSEK replacements for MATLAB functions . . . . . . . . . . . . . . . . . . . . . . . 196.2 The license system . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19

6.2.1 Waiting for a free license . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 206.2.2 Using MOSEK with the Parallel Computing Toolbox . . . . . . . . . . . . . . . . 20

7 A guided tour 217.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 217.2 The tour starts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 217.3 The MOSEK terminology . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 227.4 Linear optimization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22

7.4.1 Using msklpopt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 237.4.2 Using mosekopt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 237.4.3 Using linprog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25

7.5 Convex quadratic optimization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 257.5.1 Two important assumptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 267.5.2 Using mskqpopt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 267.5.3 Using mosekopt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27

7.6 Conic optimization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 287.6.1 The conic optimization problem . . . . . . . . . . . . . . . . . . . . . . . . . . . 287.6.2 Solving an example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 297.6.3 Quadratic and conic optimization . . . . . . . . . . . . . . . . . . . . . . . . . . . 307.6.4 Conic duality and the dual solution . . . . . . . . . . . . . . . . . . . . . . . . . 327.6.5 Setting accuracy parameters for the conic optimizer . . . . . . . . . . . . . . . . 33

7.7 Semidefinite optimization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 347.7.1 The semidefinite optimization problem . . . . . . . . . . . . . . . . . . . . . . . . 347.7.2 Solving an example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 357.7.3 Linear matrix inequalities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37

7.8 Quadratically constrained optimization . . . . . . . . . . . . . . . . . . . . . . . . . . . 377.9 Linear least squares and related norm minimization problems . . . . . . . . . . . . . . 38

7.9.1 The case of the 2 norm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 397.9.2 The case of the infinity norm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 407.9.3 The case of the 1-norm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41

7.10 Compatibility with MATLAB Optimization Toolbox . . . . . . . . . . . . . . . . . . . 427.11 More about solving linear least squares problems . . . . . . . . . . . . . . . . . . . . . 43

7.11.1 Using conic optimization on linear least squares problems . . . . . . . . . . . . . 477.12 Entropy optimization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48

7.12.1 Using mskenopt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 487.13 Geometric optimization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48

7.13.1 Using mskgpopt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 497.13.2 Comments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51

7.14 Separable convex optimization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 527.14.1 Using mskscopt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53

7.15 Mixed-integer optimization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 557.15.1 A linear mixed-integer example . . . . . . . . . . . . . . . . . . . . . . . . . . . . 557.15.2 A conic quadratic mixed-integer example . . . . . . . . . . . . . . . . . . . . . . 56

Page 5: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

CONTENTS v

7.15.3 Speeding up the solution of a mixed-integer problem . . . . . . . . . . . . . . . . 577.16 Sensitivity analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 597.17 Inspecting a problem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 607.18 The solutions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62

7.18.1 The constraint and variable status keys . . . . . . . . . . . . . . . . . . . . . . . 637.19 Viewing the task information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 637.20 Inspecting and setting parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 647.21 Advanced start (hot-start) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65

7.21.1 Some examples using hot-start . . . . . . . . . . . . . . . . . . . . . . . . . . . . 657.21.2 Adding a new variable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 667.21.3 Fixing a variable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 677.21.4 Adding a new constraint . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 677.21.5 Removing a constraint . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 687.21.6 Removing a variable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 697.21.7 Using numeric values to represent status key codes . . . . . . . . . . . . . . . . . 69

7.22 Using names . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 717.22.1 Blanks in names . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71

7.23 MPS and other file formats . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 717.23.1 Reading an MPS file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 717.23.2 Writing a MPS files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 727.23.3 Other file formats . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72

7.24 User call-back functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 737.24.1 Log printing via call-back function . . . . . . . . . . . . . . . . . . . . . . . . . . 737.24.2 The iteration call-back function . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74

7.25 The license system . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 757.26 Caveats using the MATLAB compiler . . . . . . . . . . . . . . . . . . . . . . . . . . . 75

8 Command reference 778.1 Data structures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77

8.1.1 prob . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 778.1.2 names . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 838.1.3 cones . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 848.1.4 barc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 858.1.5 bara . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 868.1.6 sol . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 868.1.7 prisen . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 888.1.8 duasen . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 898.1.9 info . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 898.1.10 symbcon . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 898.1.11 callback . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90

8.2 An example of a command reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . 908.3 Functions provided by the MOSEK optimization toolbox . . . . . . . . . . . . . . . . . 918.4 MATLAB optimization toolbox compatible functions . . . . . . . . . . . . . . . . . . . 94

8.4.1 Linear and quadratic optimization . . . . . . . . . . . . . . . . . . . . . . . . . . 948.4.2 Linear optimization with binary variables . . . . . . . . . . . . . . . . . . . . . . 988.4.3 For linear least squares problems . . . . . . . . . . . . . . . . . . . . . . . . . . . 99

Page 6: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

vi CONTENTS

8.4.4 The optimization options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103

9 Case studies 1079.1 Robust linear optimization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107

9.1.1 Introductory example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1079.1.2 Data uncertainty and its consequences. . . . . . . . . . . . . . . . . . . . . . . . 1099.1.3 Robust linear optimization methodology . . . . . . . . . . . . . . . . . . . . . . . 1109.1.4 Random uncertainty and ellipsoidal robust counterpart . . . . . . . . . . . . . . 1149.1.5 Further references . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122

9.2 Geometric (posynomial) optimization . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1229.2.1 The problem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1229.2.2 Applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1249.2.3 Modeling tricks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1249.2.4 Problematic formulations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1259.2.5 An example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1269.2.6 Solving the example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1269.2.7 Exporting to a file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1279.2.8 Further information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127

10 The optimizers for continuous problems 12910.1 How an optimizer works . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129

10.1.1 Presolve . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13010.1.2 Dualizer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13110.1.3 Scaling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13210.1.4 Using multiple threads . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132

10.2 Linear optimization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13210.2.1 Optimizer selection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13210.2.2 The interior-point optimizer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13310.2.3 The simplex based optimizer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13810.2.4 The interior-point or the simplex optimizer? . . . . . . . . . . . . . . . . . . . . . 13910.2.5 The primal or the dual simplex variant? . . . . . . . . . . . . . . . . . . . . . . . 139

10.3 Linear network optimization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14010.3.1 Network flow problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 140

10.4 Conic optimization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14010.4.1 The interior-point optimizer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 140

10.5 Nonlinear convex optimization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14110.5.1 The interior-point optimizer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141

10.6 Solving problems in parallel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14210.6.1 Thread safety . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14210.6.2 The parallelized interior-point optimizer . . . . . . . . . . . . . . . . . . . . . . . 14310.6.3 The concurrent optimizer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143

11 The solution summary 145

12 The optimizers for mixed-integer problems 14712.1 Some concepts and facts related to mixed-integer optimization . . . . . . . . . . . . . . 14712.2 The mixed-integer optimizers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 148

Page 7: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

CONTENTS vii

12.3 The mixed-integer conic optimizer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14912.3.1 Presolve . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14912.3.2 Heuristic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14912.3.3 The optimization phase . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15012.3.4 Caveats . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 150

12.4 The mixed-integer optimizer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15012.4.1 Presolve . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15012.4.2 Heuristic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15012.4.3 The optimization phase . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151

12.5 Termination criterion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15112.5.1 Relaxed termination . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15112.5.2 Important parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 152

12.6 How to speed up the solution process . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15212.7 Understanding solution quality . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153

13 The solution summary for mixed integer problems 155

14 The analyzers 15714.1 The problem analyzer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157

14.1.1 General characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15814.1.2 Objective . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16014.1.3 Linear constraints . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16014.1.4 Constraint and variable bounds . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16114.1.5 Quadratic constraints . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16114.1.6 Conic constraints . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 161

14.2 Analyzing infeasible problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16114.2.1 Example: Primal infeasibility . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16214.2.2 Locating the cause of primal infeasibility . . . . . . . . . . . . . . . . . . . . . . 16314.2.3 Locating the cause of dual infeasibility . . . . . . . . . . . . . . . . . . . . . . . . 16414.2.4 The infeasibility report . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16414.2.5 Theory concerning infeasible problems . . . . . . . . . . . . . . . . . . . . . . . . 16814.2.6 The certificate of primal infeasibility . . . . . . . . . . . . . . . . . . . . . . . . . 16814.2.7 The certificate of dual infeasibility . . . . . . . . . . . . . . . . . . . . . . . . . . 169

15 Primal feasibility repair 17115.1 Manual repair . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17115.2 Automatic repair . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 172

15.2.1 Caveats . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17315.3 Feasibility repair in MOSEK . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 174

15.3.1 An example using feasibility repair . . . . . . . . . . . . . . . . . . . . . . . . . . 174

16 Sensitivity analysis 17916.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17916.2 Restrictions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17916.3 References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17916.4 Sensitivity analysis for linear problems . . . . . . . . . . . . . . . . . . . . . . . . . . . 180

16.4.1 The optimal objective value function . . . . . . . . . . . . . . . . . . . . . . . . . 180

Page 8: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

viii CONTENTS

16.4.2 The basis type sensitivity analysis . . . . . . . . . . . . . . . . . . . . . . . . . . 18116.4.3 The optimal partition type sensitivity analysis . . . . . . . . . . . . . . . . . . . 18216.4.4 Example: Sensitivity analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 183

16.5 Sensitivity analysis in the MATLAB toolbox . . . . . . . . . . . . . . . . . . . . . . . . 18616.5.1 On bounds . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18616.5.2 Selecting analysis type . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18816.5.3 An example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 188

17 Problem formulation and solutions 19317.1 Linear optimization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 193

17.1.1 Duality for linear optimization . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19417.1.2 Infeasibility for linear optimization . . . . . . . . . . . . . . . . . . . . . . . . . . 196

17.2 Conic quadratic optimization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19717.2.1 Duality for conic quadratic optimization . . . . . . . . . . . . . . . . . . . . . . . 19817.2.2 Infeasibility for conic quadratic optimization . . . . . . . . . . . . . . . . . . . . 199

17.3 Semidefinite optimization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20017.3.1 Duality for semidefinite optimization . . . . . . . . . . . . . . . . . . . . . . . . . 20017.3.2 Infeasibility for semidefinite optimization . . . . . . . . . . . . . . . . . . . . . . 201

17.4 Quadratic and quadratically constrained optimization . . . . . . . . . . . . . . . . . . 20217.4.1 Duality for quadratic and quadratically constrained optimization . . . . . . . . . 20217.4.2 Infeasibility for quadratic and quadratically constrained optimization . . . . . . . 203

17.5 General convex optimization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20317.5.1 Duality for general convex optimization . . . . . . . . . . . . . . . . . . . . . . . 204

18 The MPS file format 20718.1 MPS file structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 207

18.1.1 Linear example lo1.mps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20918.1.2 NAME . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20918.1.3 OBJSENSE (optional) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20918.1.4 OBJNAME (optional) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21018.1.5 ROWS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21018.1.6 COLUMNS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21018.1.7 RHS (optional) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21118.1.8 RANGES (optional) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21218.1.9 QSECTION (optional) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21218.1.10BOUNDS (optional) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21418.1.11CSECTION (optional) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21418.1.12ENDATA . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 216

18.2 Integer variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21718.3 General limitations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21718.4 Interpretation of the MPS format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21718.5 The free MPS format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 218

19 The LP file format 21919.1 The sections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 220

19.1.1 The objective . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22019.1.2 The constraints . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 221

Page 9: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

CONTENTS ix

19.1.3 Bounds . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22219.1.4 Variable types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22219.1.5 Terminating section . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22219.1.6 Linear example lo1.lp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22319.1.7 Mixed integer example milo1.lp . . . . . . . . . . . . . . . . . . . . . . . . . . . 223

19.2 LP format peculiarities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22319.2.1 Comments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22319.2.2 Names . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22319.2.3 Variable bounds . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22419.2.4 MOSEK specific extensions to the LP format . . . . . . . . . . . . . . . . . . . . 224

19.3 The strict LP format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22519.4 Formatting of an LP file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 225

19.4.1 Speeding up file reading . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22619.4.2 Unnamed constraints . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 226

20 The OPF format 22720.1 Intended use . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22720.2 The file format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 227

20.2.1 Sections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22820.2.2 Numbers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23220.2.3 Names . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 232

20.3 Parameters section . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23220.4 Writing OPF files from MOSEK . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23320.5 Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 233

20.5.1 Linear example lo1.opf . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23320.5.2 Quadratic example qo1.opf . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23420.5.3 Conic quadratic example cqo1.opf . . . . . . . . . . . . . . . . . . . . . . . . . . 23520.5.4 Mixed integer example milo1.opf . . . . . . . . . . . . . . . . . . . . . . . . . . 236

21 The Task format 239

22 The XML (OSiL) format 241

23 Parameters 24323.1 MSKdparame: Double parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 257

23.1.1 MSK DPAR ANA SOL INFEAS TOL . . . . . . . . . . . . . . . . . . . . . . . . 25723.1.2 MSK DPAR BASIS REL TOL S . . . . . . . . . . . . . . . . . . . . . . . . . . . 25723.1.3 MSK DPAR BASIS TOL S . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25823.1.4 MSK DPAR BASIS TOL X . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25823.1.5 MSK DPAR CHECK CONVEXITY REL TOL . . . . . . . . . . . . . . . . . . . 25823.1.6 MSK DPAR DATA TOL AIJ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25923.1.7 MSK DPAR DATA TOL AIJ HUGE . . . . . . . . . . . . . . . . . . . . . . . . 25923.1.8 MSK DPAR DATA TOL AIJ LARGE . . . . . . . . . . . . . . . . . . . . . . . . 25923.1.9 MSK DPAR DATA TOL BOUND INF . . . . . . . . . . . . . . . . . . . . . . . 26023.1.10 MSK DPAR DATA TOL BOUND WRN . . . . . . . . . . . . . . . . . . . . . . 26023.1.11 MSK DPAR DATA TOL C HUGE . . . . . . . . . . . . . . . . . . . . . . . . . . 26023.1.12 MSK DPAR DATA TOL CJ LARGE . . . . . . . . . . . . . . . . . . . . . . . . 261

Page 10: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

x CONTENTS

23.1.13 MSK DPAR DATA TOL QIJ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26123.1.14 MSK DPAR DATA TOL X . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26123.1.15 MSK DPAR FEASREPAIR TOL . . . . . . . . . . . . . . . . . . . . . . . . . . 26223.1.16 MSK DPAR INTPNT CO TOL DFEAS . . . . . . . . . . . . . . . . . . . . . . 26223.1.17 MSK DPAR INTPNT CO TOL INFEAS . . . . . . . . . . . . . . . . . . . . . . 26323.1.18 MSK DPAR INTPNT CO TOL MU RED . . . . . . . . . . . . . . . . . . . . . 26323.1.19 MSK DPAR INTPNT CO TOL NEAR REL . . . . . . . . . . . . . . . . . . . . 26323.1.20 MSK DPAR INTPNT CO TOL PFEAS . . . . . . . . . . . . . . . . . . . . . . . 26423.1.21 MSK DPAR INTPNT CO TOL REL GAP . . . . . . . . . . . . . . . . . . . . . 26423.1.22 MSK DPAR INTPNT NL MERIT BAL . . . . . . . . . . . . . . . . . . . . . . . 26423.1.23 MSK DPAR INTPNT NL TOL DFEAS . . . . . . . . . . . . . . . . . . . . . . . 26523.1.24 MSK DPAR INTPNT NL TOL MU RED . . . . . . . . . . . . . . . . . . . . . . 26523.1.25 MSK DPAR INTPNT NL TOL NEAR REL . . . . . . . . . . . . . . . . . . . . 26523.1.26 MSK DPAR INTPNT NL TOL PFEAS . . . . . . . . . . . . . . . . . . . . . . . 26623.1.27 MSK DPAR INTPNT NL TOL REL GAP . . . . . . . . . . . . . . . . . . . . . 26623.1.28 MSK DPAR INTPNT NL TOL REL STEP . . . . . . . . . . . . . . . . . . . . . 26623.1.29 MSK DPAR INTPNT TOL DFEAS . . . . . . . . . . . . . . . . . . . . . . . . . 26723.1.30 MSK DPAR INTPNT TOL DSAFE . . . . . . . . . . . . . . . . . . . . . . . . . 26723.1.31 MSK DPAR INTPNT TOL INFEAS . . . . . . . . . . . . . . . . . . . . . . . . 26723.1.32 MSK DPAR INTPNT TOL MU RED . . . . . . . . . . . . . . . . . . . . . . . . 26823.1.33 MSK DPAR INTPNT TOL PATH . . . . . . . . . . . . . . . . . . . . . . . . . . 26823.1.34 MSK DPAR INTPNT TOL PFEAS . . . . . . . . . . . . . . . . . . . . . . . . . 26823.1.35 MSK DPAR INTPNT TOL PSAFE . . . . . . . . . . . . . . . . . . . . . . . . . 26923.1.36 MSK DPAR INTPNT TOL REL GAP . . . . . . . . . . . . . . . . . . . . . . . 26923.1.37 MSK DPAR INTPNT TOL REL STEP . . . . . . . . . . . . . . . . . . . . . . . 26923.1.38 MSK DPAR INTPNT TOL STEP SIZE . . . . . . . . . . . . . . . . . . . . . . . 27023.1.39 MSK DPAR LOWER OBJ CUT . . . . . . . . . . . . . . . . . . . . . . . . . . . 27023.1.40 MSK DPAR LOWER OBJ CUT FINITE TRH . . . . . . . . . . . . . . . . . . 27023.1.41 MSK DPAR MIO DISABLE TERM TIME . . . . . . . . . . . . . . . . . . . . . 27123.1.42 MSK DPAR MIO HEURISTIC TIME . . . . . . . . . . . . . . . . . . . . . . . . 27123.1.43 MSK DPAR MIO MAX TIME . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27223.1.44 MSK DPAR MIO MAX TIME APRX OPT . . . . . . . . . . . . . . . . . . . . 27223.1.45 MSK DPAR MIO NEAR TOL ABS GAP . . . . . . . . . . . . . . . . . . . . . . 27323.1.46 MSK DPAR MIO NEAR TOL REL GAP . . . . . . . . . . . . . . . . . . . . . . 27323.1.47 MSK DPAR MIO REL ADD CUT LIMITED . . . . . . . . . . . . . . . . . . . 27423.1.48 MSK DPAR MIO REL GAP CONST . . . . . . . . . . . . . . . . . . . . . . . . 27423.1.49 MSK DPAR MIO TOL ABS GAP . . . . . . . . . . . . . . . . . . . . . . . . . . 27423.1.50 MSK DPAR MIO TOL ABS RELAX INT . . . . . . . . . . . . . . . . . . . . . 27523.1.51 MSK DPAR MIO TOL FEAS . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27523.1.52 MSK DPAR MIO TOL REL DUAL BOUND IMPROVEMENT . . . . . . . . . 27523.1.53 MSK DPAR MIO TOL REL GAP . . . . . . . . . . . . . . . . . . . . . . . . . . 27623.1.54 MSK DPAR MIO TOL REL RELAX INT . . . . . . . . . . . . . . . . . . . . . 27623.1.55 MSK DPAR MIO TOL X . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27623.1.56 MSK DPAR NONCONVEX TOL FEAS . . . . . . . . . . . . . . . . . . . . . . 27723.1.57 MSK DPAR NONCONVEX TOL OPT . . . . . . . . . . . . . . . . . . . . . . . 27723.1.58 MSK DPAR OPTIMIZER MAX TIME . . . . . . . . . . . . . . . . . . . . . . . 277

Page 11: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

CONTENTS xi

23.1.59 MSK DPAR PRESOLVE TOL ABS LINDEP . . . . . . . . . . . . . . . . . . . 27823.1.60 MSK DPAR PRESOLVE TOL AIJ . . . . . . . . . . . . . . . . . . . . . . . . . 27823.1.61 MSK DPAR PRESOLVE TOL REL LINDEP . . . . . . . . . . . . . . . . . . . 27823.1.62 MSK DPAR PRESOLVE TOL S . . . . . . . . . . . . . . . . . . . . . . . . . . . 27923.1.63 MSK DPAR PRESOLVE TOL X . . . . . . . . . . . . . . . . . . . . . . . . . . 27923.1.64 MSK DPAR QCQO REFORMULATE REL DROP TOL . . . . . . . . . . . . . 27923.1.65 MSK DPAR SIM LU TOL REL PIV . . . . . . . . . . . . . . . . . . . . . . . . 28023.1.66 MSK DPAR SIMPLEX ABS TOL PIV . . . . . . . . . . . . . . . . . . . . . . . 28023.1.67 MSK DPAR UPPER OBJ CUT . . . . . . . . . . . . . . . . . . . . . . . . . . . 28023.1.68 MSK DPAR UPPER OBJ CUT FINITE TRH . . . . . . . . . . . . . . . . . . . 281

23.2 MSKiparame: Integer parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28123.2.1 MSK IPAR ALLOC ADD QNZ . . . . . . . . . . . . . . . . . . . . . . . . . . . 28123.2.2 MSK IPAR ANA SOL BASIS . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28223.2.3 MSK IPAR ANA SOL PRINT VIOLATED . . . . . . . . . . . . . . . . . . . . . 28223.2.4 MSK IPAR AUTO SORT A BEFORE OPT . . . . . . . . . . . . . . . . . . . . 28223.2.5 MSK IPAR AUTO UPDATE SOL INFO . . . . . . . . . . . . . . . . . . . . . . 28323.2.6 MSK IPAR BASIS SOLVE USE PLUS ONE . . . . . . . . . . . . . . . . . . . . 28323.2.7 MSK IPAR BI CLEAN OPTIMIZER . . . . . . . . . . . . . . . . . . . . . . . . 28323.2.8 MSK IPAR BI IGNORE MAX ITER . . . . . . . . . . . . . . . . . . . . . . . . 28423.2.9 MSK IPAR BI IGNORE NUM ERROR . . . . . . . . . . . . . . . . . . . . . . . 28423.2.10 MSK IPAR BI MAX ITERATIONS . . . . . . . . . . . . . . . . . . . . . . . . . 28523.2.11 MSK IPAR CACHE LICENSE . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28523.2.12 MSK IPAR CHECK CONVEXITY . . . . . . . . . . . . . . . . . . . . . . . . . 28623.2.13 MSK IPAR COMPRESS STATFILE . . . . . . . . . . . . . . . . . . . . . . . . . 28623.2.14 MSK IPAR CONCURRENT NUM OPTIMIZERS . . . . . . . . . . . . . . . . . 28623.2.15 MSK IPAR CONCURRENT PRIORITY DUAL SIMPLEX . . . . . . . . . . . . 28723.2.16 MSK IPAR CONCURRENT PRIORITY FREE SIMPLEX . . . . . . . . . . . . 28723.2.17 MSK IPAR CONCURRENT PRIORITY INTPNT . . . . . . . . . . . . . . . . 28723.2.18 MSK IPAR CONCURRENT PRIORITY PRIMAL SIMPLEX . . . . . . . . . . 28823.2.19 MSK IPAR FEASREPAIR OPTIMIZE . . . . . . . . . . . . . . . . . . . . . . . 28823.2.20 MSK IPAR INFEAS GENERIC NAMES . . . . . . . . . . . . . . . . . . . . . . 28823.2.21 MSK IPAR INFEAS PREFER PRIMAL . . . . . . . . . . . . . . . . . . . . . . 28923.2.22 MSK IPAR INFEAS REPORT AUTO . . . . . . . . . . . . . . . . . . . . . . . . 28923.2.23 MSK IPAR INFEAS REPORT LEVEL . . . . . . . . . . . . . . . . . . . . . . . 28923.2.24 MSK IPAR INTPNT BASIS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29023.2.25 MSK IPAR INTPNT DIFF STEP . . . . . . . . . . . . . . . . . . . . . . . . . . 29023.2.26 MSK IPAR INTPNT FACTOR DEBUG LVL . . . . . . . . . . . . . . . . . . . 29123.2.27 MSK IPAR INTPNT FACTOR METHOD . . . . . . . . . . . . . . . . . . . . . 29123.2.28 MSK IPAR INTPNT HOTSTART . . . . . . . . . . . . . . . . . . . . . . . . . . 29123.2.29 MSK IPAR INTPNT MAX ITERATIONS . . . . . . . . . . . . . . . . . . . . . 29223.2.30 MSK IPAR INTPNT MAX NUM COR . . . . . . . . . . . . . . . . . . . . . . . 29223.2.31 MSK IPAR INTPNT MAX NUM REFINEMENT STEPS . . . . . . . . . . . . 29223.2.32 MSK IPAR INTPNT OFF COL TRH . . . . . . . . . . . . . . . . . . . . . . . . 29323.2.33 MSK IPAR INTPNT ORDER METHOD . . . . . . . . . . . . . . . . . . . . . . 29323.2.34 MSK IPAR INTPNT REGULARIZATION USE . . . . . . . . . . . . . . . . . . 29423.2.35 MSK IPAR INTPNT SCALING . . . . . . . . . . . . . . . . . . . . . . . . . . . 294

Page 12: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

xii CONTENTS

23.2.36 MSK IPAR INTPNT SOLVE FORM . . . . . . . . . . . . . . . . . . . . . . . . 29423.2.37 MSK IPAR INTPNT STARTING POINT . . . . . . . . . . . . . . . . . . . . . . 29523.2.38 MSK IPAR LIC TRH EXPIRY WRN . . . . . . . . . . . . . . . . . . . . . . . . 29523.2.39 MSK IPAR LICENSE ALLOW OVERUSE . . . . . . . . . . . . . . . . . . . . . 29623.2.40 MSK IPAR LICENSE DEBUG . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29623.2.41 MSK IPAR LICENSE PAUSE TIME . . . . . . . . . . . . . . . . . . . . . . . . 29623.2.42 MSK IPAR LICENSE SUPPRESS EXPIRE WRNS . . . . . . . . . . . . . . . . 29723.2.43 MSK IPAR LICENSE WAIT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29723.2.44 MSK IPAR LOG . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29723.2.45 MSK IPAR LOG BI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29823.2.46 MSK IPAR LOG BI FREQ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29823.2.47 MSK IPAR LOG CHECK CONVEXITY . . . . . . . . . . . . . . . . . . . . . . 29923.2.48 MSK IPAR LOG CONCURRENT . . . . . . . . . . . . . . . . . . . . . . . . . . 29923.2.49 MSK IPAR LOG CUT SECOND OPT . . . . . . . . . . . . . . . . . . . . . . . 29923.2.50 MSK IPAR LOG EXPAND . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30023.2.51 MSK IPAR LOG FACTOR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30023.2.52 MSK IPAR LOG FEAS REPAIR . . . . . . . . . . . . . . . . . . . . . . . . . . 30123.2.53 MSK IPAR LOG FILE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30123.2.54 MSK IPAR LOG HEAD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30123.2.55 MSK IPAR LOG INFEAS ANA . . . . . . . . . . . . . . . . . . . . . . . . . . . 30223.2.56 MSK IPAR LOG INTPNT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30223.2.57 MSK IPAR LOG MIO . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30223.2.58 MSK IPAR LOG MIO FREQ . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30323.2.59 MSK IPAR LOG NONCONVEX . . . . . . . . . . . . . . . . . . . . . . . . . . . 30323.2.60 MSK IPAR LOG OPTIMIZER . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30323.2.61 MSK IPAR LOG ORDER . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30423.2.62 MSK IPAR LOG PARAM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30423.2.63 MSK IPAR LOG PRESOLVE . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30423.2.64 MSK IPAR LOG RESPONSE . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30523.2.65 MSK IPAR LOG SENSITIVITY . . . . . . . . . . . . . . . . . . . . . . . . . . . 30523.2.66 MSK IPAR LOG SENSITIVITY OPT . . . . . . . . . . . . . . . . . . . . . . . . 30523.2.67 MSK IPAR LOG SIM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30623.2.68 MSK IPAR LOG SIM FREQ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30623.2.69 MSK IPAR LOG SIM MINOR . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30623.2.70 MSK IPAR LOG SIM NETWORK FREQ . . . . . . . . . . . . . . . . . . . . . 30723.2.71 MSK IPAR LOG STORAGE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30723.2.72 MSK IPAR MAX NUM WARNINGS . . . . . . . . . . . . . . . . . . . . . . . . 30723.2.73 MSK IPAR MIO BRANCH DIR . . . . . . . . . . . . . . . . . . . . . . . . . . . 30823.2.74 MSK IPAR MIO BRANCH PRIORITIES USE . . . . . . . . . . . . . . . . . . . 30823.2.75 MSK IPAR MIO CONSTRUCT SOL . . . . . . . . . . . . . . . . . . . . . . . . 30823.2.76 MSK IPAR MIO CONT SOL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30923.2.77 MSK IPAR MIO CUT LEVEL ROOT . . . . . . . . . . . . . . . . . . . . . . . . 30923.2.78 MSK IPAR MIO CUT LEVEL TREE . . . . . . . . . . . . . . . . . . . . . . . . 31023.2.79 MSK IPAR MIO FEASPUMP LEVEL . . . . . . . . . . . . . . . . . . . . . . . 31023.2.80 MSK IPAR MIO HEURISTIC LEVEL . . . . . . . . . . . . . . . . . . . . . . . 31123.2.81 MSK IPAR MIO HOTSTART . . . . . . . . . . . . . . . . . . . . . . . . . . . . 311

Page 13: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

CONTENTS xiii

23.2.82 MSK IPAR MIO KEEP BASIS . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31223.2.83 MSK IPAR MIO LOCAL BRANCH NUMBER . . . . . . . . . . . . . . . . . . 31223.2.84 MSK IPAR MIO MAX NUM BRANCHES . . . . . . . . . . . . . . . . . . . . . 31223.2.85 MSK IPAR MIO MAX NUM RELAXS . . . . . . . . . . . . . . . . . . . . . . . 31323.2.86 MSK IPAR MIO MAX NUM SOLUTIONS . . . . . . . . . . . . . . . . . . . . . 31323.2.87 MSK IPAR MIO MODE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31423.2.88 MSK IPAR MIO MT USER CB . . . . . . . . . . . . . . . . . . . . . . . . . . . 31423.2.89 MSK IPAR MIO NODE OPTIMIZER . . . . . . . . . . . . . . . . . . . . . . . . 31423.2.90 MSK IPAR MIO NODE SELECTION . . . . . . . . . . . . . . . . . . . . . . . . 31523.2.91 MSK IPAR MIO OPTIMIZER MODE . . . . . . . . . . . . . . . . . . . . . . . 31623.2.92 MSK IPAR MIO PRESOLVE AGGREGATE . . . . . . . . . . . . . . . . . . . . 31623.2.93 MSK IPAR MIO PRESOLVE PROBING . . . . . . . . . . . . . . . . . . . . . . 31623.2.94 MSK IPAR MIO PRESOLVE USE . . . . . . . . . . . . . . . . . . . . . . . . . . 31723.2.95 MSK IPAR MIO ROOT OPTIMIZER . . . . . . . . . . . . . . . . . . . . . . . . 31723.2.96 MSK IPAR MIO STRONG BRANCH . . . . . . . . . . . . . . . . . . . . . . . . 31823.2.97 MSK IPAR MIO USE MULTITHREADED OPTIMIZER . . . . . . . . . . . . . 31823.2.98 MSK IPAR MT SPINCOUNT . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31823.2.99 MSK IPAR NONCONVEX MAX ITERATIONS . . . . . . . . . . . . . . . . . . 31923.2.100MSK IPAR NUM THREADS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31923.2.101MSK IPAR OPF MAX TERMS PER LINE . . . . . . . . . . . . . . . . . . . . 31923.2.102MSK IPAR OPF WRITE HEADER . . . . . . . . . . . . . . . . . . . . . . . . . 32023.2.103MSK IPAR OPF WRITE HINTS . . . . . . . . . . . . . . . . . . . . . . . . . . 32023.2.104MSK IPAR OPF WRITE PARAMETERS . . . . . . . . . . . . . . . . . . . . . 32023.2.105MSK IPAR OPF WRITE PROBLEM . . . . . . . . . . . . . . . . . . . . . . . . 32123.2.106MSK IPAR OPF WRITE SOL BAS . . . . . . . . . . . . . . . . . . . . . . . . . 32123.2.107MSK IPAR OPF WRITE SOL ITG . . . . . . . . . . . . . . . . . . . . . . . . . 32123.2.108MSK IPAR OPF WRITE SOL ITR . . . . . . . . . . . . . . . . . . . . . . . . . 32223.2.109MSK IPAR OPF WRITE SOLUTIONS . . . . . . . . . . . . . . . . . . . . . . . 32223.2.110MSK IPAR OPTIMIZER . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32323.2.111MSK IPAR PARAM READ CASE NAME . . . . . . . . . . . . . . . . . . . . . 32323.2.112MSK IPAR PARAM READ IGN ERROR . . . . . . . . . . . . . . . . . . . . . 32423.2.113MSK IPAR PRESOLVE ELIM FILL . . . . . . . . . . . . . . . . . . . . . . . . 32423.2.114MSK IPAR PRESOLVE ELIMINATOR MAX NUM TRIES . . . . . . . . . . . 32423.2.115MSK IPAR PRESOLVE ELIMINATOR USE . . . . . . . . . . . . . . . . . . . . 32523.2.116MSK IPAR PRESOLVE LEVEL . . . . . . . . . . . . . . . . . . . . . . . . . . . 32523.2.117MSK IPAR PRESOLVE LINDEP ABS WORK TRH . . . . . . . . . . . . . . . 32523.2.118MSK IPAR PRESOLVE LINDEP REL WORK TRH . . . . . . . . . . . . . . . 32623.2.119MSK IPAR PRESOLVE LINDEP USE . . . . . . . . . . . . . . . . . . . . . . . 32623.2.120MSK IPAR PRESOLVE MAX NUM REDUCTIONS . . . . . . . . . . . . . . . 32623.2.121MSK IPAR PRESOLVE USE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32723.2.122MSK IPAR PRIMAL REPAIR OPTIMIZER . . . . . . . . . . . . . . . . . . . . 32723.2.123MSK IPAR QO SEPARABLE REFORMULATION . . . . . . . . . . . . . . . . 32823.2.124MSK IPAR READ ANZ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32823.2.125MSK IPAR READ CON . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32823.2.126MSK IPAR READ CONE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32923.2.127MSK IPAR READ DATA COMPRESSED . . . . . . . . . . . . . . . . . . . . . 329

Page 14: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

xiv CONTENTS

23.2.128MSK IPAR READ DATA FORMAT . . . . . . . . . . . . . . . . . . . . . . . . . 32923.2.129MSK IPAR READ KEEP FREE CON . . . . . . . . . . . . . . . . . . . . . . . 33023.2.130MSK IPAR READ LP DROP NEW VARS IN BOU . . . . . . . . . . . . . . . . 33023.2.131MSK IPAR READ LP QUOTED NAMES . . . . . . . . . . . . . . . . . . . . . 33123.2.132MSK IPAR READ MPS FORMAT . . . . . . . . . . . . . . . . . . . . . . . . . 33123.2.133MSK IPAR READ MPS KEEP INT . . . . . . . . . . . . . . . . . . . . . . . . . 33123.2.134MSK IPAR READ MPS OBJ SENSE . . . . . . . . . . . . . . . . . . . . . . . . 33223.2.135MSK IPAR READ MPS RELAX . . . . . . . . . . . . . . . . . . . . . . . . . . . 33223.2.136MSK IPAR READ MPS WIDTH . . . . . . . . . . . . . . . . . . . . . . . . . . 33323.2.137MSK IPAR READ QNZ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33323.2.138MSK IPAR READ TASK IGNORE PARAM . . . . . . . . . . . . . . . . . . . . 33323.2.139MSK IPAR READ VAR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33423.2.140MSK IPAR SENSITIVITY ALL . . . . . . . . . . . . . . . . . . . . . . . . . . . 33423.2.141MSK IPAR SENSITIVITY OPTIMIZER . . . . . . . . . . . . . . . . . . . . . . 33423.2.142MSK IPAR SENSITIVITY TYPE . . . . . . . . . . . . . . . . . . . . . . . . . . 33523.2.143MSK IPAR SIM BASIS FACTOR USE . . . . . . . . . . . . . . . . . . . . . . . 33523.2.144MSK IPAR SIM DEGEN . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33623.2.145MSK IPAR SIM DUAL CRASH . . . . . . . . . . . . . . . . . . . . . . . . . . . 33623.2.146MSK IPAR SIM DUAL PHASEONE METHOD . . . . . . . . . . . . . . . . . . 33723.2.147MSK IPAR SIM DUAL RESTRICT SELECTION . . . . . . . . . . . . . . . . . 33723.2.148MSK IPAR SIM DUAL SELECTION . . . . . . . . . . . . . . . . . . . . . . . . 33723.2.149MSK IPAR SIM EXPLOIT DUPVEC . . . . . . . . . . . . . . . . . . . . . . . . 33823.2.150MSK IPAR SIM HOTSTART . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33823.2.151MSK IPAR SIM HOTSTART LU . . . . . . . . . . . . . . . . . . . . . . . . . . 33923.2.152MSK IPAR SIM INTEGER . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33923.2.153MSK IPAR SIM MAX ITERATIONS . . . . . . . . . . . . . . . . . . . . . . . . 33923.2.154MSK IPAR SIM MAX NUM SETBACKS . . . . . . . . . . . . . . . . . . . . . . 34023.2.155MSK IPAR SIM NON SINGULAR . . . . . . . . . . . . . . . . . . . . . . . . . 34023.2.156MSK IPAR SIM PRIMAL CRASH . . . . . . . . . . . . . . . . . . . . . . . . . . 34023.2.157MSK IPAR SIM PRIMAL PHASEONE METHOD . . . . . . . . . . . . . . . . 34123.2.158MSK IPAR SIM PRIMAL RESTRICT SELECTION . . . . . . . . . . . . . . . 34123.2.159MSK IPAR SIM PRIMAL SELECTION . . . . . . . . . . . . . . . . . . . . . . 34123.2.160MSK IPAR SIM REFACTOR FREQ . . . . . . . . . . . . . . . . . . . . . . . . 34223.2.161MSK IPAR SIM REFORMULATION . . . . . . . . . . . . . . . . . . . . . . . . 34223.2.162MSK IPAR SIM SAVE LU . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34323.2.163MSK IPAR SIM SCALING . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34323.2.164MSK IPAR SIM SCALING METHOD . . . . . . . . . . . . . . . . . . . . . . . 34423.2.165MSK IPAR SIM SOLVE FORM . . . . . . . . . . . . . . . . . . . . . . . . . . . 34423.2.166MSK IPAR SIM STABILITY PRIORITY . . . . . . . . . . . . . . . . . . . . . . 34423.2.167MSK IPAR SIM SWITCH OPTIMIZER . . . . . . . . . . . . . . . . . . . . . . 34523.2.168MSK IPAR SOL FILTER KEEP BASIC . . . . . . . . . . . . . . . . . . . . . . 34523.2.169MSK IPAR SOL FILTER KEEP RANGED . . . . . . . . . . . . . . . . . . . . . 34523.2.170MSK IPAR SOL READ NAME WIDTH . . . . . . . . . . . . . . . . . . . . . . 34623.2.171MSK IPAR SOL READ WIDTH . . . . . . . . . . . . . . . . . . . . . . . . . . . 34623.2.172MSK IPAR SOLUTION CALLBACK . . . . . . . . . . . . . . . . . . . . . . . . 34723.2.173MSK IPAR TIMING LEVEL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 347

Page 15: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

CONTENTS xv

23.2.174MSK IPAR WARNING LEVEL . . . . . . . . . . . . . . . . . . . . . . . . . . . 34723.2.175MSK IPAR WRITE BAS CONSTRAINTS . . . . . . . . . . . . . . . . . . . . . 34823.2.176MSK IPAR WRITE BAS HEAD . . . . . . . . . . . . . . . . . . . . . . . . . . . 34823.2.177MSK IPAR WRITE BAS VARIABLES . . . . . . . . . . . . . . . . . . . . . . . 34823.2.178MSK IPAR WRITE DATA COMPRESSED . . . . . . . . . . . . . . . . . . . . 34923.2.179MSK IPAR WRITE DATA FORMAT . . . . . . . . . . . . . . . . . . . . . . . . 34923.2.180MSK IPAR WRITE DATA PARAM . . . . . . . . . . . . . . . . . . . . . . . . . 34923.2.181MSK IPAR WRITE FREE CON . . . . . . . . . . . . . . . . . . . . . . . . . . . 35023.2.182MSK IPAR WRITE GENERIC NAMES . . . . . . . . . . . . . . . . . . . . . . 35023.2.183MSK IPAR WRITE GENERIC NAMES IO . . . . . . . . . . . . . . . . . . . . 35123.2.184MSK IPAR WRITE IGNORE INCOMPATIBLE CONIC ITEMS . . . . . . . . 35123.2.185MSK IPAR WRITE IGNORE INCOMPATIBLE ITEMS . . . . . . . . . . . . . 35123.2.186MSK IPAR WRITE IGNORE INCOMPATIBLE NL ITEMS . . . . . . . . . . . 35223.2.187MSK IPAR WRITE IGNORE INCOMPATIBLE PSD ITEMS . . . . . . . . . . 35223.2.188MSK IPAR WRITE INT CONSTRAINTS . . . . . . . . . . . . . . . . . . . . . 35223.2.189MSK IPAR WRITE INT HEAD . . . . . . . . . . . . . . . . . . . . . . . . . . . 35323.2.190MSK IPAR WRITE INT VARIABLES . . . . . . . . . . . . . . . . . . . . . . . 35323.2.191MSK IPAR WRITE LP LINE WIDTH . . . . . . . . . . . . . . . . . . . . . . . 35323.2.192MSK IPAR WRITE LP QUOTED NAMES . . . . . . . . . . . . . . . . . . . . 35423.2.193MSK IPAR WRITE LP STRICT FORMAT . . . . . . . . . . . . . . . . . . . . 35423.2.194MSK IPAR WRITE LP TERMS PER LINE . . . . . . . . . . . . . . . . . . . . 35423.2.195MSK IPAR WRITE MPS INT . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35523.2.196MSK IPAR WRITE PRECISION . . . . . . . . . . . . . . . . . . . . . . . . . . 35523.2.197MSK IPAR WRITE SOL BARVARIABLES . . . . . . . . . . . . . . . . . . . . 35523.2.198MSK IPAR WRITE SOL CONSTRAINTS . . . . . . . . . . . . . . . . . . . . . 35623.2.199MSK IPAR WRITE SOL HEAD . . . . . . . . . . . . . . . . . . . . . . . . . . . 35623.2.200MSK IPAR WRITE SOL IGNORE INVALID NAMES . . . . . . . . . . . . . . 35623.2.201MSK IPAR WRITE SOL VARIABLES . . . . . . . . . . . . . . . . . . . . . . . 35723.2.202MSK IPAR WRITE TASK INC SOL . . . . . . . . . . . . . . . . . . . . . . . . 35723.2.203MSK IPAR WRITE XML MODE . . . . . . . . . . . . . . . . . . . . . . . . . . 357

23.3 MSKsparame: String parameter types . . . . . . . . . . . . . . . . . . . . . . . . . . . 35823.3.1 MSK SPAR BAS SOL FILE NAME . . . . . . . . . . . . . . . . . . . . . . . . . 35823.3.2 MSK SPAR DATA FILE NAME . . . . . . . . . . . . . . . . . . . . . . . . . . . 35823.3.3 MSK SPAR DEBUG FILE NAME . . . . . . . . . . . . . . . . . . . . . . . . . . 35823.3.4 MSK SPAR FEASREPAIR NAME PREFIX . . . . . . . . . . . . . . . . . . . . 35923.3.5 MSK SPAR FEASREPAIR NAME SEPARATOR . . . . . . . . . . . . . . . . . 35923.3.6 MSK SPAR FEASREPAIR NAME WSUMVIOL . . . . . . . . . . . . . . . . . . 35923.3.7 MSK SPAR INT SOL FILE NAME . . . . . . . . . . . . . . . . . . . . . . . . . 36023.3.8 MSK SPAR ITR SOL FILE NAME . . . . . . . . . . . . . . . . . . . . . . . . . 36023.3.9 MSK SPAR MIO DEBUG STRING . . . . . . . . . . . . . . . . . . . . . . . . . 36023.3.10 MSK SPAR PARAM COMMENT SIGN . . . . . . . . . . . . . . . . . . . . . . 36123.3.11 MSK SPAR PARAM READ FILE NAME . . . . . . . . . . . . . . . . . . . . . 36123.3.12 MSK SPAR PARAM WRITE FILE NAME . . . . . . . . . . . . . . . . . . . . . 36123.3.13 MSK SPAR READ MPS BOU NAME . . . . . . . . . . . . . . . . . . . . . . . . 36223.3.14 MSK SPAR READ MPS OBJ NAME . . . . . . . . . . . . . . . . . . . . . . . . 36223.3.15 MSK SPAR READ MPS RAN NAME . . . . . . . . . . . . . . . . . . . . . . . . 362

Page 16: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

xvi CONTENTS

23.3.16 MSK SPAR READ MPS RHS NAME . . . . . . . . . . . . . . . . . . . . . . . . 36323.3.17 MSK SPAR SENSITIVITY FILE NAME . . . . . . . . . . . . . . . . . . . . . . 36323.3.18 MSK SPAR SENSITIVITY RES FILE NAME . . . . . . . . . . . . . . . . . . . 36323.3.19 MSK SPAR SOL FILTER XC LOW . . . . . . . . . . . . . . . . . . . . . . . . . 36423.3.20 MSK SPAR SOL FILTER XC UPR . . . . . . . . . . . . . . . . . . . . . . . . . 36423.3.21 MSK SPAR SOL FILTER XX LOW . . . . . . . . . . . . . . . . . . . . . . . . . 36423.3.22 MSK SPAR SOL FILTER XX UPR . . . . . . . . . . . . . . . . . . . . . . . . . 36523.3.23 MSK SPAR STAT FILE NAME . . . . . . . . . . . . . . . . . . . . . . . . . . . 36523.3.24 MSK SPAR STAT KEY . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36523.3.25 MSK SPAR STAT NAME . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36623.3.26 MSK SPAR WRITE LP GEN VAR NAME . . . . . . . . . . . . . . . . . . . . . 366

24 Response codes 367

25 API constants 39725.1 Constraint or variable access modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39725.2 Basis identification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39725.3 Bound keys . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39825.4 Specifies the branching direction. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39825.5 Progress call-back codes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39825.6 Types of convexity checks. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40725.7 Compression types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40725.8 Cone types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40725.9 Data format types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40725.10 Double information items . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40825.11 Feasibility repair types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41325.12 License feature . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41325.13 Integer information items. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41325.14 Information item types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42025.15 Hot-start type employed by the interior-point optimizers. . . . . . . . . . . . . . . . . 42025.16 Input/output modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42025.17 Language selection constants . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42125.18 Long integer information items. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42125.19 Mark . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42225.20 Continuous mixed-integer solution type . . . . . . . . . . . . . . . . . . . . . . . . . . . 42225.21 Integer restrictions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42225.22 Mixed-integer node selection types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42325.23 MPS file format type . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42325.24 Message keys . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42325.25 Cone types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42425.26 Objective sense types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42425.27 On/off . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42425.28 Optimizer types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42425.29 Ordering strategies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42525.30 Parameter type . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42625.31 Presolve method. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 426

Page 17: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

CONTENTS xvii

25.32 Problem data items . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42625.33 Problem types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42625.34 Problem status keys . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42725.35 Response code type . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42825.36 Scaling type . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42825.37 Scaling type . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42825.38 Sensitivity types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42925.39 Degeneracy strategies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42925.40 Exploit duplicate columns. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42925.41 Hot-start type employed by the simplex optimizer . . . . . . . . . . . . . . . . . . . . . 43025.42 Problem reformulation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43025.43 Simplex selection strategy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43025.44 Solution items . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43125.45 Solution status keys . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43125.46 Solution types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43325.47 Solve primal or dual form . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43325.48 Status keys . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43325.49 Starting point types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43425.50 Stream types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43425.51 Cone types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43425.52 Integer values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43525.53 Variable types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43525.54 XML writer output mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 435

26 Problem analyzer examples 43726.1 air04 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43726.2 arki001 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43826.3 Problem with both linear and quadratic constraints . . . . . . . . . . . . . . . . . . . . 44026.4 Problem with both linear and conic constraints . . . . . . . . . . . . . . . . . . . . . . 441

Page 18: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

xviii CONTENTS

Page 19: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

Contact information

Phone +45 3917 9907Fax +45 3917 9823WEB http://www.mosek.comEmail [email protected] Sales, pricing, and licensing.

[email protected] Technical support, questions and bug [email protected] Everything else.

Mail MOSEK ApS

C/O Symbion Science ParkFruebjergvej 3, Box 162100 Copenhagen ODenmark

1

Page 20: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

2 CONTENTS

Page 21: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

License agreement

Before using the MOSEK software, please read the license agreement available in the distribution at

mosek\7\license.pdf

3

Page 22: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

4 CONTENTS

Page 23: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

Chapter 1

Changes and new features inMOSEK

The section presents improvements and new features added to MOSEK in version 7.0.

1.1 Platform support

In Table 1.1 the supported platform and compiler used to build MOSEK shown. Although RedHatis explicitly mentioned as the supported Linux distribution then MOSEK will work on most othervariants of Linux. However, the license manager tools requires Linux Standard Base 3 or newer isinstalled.

1.2 General changes

• The interior-point optimizer has been extended to semi-definite optimization problems. Hence,MOSEK can optimize over the positive semi-definite cone.

• The network detection has been completely redesigned. MOSEK no longer try detect partialnetworks. The problem must be a pure primal network for the network optimizer to be used.

• The parameter iparam.objective sense has been removed.

• The parameter iparam.intpnt num threads has been removed. Use the parameter iparam.num threadsinstead.

• MOSEK now automatically exploit multiple CPUs i.e. the parameter iparam.num threads is setto 0 be default. Note the amount memory that MOSEK uses grows with the number of threadsemployed.

5

Page 24: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

6 CHAPTER 1. CHANGES AND NEW FEATURES IN MOSEK

Platform OS version C compilerlinux32x86 Redhat 5 or newer (LSB 3+) Intel C 13.1 (gcc 4.3, glibc 2.3.4)linux64x86 RedHat 5 or newer (LSB 3+) Intel C 13.1 (gcc 4.3, glibc 2.3.4)osx64x86 OSX 10.7 Lion or newer Intel C 13.0 (llvm-gcc-4.2)win32x86 Windows XP, Server 2003 or newer Intel C 13.0 (VS 2008)win64x86 Windows XP, Server 2003 or newer Intel C 13.1 (VS 2008)

Interface Supported versionsJava Sun Java 1.6+Microsoft.NET 2.1+Python 2 2.6+Python 3 3.1+

Table 1.1: Supported platforms

• The MBT file format has been replaced by a new task format. The new format supports semi-definite optimization.

• the HTML version of the documentation is no longer included in the downloads to save space.It is still available online.

• MOSEK is more restrictive about the allowed names on variables etc. This is in particular thecase when writing LP files.

• MOSEK no longer tries to detect the cache sizes and is in general less sensitive to the hardware.

• The parameter is set iparam.auto update sol info is default off. In previous version it was bydefault on.

• The function relaxprimal has been deprecated and replaced by the function primalrepair.

1.3 Optimizers

1.3.1 Interior point optimizer

• The factorization routines employd by the interior-point optimizer for linear and conic opti-mization problems has been completely rewritten. In particular the dense column detection andhandling is improved. The factorization routine will also exploit vendor tuned BLAS routines.

1.3.2 The simplex optimizers

• No major changes.

Page 25: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

1.4. API CHANGES 7

1.3.3 Mixed-integer optimizer

• A new mixed-integer for linear and conic problems has been introduced. It is from run-to-rundeterminitic and is parallelized. It is particular suitable for conic problems.

1.4 API changes

• Added support for semidefinite optimization.

• Some clean up has been performed implying some functions have been renamed.

1.5 Optimization toolbox for MATLAB

• A MOSEK equivalent of bintprog has been introduced.

• The functionality of the MOSEK version of linprog has been improved. It is now possible toemploy the simplex optimizer in linprog.

• mosekopt now accepts a dense A matrix.

• An new method for specification of cones that is more efficient when the problem has many coneshas introduced. The old method is still allowed but is deprecated.

• Support for semidefinite optimization problems has been added to the toolbox.

1.6 License system

• Flexlm has been upgraded to version 11.11.

1.7 Other changes

• The documentation has been improved.

1.8 Interfaces

• Semi-definite optimization capabilities have been add to the optimizer APIs.

• A major clean up have occured in the optimizer APIs. This should have little effect for mostusers.

• A new object orientated interface called Fusion has been added. Fusion is available Java, MAT-LAB, .NET and Python.

• The AMPL command line tool has been updated to the latest version.

Page 26: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

8 CHAPTER 1. CHANGES AND NEW FEATURES IN MOSEK

1.9 Platform changes

• 32 bit MAC OSX on Intel x86 (osx32x86) is no longer supported.

• 32 and 64 bit Solaris on Intel x86 (solaris32x86,solaris64x86) is no longer supported.

Page 27: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

Chapter 2

Introduction

This manual describes the features of the MOSEK optimization toolbox for MATLAB. The toolboxmakes it possible to call the highly efficient MOSEK optimization engine from the MATLAB environ-ment.

2.1 What is optimization?

Many decision problems facing individuals and companies can be cast as an optimization problem i.e.making an optimal decision given some constraints specifying the possible decisions. As an exampleconsider the problem of determining an optimal production plan. This can be formulated as maximizinga profit function given a set of constraints specifying the possible production plans.

2.2 Why you need the MOSEK optimization toolbox

Before solving an optimization problem data is gathered and prepared. Subsequently an optimizationproblem is formulated based on this data and the problem is communicated to the optimization soft-ware. Finally, when the results have been obtained, they are analyzed and interpreted. A popularsoftware tool for these tasks is MATLAB, made by MathWorks (see http://www.mathworks.com).The MOSEK optimization solvers are well-established and succesfully deployed throughout the op-timization industry, and the MOSEK toolbox provides access to the powerful MOSEK solvers frominside the MATLAB environment.

2.2.1 Features of the MOSEK optimization toolbox

Below is a partial list of features in the MOSEK optimization toolbox.

• Solve linear optimization problems using either an interior-point or a simplex optimizer.

9

Page 28: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

10 CHAPTER 2. INTRODUCTION

• Solve conic quadratic and semidefinite optimization problems.

• Solve convex quadratic optimization problems.

• Handle convex quadratic constraints.

• Solve mixed-integer optimization problems, including linear, convex quadratic and conic quadraticproblems.

• Solve linear least squares problems with linear constraints.

• Solve linear l1 and l∞ norm minimization problems.

• Solve linearly constrained entropy optimization problems.

• Solve geometric programming problems (posynomial programming).

• Solve separable convex optimization problems.

• Read and write industry standard MPS files.

Page 29: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

Chapter 3

Supported MATLAB versions

Table 3.1 shows on which platforms and for which MATLAB versions the MOSEK optimization toolboxis available.

Platform R2009b-R2011b R2012a R2012b R2013a+linux32x86 Yes Yeslinux64x86 Yes Yes Yes Yesosx64x86 Yes Yes Yeswin32x86 Yes Yes Yes Yeswin64x86 Yes Yes Yes Yes

Table 3.1: Supported MATLAB versions.

11

Page 30: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

12 CHAPTER 3. SUPPORTED MATLAB VERSIONS

Page 31: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

Chapter 4

Installation

In order to use the MOSEK optimization toolbox for MATLAB, you must install the MOSEK opti-mization tools. Please see Chapter 1 in the MOSEK installation manual for details on how to installMOSEK. An online version is available at

http://mosek.com/resources/doc/

4.1 Locating the toolbox functions

By default MATLAB cannot locate the MOSEK optimization toolbox functions. Therefore you mustexecute the addpath command within MATLAB to change the so-called matlabpath appropriately.Indeed matlabpath should include a path to the MOSEK optimization toolbox functions. The nextsubsections show how to use addpath.

4.1.1 On Windows

If you are using Windows you should do

% For versions R2009b to R2011b

addpath ’c:\Program Files\mosek\7\toolbox\r2009b’

% For versions R2012a and R2012b

addpath ’c:\Program Files\mosek\7\toolbox\r2012a’

% For R2013a or newer

addpath ’c:\Program Files\mosek\7\toolbox\r2013a’

This assumes that you installed MOSEK at

c:\Program Files\

If this is not the case, you will have to change the path given to addpath.

13

Page 32: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

14 CHAPTER 4. INSTALLATION

4.1.2 On Linux/UNIX/MAC OS X

If you are using UNIX or a UNIX-like operating system you should do

% For versions R2009b to R2011b

% These versions are not supported on MAC OSX.

addpath ’/home/user/mosek/7/toolbox/r2009b’

% For versions R2012a and R2012b

addpath ’/home/user/mosek/7/toolbox/r2012a’

% For versions R2013a or newer

addpath ’/home/user/mosek/7/toolbox/r2013a’

This assumes that MOSEK is installed at

/home/user

If this is not the case, you will have to change the path given to addpath.

4.1.3 Permanently changing matlabpath

Normally, you will have to enter the addpath command every time MATLAB is started. This can beavoided if the addpath command is added to

<matlab>toolbox\local\startup.m

where <matlab> is the MATLAB root directory. Alternatively the permanent modification of theMATLAB path can be performed using the

\File\Set Path

menu item.

4.2 Verifying that MOSEK works

You can verify that MOSEK works by executing

mosekdiag

in MATLAB. You should get a message similar to this:

Matlab version: 7.13.0.564 (R2011b)

Architecture : GLNXA64

The mosek optimizer executed successfully from the command line:

MOSEK Version 7.0.0.78 (Build date: 2013-8-13 14:11:04)

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

Global optimizer version: 8.0.868.287. Global optimizer build date: Jan 21 2013 10:42:51

Barrier Solver Version 7.0.0.078,

Platform Linux 64x86 (D).

FlexLM

Version : 11.11

Hostname : gram

Host ID : "bc305bea244f bc305bea2450"

Page 33: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

4.3. TROUBLESHOOTING 15

Search path : /home/someuser/mosek/7/mosek.lic

Operating system variables

MOSEKLM LICENSE FILE : /home/joachim/mosekprj/generic/license/1000.lic

LD LIBRARY PATH :

/remote/public/matlab/r2011b/sys/os/glnxa64

/remote/public/matlab/r2011b/bin/glnxa64

/remote/public/matlab/r2011b/extern/lib/glnxa64

/remote/public/matlab/r2011b/sys/java/jre/glnxa64/jre/lib/amd64/native threads

/remote/public/matlab/r2011b/sys/java/jre/glnxa64/jre/lib/amd64/server

/remote/public/matlab/r2011b/sys/java/jre/glnxa64/jre/lib/amd64

*** No input file specfied. No optimization is performed.

Return code - 0 [MSK RES OK]

mosekopt: /home/someuser/mosek/7/toolbox/r2009b/mosekopt.mexa64

mosekopt is working correctly.

MOSEK Fusion is working correctly.

If you do not get this message, please read Section 4.3.

4.3 Troubleshooting

4.3.1 Undefined function or variable ’mosekopt’

If you get the MATLAB error message

Undefined function or variable ’mosekopt’

you have not set up the matlabpath correctly as described in Section 4.1.

4.3.2 Invalid MEX-file

For certain versions of Microsoft Windows and MATLAB, the path to the MEX files cannot containspaces. If you installed MOSEK in

C:\Program Files\Mosek

and get a MATLAB error from mosekopt:

Invalid MEX-file ’C:\ProgramFiles\Mosek\7\toolbox\r2012a\mosekopt.mexw64’

Then try installing MOSEK in a different directory, for example

C:\Users\someuser\mosek

4.3.3 Output arguments not assigned

If you encounter an error like

Error in ==> mosekopt at 1

function [r,res] = mosekopt(cmd,prob,param,callback)

Page 34: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

16 CHAPTER 4. INSTALLATION

Output argument "r" (and maybe others) not assigned during call to

"C:\Users\someuser\mosek\7\toolbox\r2009b\mosekopt.m>mosekopt".

then there is most like a mismatch between 32 and 64 versions of MOSEK and MATLAB.

From MATLAB type

>> which mosekopt

which (for a succesful installation) should point to a mex file,

C:\Users\someuser\mosek\7\toolbox\r2009b\mosekopt.mexw64

and not a MATLAB .m file,

C:\Users\someuser\mosek\7\toolbox\r2009b\mosekopt.m

Page 35: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

Chapter 5

Getting support and help

5.1 MOSEK documentation

For an overview of the available MOSEK documentation please see

mosek/7/help/index.html

in the distribution.

5.2 Additional reading

In this manual it is assumed that the reader is familiar with mathematics and in particular math-ematical optimization. Some introduction to linear programming is found in books such as ”Linearprogramming” by Chvatal [1] or ”Computer Solution of Linear Programs” by Nazareth [2]. For moretheoretical aspects see e.g. ”Nonlinear programming: Theory and algorithms” by Bazaraa, Shetty,and Sherali [3]. Finally, the book ”Model building in mathematical programming” by Williams [4]provides an excellent introduction to modeling issues in optimization.

Another useful resource is ”Mathematical Programming Glossary” available at

http://glossary.computing.society.informs.org

17

Page 36: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

18 CHAPTER 5. GETTING SUPPORT AND HELP

Page 37: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

Chapter 6

MOSEK / MATLAB integration

In this chapter we provide some details concerning the integration of MOSEK in MATLAB. Theinformation in this chapter is not strictly necessary for basic use of the MOSEK optimization toolboxfor MATLAB. The novice user can safely ok to the next chapter.

6.1 MOSEK replacements for MATLAB functions

MOSEK provides replacements for the MATLAB functions:

• linprog

• quadprog

• lsqlin

• lsqnonneg

• bintprog

The corresponding MATLAB file for each function is located in the toolbox/solvers directory of theMOSEK distribution. To use the MATLAB version of these functions instead of the MOSEK version,delete the MATLAB files provided by MOSEK.

6.2 The license system

By default a license token remains checked out for the duration of the MATLAB session. This canbe changed such that the license is returned after each call to MOSEK by setting the parameterMSK IPAR CACHE LICENSE.

param.MSK IPAR CACHE LICENSE = ’MSK OFF’; %set parameter.

[r,res] = mosekopt(’minimize’,prob,param); %call mosek.

19

Page 38: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

20 CHAPTER 6. MOSEK / MATLAB INTEGRATION

implies that the license is released immediately after the optimizer has terminated.

It should however be noted that there is a small overhead associated with checking out a license tokenfrom the license server.

6.2.1 Waiting for a free license

By default an error will be returned if no license token is available. By setting the parameterMSK IPAR LICENSE WAITMOSEK can be instructed to wait until a license token is available.

param.MSK IPAR LICENSE WAIT = ’MSK ON’; %set parameter.

[r,res] = mosekopt(’minimize’,prob,param); %call mosek.

6.2.2 Using MOSEK with the Parallel Computing Toolbox

Running MOSEK with the Parallel Computing Toolbox requires multiple MOSEK licenses, since eachthread runs a separate instance of the MOSEK optimizer. Each thread thus requires a MOSEK license.

Page 39: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

Chapter 7

A guided tour

7.1 Introduction

One of the big advantages of MATLAB is that it makes it very easy to do experiments and try outthings without doing a lot of programming. The MOSEK optimization toolbox has been designed withthis in mind. Hence, it should be very easy to solve optimization problems using MOSEK Moreover,a guided tour to the optimization toolbox has been designed to introduce the toolbox by examples.After having studyied these examples, the reader should be able to solve his or her own optimizationproblems without much further effort. Nevertheless, for the user interested in exploiting the toolboxto the limits, a detailed discussion and command reference are provided in the following chapters.

7.2 The tour starts

The MOSEK optimization toolbox consists of two layers of functions. The procedures in the toplayer are application specific functions which have an easy-to-use interface. Currently, there are fiveprocedures in the top layer:

msklpopt

Performs linear optimization.

mskqpopt

Performs quadratic optimization.

mskenopt

Performs entropy optimization.

mskgpopt

Performs geometric optimization (posynomial case).

21

Page 40: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

22 CHAPTER 7. A GUIDED TOUR

mskscopt

Performs separable convex optimization.

The bottom layer of the MOSEK optimization toolbox consists of one procedure named mosekopt

This procedure provides a very flexible and powerful interface to the MOSEK optimization package.However, the price for this flexibility is a more complicated calling procedure.

For compatibility with the MATLAB optimization toolbox MOSEK also provides an implementationof linprog, quadprog and so forth. For details about these functions we refer the reader to Chapter8.

In the following sections usage of the MOSEK optimization toolbox is demonstrated using examples.Most of these examples are available in

mosek\7\toolbox\examp\

7.3 The MOSEK terminology

First, some MOSEK terminology is introduced which will make the following sections easy to under-stand.

The MOSEK optimization toolbox can solve different classes of optimization problems such as linear,quadratic, conic, and mixed-integer optimization problems. Each of these problems is solved by oneof the optimizers in MOSEK Indeed MOSEK includes the following optimizers:

• Interior-point optimizer.

• Conic interior-point optimizer.

• Primal simplex optimizer.

• Mixed-integer optimizer.

Depending on the optimizer different solution types may be produced, e.g. the interior-point optimizersproduce a general interior-point solution whereas the simplex optimizer produces a basic solution.

7.4 Linear optimization

The first example is the linear optimization problem

minimize x1 + 2x2

subject to 4 ≤ x1 + x3 ≤ 6,1 ≤ x1 + x2,

0 ≤ x1, x2, x3.

(7.1)

Page 41: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

7.4. LINEAR OPTIMIZATION 23

7.4.1 Using msklpopt

A linear optimization problem such as (7.1) can be solved using the msklpopt function which is designedfor solving the problem

minimize cTxsubject to lc ≤ Ax ≤ uc,

lx ≤ x ≤ ux.(7.2)

lc and uc are called constraint bounds whereas lx and ux are variable bounds.

The first step in solving the example (7.1) is to setup the data for problem (7.2) i.e. the c, A, etc.Afterwards the problem is solved using an appropriate call to msklpopt.

[ lo1.m ]1 % lo1.m

2

3 c = [1 2 0]’;

4 a = [[1 0 1];[1 1 0]];

5 blc = [4 1]’;

6 buc = [6 inf]’;

7 blx = sparse(3,1);

8 bux = [];

9 [res] = msklpopt(c,a,blc,buc,blx,bux);

10 sol = res.sol;

11

12 % Interior-point solution.

13

14 sol.itr.xx’ % x solution.

15 sol.itr.sux’ % Dual variables corresponding to buc.

16 sol.itr.slx’ % Dual variables corresponding to blx.

17

18 % Basic solution.

19

20 sol.bas.xx’ % x solution in basic solution.

Please note that

• Infinite bounds are specified using -inf and inf. Moreover, the bux = [] means that all upperbounds ux are plus infinite.

• The [res] = msklpopt(c,a,blc,buc) call implies that the lower and upper bounds on x areminus and plus infinity respectively.

• The lines after the msklpopt call can be omitted, but the purpose of those lines is to displaydifferent parts of the solutions. The res.sol field contains one or more solutions. In this caseboth the interior-point solution (sol.itr) and the basic solution (sol.bas) are defined.

7.4.2 Using mosekopt

The msklpopt function is in fact just a wrapper around the real optimization routine mosekopt .Therefore, an alternative to using the msklpopt is to call mosekopt directly. In general, the syntax

Page 42: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

24 CHAPTER 7. A GUIDED TOUR

for a mosekopt call is

[rcode,res] = mosekopt(cmd,prob,param)

The arguments prob and param are optional. The purpose of the arguments are as follows:

cmd

string telling mosekopt what to do, e.g. ’minimize info’ tells mosekopt that the objectiveshould be minimized and information about the optimization should be returned.

prob

MATLAB structure specifying the problem that should be optimized.

param

MATLAB structure specifying parameters controlling the behavior of the MOSEK optimizer.However, in general it should not be necessary to change the parameters.

The following MATLAB commands demonstrate how to set up the prob structure for the example(7.1) and solve the problem using mosekopt

[ lo2.m ]1 % lo2.m

2

3 clear prob;

4

5 % Specify the c vector.

6 prob.c = [ 1 2 0]’;

7

8 % Specify a in sparse format.

9 subi = [1 2 2 1];

10 subj = [1 1 2 3];

11 valij = [1.0 1.0 1.0 1.0];

12

13 prob.a = sparse(subi,subj,valij);

14

15 % Specify lower bounds of the constraints.

16 prob.blc = [4.0 1.0]’;

17

18 % Specify upper bounds of the constraints.

19 prob.buc = [6.0 inf]’;

20

21 % Specify lower bounds of the variables.

22 prob.blx = sparse(3,1);

23

24 % Specify upper bounds of the variables.

25 prob.bux = []; % There are no bounds.

26

27 % Perform the optimization.

28 [r,res] = mosekopt(’minimize’,prob);

29

30 % Show the optimal x solution.

31 res.sol.bas.xx

Please note that

Page 43: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

7.5. CONVEX QUADRATIC OPTIMIZATION 25

• A MATLAB structure named prob containing all the relevant problem data is defined.

• All fields of this structure are optional except prob.a which is required to be a sparse matrix.

• Different parts of the solution can be viewed by inspecting the solution field res.sol.

7.4.3 Using linprog

MOSEK also provides a linprog function, which is compatible with the function provided by theMATLAB toolbox.

The linprog functions solves a linear optimization problem:

minimize fTxsubject to Ax ≤ b,

Bx = c,l ≤ x ≤ u,

using the syntax

[x,fval,exitflag,output,lambda] = linprog(f,A,b,B,c,l,u,x0,options)

Several control parameters can be set using the options structure, for example,

options.Write = ’test.opf’;

linprog(f,A,b,B,c,l,u,x0,options);

creates a human readable opf file of the problem, and

options.Write = ’test.task’;

linprog(f,A,b,B,c,l,u,x0,options);

creates a binary task file which can be send to MOSEK for debugging assistance or reporting errors.

Consult section (8.4) for details on using linprog and other compatibility functions.

Internally, the linprog function is just a wrapper for the mosekopt function, and is mainly intendedfor compatibility reasons; advanced features are mainly available through the mosekopt function.

7.5 Convex quadratic optimization

A frequently occurring problem type is the quadratic optimization problem which consists of mini-mizing a quadratic objective function subject to linear constraints. One example of such a problemis:

minimize x21 + 0.1x2

2 + x23 − x1x3 − x2

subject to 1 ≤ x1 + x2 + x3

x ≥ 0.(7.3)

In general, a quadratic optimization problem has the form

Page 44: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

26 CHAPTER 7. A GUIDED TOUR

minimize1

2xTQx+ cTx

subject to lc ≤ Ax, ≤ uc,lx ≤ x ≤ ux,

(7.4)

which for the example (7.3) implies that

Q =

2 0 − 10 0.2 0− 1 0 2

, c =

0− 10

, A =[

1 1 1],

and that

lc = 1, uc =∞, lx =

000

and ux =

∞∞∞

Please note the explicit 1

2 in the objective function of (7.4) which implies that diagonal elements mustbe doubled in Q, i.e. Q11 = 2, whereas the coefficient in (7.3) is 1 in front of x2

1.

7.5.1 Two important assumptions

MOSEK assumes that the Q matrix is symmetric, i.e.

Q = QT

and that Q is positive semidefinite.A matrix is positive semidefinite if the smallest eigenvalue of thematrix is nonnegative. An alternative statement of the positive semidefinite requirement is

xTQx ≥ 0, ∀x.

If Q is not positive semidefinite, then MOSEK will not produce reliable results or work at all.

One way of checking whether Q is positive semidefinite is to check whether all the eigenvalues of Qare nonnegative. The MATLAB command eig computes all eigenvalues of a matrix.

7.5.2 Using mskqpopt

The subsequent MATLAB statements solve the problem (7.3) using the mskqpoptMOSEK function

[ qo1.m ]1 % qo1.m

2

3 % Set up Q.

4 q = [[2 0 -1];[0 0.2 0];[-1 0 2]];

5

6 % Set up the linear part of the problem.

7 c = [0 -1 0]’;

Page 45: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

7.5. CONVEX QUADRATIC OPTIMIZATION 27

8 a = ones(1,3);

9 blc = [1.0];

10 buc = [inf];

11 blx = sparse(3,1);

12 bux = [];

13

14 % Optimize the problem.

15 [res] = mskqpopt(q,c,a,blc,buc,blx,bux);

16

17 % Show the primal solution.

18 res.sol.itr.xx

It should be clear that the format for calling mskqpopt is very similar to calling msklpopt except thatthe Q matrix is included as the first argument of the call. Similarly, the solution can be inspected byviewing the res.sol field.

7.5.3 Using mosekopt

The following sequence of MATLAB commands solves the quadratic optimization example by callingmosekopt directly.

[ qo2.m ]1 % qo2.m

2

3 clear prob;

4

5 % c vector.

6 prob.c = [0 -1 0]’;

7

8 % Define the data.

9

10 % First the lower triangular part of q in the objective

11 % is specified in a sparse format. The format is:

12 %

13 % Q(prob.qosubi(t),prob.qosubj(t)) = prob.qoval(t), t=1,...,4

14

15 prob.qosubi = [ 1 3 2 3]’;

16 prob.qosubj = [ 1 1 2 3]’;

17 prob.qoval = [ 2 -1 0.2 2]’;

18

19 % a, the constraint matrix

20 subi = ones(3,1);

21 subj = 1:3;

22 valij = ones(3,1);

23

24 prob.a = sparse(subi,subj,valij);

25

26 % Lower bounds of constraints.

27 prob.blc = [1.0]’;

28

29 % Upper bounds of constraints.

30 prob.buc = [inf]’;

31

32 % Lower bounds of variables.

33 prob.blx = sparse(3,1);

Page 46: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

28 CHAPTER 7. A GUIDED TOUR

34

35 % Upper bounds of variables.

36 prob.bux = []; % There are no bounds.

37

38 [r,res] = mosekopt(’minimize’,prob);

39

40 % Display return code.

41 fprintf(’Return code: %d\n’,r);42

43 % Display primal solution for the constraints.

44 res.sol.itr.xc’

45

46 % Display primal solution for the variables.

47 res.sol.itr.xx’

This sequence of commands looks much like the one that was used to solve the linear optimizationexample using mosekopt except that the definition of the Q matrix in prob. mosekopt requires thatQ is specified in a sparse format. Indeed the vectors qosubi, qosubj, and qoval are used to specifythe coefficients of Q in the objective using the principle

Qqosubi(t),qosubj(t) = qoval(t), for t = 1, . . . , length(qosubi).

An important observation is that due to Q being symmetric, only the lower triangular part of Q shouldbe specified.

7.6 Conic optimization

One way of generalizing a linear optimization problem is to include a constraint of the form

x ∈ Cin the problem definition where C is required to be a convex cone. The resulting class of problems isknown as conic optimization. MOSEK can solve a subset of all conic problems and subsequently it isdemonstrated how to solve this subset using the mosekopt toolbox function.

7.6.1 The conic optimization problem

A conic optimization problem has the following form

minimize cTx+ cf

subject to lc ≤ Ax ≤ uc,lx ≤ x ≤ ux,

x ∈ C,

(7.5)

where C must satisfy the following requirements. Let

xt ∈ Rnt

, t = 1, . . . , k

Page 47: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

7.6. CONIC OPTIMIZATION 29

be vectors comprised of parts of the decision variable vector x such that each decision variable is amember of exactly one xt vector, e.g.:

x1 =

x1

x4

x7

and x2 =

x6

x5

x3

x2

.Next, define

C :=x ∈ Rn : xt ∈ Ct, t = 1, 2, . . . , k

where Ct must have one of the following forms.

• R set:

Ct = x ∈ Rnt

.

• Quadratic cone:

Ct =

x ∈ Rnt

: x1 ≥

√√√√ nt∑j=2

x2j

.

• Rotated quadratic cone:

Ct =

x ∈ Rnt

: 2x1x2 ≥nt∑j=3

x2j , x1, x2 ≥ 0

.

A variable is by default members of the R set unless it explicitly belongs to a specific cone.

Although the cones MOSEK can handle give rise to a limi-ted class of conic pro-blems it includes linear,quadratic, quadratically constrained optimization, and other classes of nonlinear convex optimizationproblems. See Section 17.2 for a discussion.

7.6.2 Solving an example

The problem

minimize x4 + x5 + x6

subject to x1 + x2 + 2x3 = 1,x1, x2, x3 ≥ 0,

x4 ≥√x2

1 + x22,

2x5x6 ≥ x23

(7.6)

Page 48: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

30 CHAPTER 7. A GUIDED TOUR

is an example of a conic quadratic optimization problem. The problem involves some linear constraints,a quadratic cone and a rotated quadratic cone. The linear constraints are specified as if the problem wasa linear problem whereas the cones are specified using two index lists cones.subptr and cones.sub

and list of cone-type identifiers cones.type. The elements of all the cones are listed in cones.sub,and cones.subptr specifies the index of the first element in cones.sub for each cone.

The following MATLAB code demonstrates how to solve the example (7.6) using MOSEK.

[ cqo1.m ]1 % cqo1.m

2

3 clear prob;

4

5 [r, res] = mosekopt(’symbcon’);

6 % Specify the non-conic part of the problem.

7

8 prob.c = [0 0 0 1 1 1];

9 prob.a = sparse([1 1 2 0 0 0]);

10 prob.blc = 1;

11 prob.buc = 1;

12 prob.blx = [0 0 0 -inf -inf -inf];

13 prob.bux = inf*ones(6,1);

14

15 % Specify the cones.

16

17 prob.cones.type = [res.symbcon.MSK CT QUAD, res.symbcon.MSK CT RQUAD];

18 prob.cones.sub = [4, 1, 2, 5, 6, 3];

19 prob.cones.subptr = [1, 4];

20 % The field ’type’ specifies the cone types, i.e., quadratic cone

21 % or rotated quadratic cone. The keys for the two cone types are MSK CT QUAD

22 % and MSK CT RQUAD, respectively.

23 %

24 % The fields ’sub’ and ’subptr’ specify the members of the cones,

25 % i.e., the above definitions imply that

26 % x(4) >= sqrt(x(1)^2+x(2)^2) and 2 * x(5) * x(6) >= x(3)^2.

27

28 % Optimize the problem.

29

30 [r,res]=mosekopt(’minimize’,prob);

31

32 % Display the primal solution.

33

34 res.sol.itr.xx’

Note in partiucular that:

• No variable can be member of more than one cone. This is not serious restriction — see thefollowing section.

• The R set is not specified explicitly.

7.6.3 Quadratic and conic optimization

The example

Page 49: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

7.6. CONIC OPTIMIZATION 31

minimize x1 + x2 + x3

subject to x21 + x2

2 + x23 ≤ 1,

x1 + 0.5x22 + x3 ≤ 0.5

(7.7)

is not a conic quadratic optimization problem but can easily be reformulated as such.

Indeed the first constraint is equivalent to

x4 ≥√x2

1 + x22 + x2

3,

x4 = 1

where x4 is a new variable. This is a quadratic cone and a linear constraint. The second constraint in(7.7) is equivalent to

x1 + x3 + x5 = 0.5,x2 − x7 = 0,

x5 ≥ 0,x6 = 1,x2

7 ≤ 2x5x6,

because this implies that

x5 ≥ 0.5x27 = 0.5x2

2.

and that

x1 + 0.5x22 + x3 ≤ x1 + x3 + x5 = 0.5.

Please note that no variable can occur in more than one cone and therefore the additional constraint

x2 = x7

is introduced and x7 is included in the second conic constraint instead of x2. Using this ”trick” it isalways possible to obtain a formulation where no variable occurs in more than one cone.

Therefore, the example (7.7) is equivalent to the conic quadratic optimization problem

minimize x1 + x2 + x3

subject to x1 + x3 + x5 = 0.5,x2 − x7 = 0,x4 = 1,x5 ≥ 0,x6 = 1,

x4 ≥√x2

1 + x22 + x2

3,

2x5x6 ≥ x27.

This problem can be solved using MOSEK as follows:

Page 50: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

32 CHAPTER 7. A GUIDED TOUR

[ cqo2.m ]1 % cqo2.m

2

3 [r, res] = mosekopt(’symbcon’);

4

5 % Set up the non-conic part of the problem.

6 prob = [];

7 prob.c = [1 1 1 0 0 0 0]’;

8 prob.a = sparse([[1 0 1 0 1 0 0];...

9 [0 1 0 0 0 0 -1]]);

10 prob.blc = [0.5 0];

11 prob.buc = [0.5 0];

12 prob.blx = [-inf -inf -inf 1 -inf 1 -inf];

13 prob.bux = [inf inf inf 1 inf 1 inf];

14

15 % Set up the cone information.

16 prob.cones.type = [res.symbcon.MSK CT QUAD, ...

17 res.symbcon.MSK CT RQUAD];

18 prob.cones.sub = [4, 1, 2, 3, 5, 6, 7];

19 prob.cones.subptr = [1, 5];

20

21 [r,res] = mosekopt(’minimize’,prob);

22

23 % Display the solution.

24 res.sol.itr.xx’

7.6.4 Conic duality and the dual solution

The dual problem corresponding to the conic optimization problem (7.5) is given by

maximize (lc)T scl − (uc)T scu+ (lx)T sxl − (ux)T sxu + cf

subject to − y + scl − scu = 0,

AT y + sxl − sxu + sxn = c,scl , s

cu, s

xl , s

xu ≥ 0,

sxn ∈ C∗

where the dual cone C∗ is defined as follows. Let (sxn) be partitioned similar to x, i.e. if xj is a memberof xt, then (sxn)j is a member of (sxn)t as well. Now, the dual cone is defined by

C∗ :=sxn ∈ Rn

t

: (sxn)t ∈ C∗t , t = 1, . . . , k

where the type of C∗t is dependent on the type of Ct. For the cone types MOSEK can handle therelation between the primal and dual cones is given as follows:

• R set:

Ct =x ∈ Rn

t⇔ C∗t :=

s ∈ Rn

t

: s = 0.

Page 51: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

7.6. CONIC OPTIMIZATION 33

• Quadratic cone:

Ct :=

x ∈ Rnt

: x1 ≥

√√√√ nt∑j=2

x2j

⇔ C∗t = Ct.

• Rotated quadratic cone:

Ct :=

x ∈ Rnt

: 2x1x2 ≥nt∑j=3

x2j , x1, x2 ≥ 0

⇔ C∗t = Ct.

For a more detailed discussion about conic duality see Section 17.2.

7.6.4.1 How to obtain the dual solution

When solving a conic optimization problem using MOSEK, the dual solution is available. The followingMATLAB code fragment shows where the dual solution is stored.

[ cqo3.m ]1 % cqo3.m

2

3 [r,res]=mosekopt(’minimize’,prob);

4

5 % Solution record.

6 res.sol

7

8 % Dual variables for lower

9 % bounds of constraints.

10 res.sol.itr.slc’

11

12 % Dual variables for upper

13 % bounds of constraints.

14 res.sol.itr.suc’

15

16 % Dual variables for lower

17 % bounds on variables.

18 res.sol.itr.slx’

19

20 % Dual variables for upper

21 % bounds on variables.

22 res.sol.itr.sux’

23

24 % Dual variables with respect

25 % to the conic constraints.

26 res.sol.itr.snx’

7.6.5 Setting accuracy parameters for the conic optimizer

Three parameters control the accuracy of the solution obtained by the conic interior-point optimizer.The following example demonstrates which parameters should be reduced to obtain a more accurate

Page 52: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

34 CHAPTER 7. A GUIDED TOUR

solution, if required.

% How to change the parameters that controls

% the accuracy of a solution computed by the conic

% optimizer.

param = [];

% Primal feasibility tolerance for the primal solution

param.MSK DPAR INTPNT CO TOL PFEAS = 1.0e-8;

% Dual feasibility tolerance for the dual solution

param.MSK DPAR INTPNT CO TOL DFEAS = 1.0e-8;

% Relative primal-dual gap tolerance.

param.MSK DPAR INTPNT CO TOL REL GAP = 1.0e-8;

[r,res]=mosekopt(’minimize’,prob,param);

7.7 Semidefinite optimization

A further generalization of conic quadratic optimization is semidefinite optimization, where we addsymmetric positive semidefinite variables Xj ∈ S+

rj of dimension rj . An n×n matrix A is said to be

symmetric positive semidefinite if A = AT and

zTAz ≥ 0,∀z ∈ Rn,

and we write it equivalently as A 0 or A ∈ S+n , where Sn (S+

n ) is the cone of symmetric (positivesemidefinite) matrices. It is easy to verify that just as the quadratic cone

Qn = x ∈ Rn | x1 ≥ ‖x2:n‖

specifies a cone, so does the cone of symmetric positive semidefinite matrices,

S+n =

X ∈ Rn×n | X = XT , zTXz ≥ 0, ∀z ∈ Rn

which warrants the notion ”conic optimization”. Semidefinite cones are more general that both linearand quadratic cones, however. Both linear and quadratic cones can be described using semidefinitecones, although this should be avoided in practice for efficiency reasons.

7.7.1 The semidefinite optimization problem

A semidefinite optimization problem is specified in MOSEK as

Page 53: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

7.7. SEMIDEFINITE OPTIMIZATION 35

minimize

n∑j=1

cjxj +

p∑j=1

⟨Cj , Xj

⟩+ cf

subject to lci ≤n∑j=1

aijxj +

p∑j=1

⟨Aij , Xj

⟩≤ uci , i = 1, . . . ,m,

lxj ≤ xj ≤ uxj , j = 1, . . . , n,

x ∈ C, Xj ∈ S+rj , j = 1, . . . , p

where the problem has p symmetric positive semidefinite variables Xj ∈ S+rj of dimension rj with

symmetric coefficient matrices Cj ∈ Srj and Ai,j ∈ Srj . We use standard notation for the matrix innerproduct, i.e., for A,B ∈ Rm×n we have

〈A,B〉 :=

m∑i=1

n∑j=1

AijBij .

The matrices Cj , Aij ∈ Srj are specified in triplet format in MOSEK, using three arrays specifying

the subscripts and numerical values of all nonzero elements. All matrices C1, . . . , Cp are then specifiedusing four arrays barc.subj, barc.subk, barc.subl and barc.val such that

[Cbarc.subj(t)]barc.subk(t),barc.subl(t) = barc.val(t), for t = 1, . . . , length(barc.subj).

where the dimensions rj are stored in a separate array bardim. Similarly all matrices Aij are specifiedusing five arrays bara.subi, bara.subj, bara.subk, bara.subl, and bara.val such that

[Abara.subi(t),bara.subj(t)]bara.subk(t),bara.subl(t) = bara.val(t), for t = 1, . . . , length(bara.subj).

Since all Cj , Aij are asummed to be symmetric, only their lower triangular parts are specified.

7.7.2 Solving an example

The problem

minimize

⟨ 2 1 01 2 10 1 2

, X⟩ + x1

subject to

⟨ 1 0 00 1 00 0 1

, X⟩ + x1 = 1,

⟨ 1 1 11 1 11 1 1

, X⟩ + x2 + x3 = 1/2,

x1 ≥√x2

2 + x23,

X 0,

(7.8)

Page 54: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

36 CHAPTER 7. A GUIDED TOUR

is a mixed semidefinite and conic quadratic programming problem with a 3-dimensional semidefinitevariable

X =

x11 x11 x31

x21 x22 x32

x31 x32 x33

∈ S+3 ,

and a conic quadratic variable (x1, x2, x3) ∈ Q3. The objective is to minimize

2(x11 + x21 + x22 + x32 + x33) + x1,

subject to the two linear constraints

x11 + x22 + x33 + x1 = 1,

and

x11 + x22 + x33 + 2(x21 + x31 + x32) + x2 + x3 = 1/2.

The following MATLAB code demonstrates how to solve this problem using MOSEK.

[ sdo1.m ]1 function sdo1()

2 % sdo1.m

3 %

4 % Solves the mixed semidefinite and conic quadratic optimization problem

5 %

6 % minimize Tr [2, 1, 0; 1, 2, 1; 0, 1, 2]*X + x(1)

7 %

8 % subject to Tr [1, 0, 0; 0, 1, 0; 0, 0, 1]*X + x(1) = 1

9 % Tr [1, 1, 1; 1, 1, 1; 1, 1, 1]*X + x(2) + x(3) = 0.5

10 % X>=0, x(1) >= sqrt(x(2)^2 + x(3)^2)

11

12 [r, res] = mosekopt(’symbcon’);

13

14 prob.c = [1, 0, 0];

15

16 prob.bardim = [3];

17 prob.barc.subj = [1, 1, 1, 1, 1];

18 prob.barc.subk = [1, 2, 2, 3, 3];

19 prob.barc.subl = [1, 1, 2, 2, 3];

20 prob.barc.val = [2.0, 1.0, 2.0, 1.0, 2.0];

21

22 prob.blc = [1, 0.5];

23 prob.buc = [1, 0.5];

24

25 prob.a = sparse([1, 2, 2], [1, 2, 3], [1, 1, 1], 2, 3);

26 prob.bara.subi = [1, 1, 1, 2, 2, 2, 2, 2, 2];

27 prob.bara.subj = [1, 1, 1, 1, 1, 1, 1, 1, 1];

28 prob.bara.subk = [1, 2, 3, 1, 2, 3, 2, 3, 3];

29 prob.bara.subl = [1, 2, 3, 1, 1, 1, 2, 2, 3];

Page 55: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

7.8. QUADRATICALLY CONSTRAINED OPTIMIZATION 37

30 prob.bara.val = [1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0];

31

32 prob.cones.type = [res.symbcon.MSK CT QUAD];

33 prob.cones.sub = [1, 2, 3];

34 prob.cones.subptr = [1];

35

36 [r,res] = mosekopt(’minimize info’,prob);

37

38 X = zeros(3);

39 X([1,2,3,5,6,9]) = res.sol.itr.barx;

40 X = X + tril(X,-1)’;

41

42 x = res.sol.itr.xx;

The solution x is returned in res.sol.itr.xx and the numerical values of Xj are returned inres.sol.barx; the lower triangular part of each Xj is stacked column-by-column into an array, andeach array is then concatenated forming a single array res.sol.itr.barx representing X1, . . . , Xp.Similarly, the dual semidefinite variables Sj are recovered through res.sol.itr.bars.

7.7.3 Linear matrix inequalities

Linear matrix inequalities are affine matrix-valued functions of z ∈ Rn,

F (z) = F0 + z1F1 + . . . + znFn 0 (7.9)

where the coefficient Fi ∈ S+m are symmetric matrices (of order m). It is convinient to think of linear

matrix inequalities as dual constraints; if a problem contains only linear matrix inequalities, then weessentially have a problem specified in dual form. If we have a problem with both semidefinite affineequalities and linear matrix inequalities, we can convert it one with only affine equality constraints.For example, the linear matrix inequality

F (z) =

1 0 00 1 00 0 1

+ z1

0 1 01 0 00 0 0

+ z2

0 0 10 0 01 0 0

+ z3

0 0 00 0 10 1 0

0

can be rewritten as

X =

x11 x21 x31

x21 x22 x32

x31 x32 x33

0, x11 = x22 = x33 = 1,

where z1 = x21, z2 = x31 and z3 = x32.

7.8 Quadratically constrained optimization

In section (7.6) a quadratically constrained optimization problem was solved using the conic optimizer.It is also possible to solve such a problem directly. An example of such an optimization problem is

Page 56: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

38 CHAPTER 7. A GUIDED TOUR

minimize x1 + x2 + x3

subject to x21 + x2

2 + x23 ≤ 1,

x1 + 0.1x22 + x3 ≤ 0.5.

Please note that there are quadratic terms in both constraints. This problem can be solved usingmosekopt as follows:

[ qco1.m ]1 % qco1.m

2

3 clear prob;

4

5 % Specify the linear objective terms.

6 prob.c = ones(3,1);

7

8 % Specify the quadratic terms of the constraints.

9 prob.qcsubk = [1 1 1 2 ]’;

10 prob.qcsubi = [1 2 3 2 ]’;

11 prob.qcsubj = [1 2 3 2 ]’;

12 prob.qcval = [2.0 2.0 2.0 0.2]’;

13

14 % Specify the linear constraint matrix

15 prob.a = [sparse(1,3);sparse([1 0 1])];

16

17 prob.buc = [1 0.5]’;

18

19 [r,res] = mosekopt(’minimize’,prob);

20

21 % Display the solution.

22 fprintf(’\nx:’);23 fprintf(’ %-.4e’,res.sol.itr.xx’);

24 fprintf(’\n||x||: %-.4e’,norm(res.sol.itr.xx));

Note that the quadratic terms in the constraints are specified using the fields prob.qcsubk, prob.qcsubi,prob.qcsubj, and prob.qcval as follows

Qqcsubk(t)qcsubi(t),qcsubj(t)

= qcval(t), fort = 1, . . . , length(qcsubk)

where 12x

TQkx is the quadratic term in the kth constraint. Also note that only the lower triangularpart of the Qks should be specified.

7.9 Linear least squares and related norm minimization prob-lems

A frequently occurring problem in statistics and in many other areas of science is the problem

minimize ‖Fx− b‖ (7.10)

where F and b are a matrix and vector of appropriate dimensions. x is the vector decision variables.

Page 57: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

7.9. LINEAR LEAST SQUARES AND RELATED NORM MINIMIZATION PROBLEMS 39

Typically, the norm used is the 1-norm, the 2-norm, or the infinity norm.

7.9.1 The case of the 2 norm

Initially let us focus on the 2 norm. In this case (7.10) is identical to the quadratic optimizationproblem

minimize (1/2)xTFTFx+ (1/2)bT b− bTFx (7.11)

in the sense that the set of optimal solutions for the two problems coincides. This fact follows from

‖Fx− b‖ 2 = (Fx− b)T (Fx− b)xTFTFx+ bT b+ 2bTFx.

Subsequently, it is demonstrated how the quadratic optimization problem (7.11) is solved using mosekoptIn the example the problem data is read from a file, then data for the problem (7.11) is constructedand finally the problem is solved.

[ nrm1.m ]1 % nrm1.m

2

3 % Read data from ’afiro.mps’.

4 [r,res] = mosekopt(’read(afiro.mps)’);

5

6 % Get data for the problem

7 % minimize ||f x - b|| 2

8 f = res.prob.a’;

9 b = res.prob.c;

10

11 % Solve the problem

12 % minimize 0.5 xf’fx+0.5*b’*b-(f’*b)’*x

13

14 % Clear prob

15 clear prob;

16

17 % Compute the fixed term in the objective.

18 prob.cfix = 0.5*b’*b

19

20 % Create the linear objective terms

21 prob.c = -f’*b;

22

23 % Create the quadratic terms. Please note that only the lower triangular

24 % part of f’*f is used.

25 [prob.qosubi,prob.qosubj,prob.qoval] = find(sparse(tril(f’*f)))

26

27 % Obtain the matrix dimensions.

28 [m,n] = size(f);

29

30 % Specify a.

31 prob.a = sparse(0,n);

32

33 [r,res] = mosekopt(’minimize’,prob);

34

35 % The optimality conditions are f’*(f x - b) = 0.

Page 58: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

40 CHAPTER 7. A GUIDED TOUR

36 % Check if they are satisfied:

37

38 fprintf(’\nnorm(f^T(fx-b)): %e’,norm(f’*(f*res.sol.itr.xx-b)));

Often the x variables must be within some bounds or satisfy some additional linear constraints. Theserequirements can easily be incorporated into the problem (7.11). E.g. the constraint ‖x‖∞ ≤ 1 canbe modeled as follows:

[ nrm2.m ]1 % nrm2.m. Continuation of nrm1.m.

2

3 % Assume that the same objective should be

4 % minimized subject to -1 <= x <= 1

5

6 prob.blx = -ones(n,1);

7 prob.bux = ones(n,1);

8

9 [r,res] = mosekopt(’minimize’,prob);

10

11 % Check if the solution is feasible.

12 norm(res.sol.itr.xx,inf)

7.9.2 The case of the infinity norm

In some applications of the norm minimization problem (7.10) it is better to use the infinity normthan the 2 norm. However, the problem (7.10) stated as an infinity norm problem is equivalent to thelinear optimization problem

minimize τsubject to Fx+ τe− b ≥ 0,

Fx− τe− b ≤ 0,(7.12)

where e is the vector of ones of appropriate dimension. This implies that

τe ≥ Fx− bτe ≥ − (Fx− b)

and hence at optimum

τ∗ = ‖Fx∗ − b‖∞holds.

The problem (7.12) is straightforward to solve.

[ nrm3.m ]1 % nrm3.m. Continuation of nrm1.m.

2

3 % Let x(n+1) play the role as tau, then the problem is

4 % solved as follows.

5

Page 59: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

7.9. LINEAR LEAST SQUARES AND RELATED NORM MINIMIZATION PROBLEMS 41

6 clear prob;

7

8 prob.c = sparse(n+1,1,1.0,n+1,1);

9 prob.a = [[f,ones(m,1)];[f,-ones(m,1)]];

10 prob.blc = [b ; -inf*ones(m,1)];

11 prob.buc = [inf*ones(m,1); b ];

12

13 [r,res] = mosekopt(’minimize’,prob);

14

15 % The optimal objective value is given by:

16 norm(f*res.sol.itr.xx(1:n)-b,inf)

7.9.3 The case of the 1-norm

By definition, for the 1-norm we have that

‖Fx− b‖ 1 =

m∑i=1

|fi:x− bi|.

Therefore, the norm minimization problem can be formulated as follows

minimize

m∑i=1

ti

subject to |fi:x− bi| = ti, i = 1, . . . ,m,

which in turn is equivalent to

minimize

m∑i=1

ti

subject to fi:x− bi ≤ ti, i = 1, . . . ,m,− (fi:x− bi) ≤ ti, i = 1, . . . ,m.

(7.13)

The reader should verify that this is really the case.

In matrix notation this problem can be expressed as follows

minimize eT tsubject to Fx− te ≤ b,

Fx+ te ≥ b,(7.14)

where e = (1, . . . , 1)T . Next, this problem is solved.

[ nrm4.m ]1 % nrm4.m. Continuation of nrm1.m.

2

3 % Let x(n:(m+n)) play the role as t. Now,

4 % the problem can be solved as follows

5

6 clear prob;

Page 60: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

42 CHAPTER 7. A GUIDED TOUR

7

8 prob.c = [sparse(n,1) ; ones(m,1)];

9 prob.a = [[f,-speye(m)] ; [f,speye(m)]];

10 prob.blc = [-inf*ones(m,1); b];

11 prob.buc = [b ; inf*ones(m,1)];

12

13 [r,res] = mosekopt(’minimize’,prob);

14

15 % The optimal objective value is given by:

16 norm(f*res.sol.itr.xx(1:n)-b,1)

7.9.3.1 A better formulation

It is possible to improve upon the formulation of the problem (7.13). Indeed problem (7.13) is equivalentto

minimize

m∑i=1

ti

subject to fi:x− bi − ti + vi = 0, i = 1, . . . ,m,− (fi:x− bi)− ti ≤ 0, i = 1, . . . ,m,

vi ≥ 0, i = 1, . . . ,m.

(7.15)

After eliminating the t variables then this problem is equivalent to

minimize

m∑i=1

(fi:x− bi + vi)

subject to − 2(fi:x− bi)− vi ≤ 0, i = 1, . . . ,m,vi ≥ 0, i = 1, . . . ,m.

(7.16)

Please note that this problem has only half the number of general constraints than problem (7.13)since we have replaced constraints of the general form

fi:x ≤ biwith simpler constraints

vi ≥ 0

which MOSEK treats in a special and highly efficient way. Furthermore MOSEK stores only thenon-zeros in the coefficient matrix of the constraints. This implies that the problem (7.16) is likely torequire much less space than the problem (7.15).

It is left as an exercise for the reader to implement this formulation in MATLAB.

7.10 Compatibility with MATLAB Optimization Toolbox

For compatibility with the MATLAB Optimization Toolbox, MOSEK provides the following functions:

Page 61: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

7.11. MORE ABOUT SOLVING LINEAR LEAST SQUARES PROBLEMS 43

linprog

Solves linear optimization problems.

quadprog

Solves quadratic optimization problems.

lsqlin

Minimizes a least-squares objective with linear constraints.

lsqnnonneg

Minimizes a least-squares objective with nonnegativity constraints.

bintprog

Solves a linear optimization problem with binary variables.

mskoptimget

Getting an options structure for MATLAB compatible functions.

mskoptimset

Setting up an options structure for MATLAB compatible functions.

These functions are described in detail in Chapter 8. Their implementations all use mosekopt, sounless compatibility with the MATLAB Optimization Toolbox is a neccessity, using mosekopt directlyis recommended.

The functions mskoptimget and mskoptimset are only largely compatible with the MATLAB coun-terparts, optimget and optimset, so the MOSEK versions should only be used in conjuctions withthe MOSEK implementations of linprog, etc., and similarly optimget should be used in conjunctionwith the MATLAB implementations.

7.11 More about solving linear least squares problems

Linear least squares problems with and without linear side constraints appear very frequently inpractice and it is therefore important to know how such problems are solved efficiently using MOSEKNow, assume that the problem of interest is the linear least squares problem

minimize1

2‖Fx− f‖ 2

2

subject to Ax = b,lx ≤ x ≤ ux,

(7.17)

where F and A are matrices and the remaining quantities are vectors. x is the vector of decisionvariables. The problem (7.17) as stated is a convex quadratic optimization problem and can be solvedas such.

However, if F has much fewer rows than columns then it will usually be more efficient to solve theequivalent problem

Page 62: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

44 CHAPTER 7. A GUIDED TOUR

minimize1

2‖z‖ 2

2

subject to Ax = b,Fx− z = f,

lx ≤ x ≤ ux.

(7.18)

Please note that a number of new constraints and variables has been introduced which of course seemsto be disadvantageous but on the other hand the Hessian of the objective in problem (7.18) is muchsparser than in problem (7.17). Frequently this turns out to be more important for the computationalefficiency and therefore the latter formulation is usually the better one.

If F has many more rows than columns, then formulation (7.18) is not attractive whereas the cor-responding dual problem is. Using the duality theory outlined in Section 17.5.1 we obtain the dualproblem

maximize bT y + fT y

+ (lx)T sxl + (ux)T sxu

− 1

2‖z‖ 2

2

subject to AT y + FT y + sxl − sxu = 0,z − y = 0,

sxl , sxu ≥ 0

which can be simplified to

maximize bT y + fT z

+ (lx)T sxl + (ux)T sxu

− 1

2‖z‖ 2

2

subject to AT y + FT z + sxl − sxu = 0,sxl , s

xu ≥ 0

(7.19)

after eliminating the y variables. Here we use the convention that

lxj = −∞ ⇒ (sxl )j = 0anduxj =∞⇒ (sxu)j = 0.

In practice such fixed variables in sxl and sxu should be removed from the problem.

Given our assumptions the dual problem (7.19) will have much fewer constraints than the primalproblem (7.18); in general, the fewer constraints a problem contains, the more efficient MOSEK tendsto be. A question is: If the dual problem (7.19) is solved instead of the primal problem (7.18), how isthe optimal x solution obtained? It turns out that the dual variables corresponding to the constraint

AT y + FT z + sxl − sxu = 0

are the optimal x solution. Therefore, due to the fact that MOSEK always reports this informationas the

res.sol.itr.y

Page 63: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

7.11. MORE ABOUT SOLVING LINEAR LEAST SQUARES PROBLEMS 45

vector, the optimal x solution can easily be obtained.

In the following code fragment it is investigated whether it is attractive to solve the dual rather thanthe primal problem for a concrete numerical example. This example has no linear equalities and F isa 2000 by 400 matrix.

[ nrm5.m ]1 % nrm5.m

2

3 % Read data from a file.

4 [rcode,res] = mosekopt(’read(lsqpd.mps) echo(0)’);

5

6 % Define the problem data.

7 F = res.prob.a;

8 f = res.prob.blc;

9 blx = res.prob.blx;

10 bux = [];

11

12 % In this case there are no linear constraints

13 % First we solve the primal problem:

14 %

15 % minimize 0.5|| z ||^2

16 % subject to F x - z = f

17 % l <= x <= u

18

19 % Note that m>>n

20 [m,n] = size(F);

21

22 prob = [];

23

24 prob.qosubi = n+(1:m);

25 prob.qosubj = n+(1:m);

26 prob.qoval = ones(m,1);

27 prob.a = [F,-speye(m,m)];

28 prob.blc = f;

29 prob.buc = f;

30 prob.blx = [blx;-inf*ones(m,1)];

31 prob.bux = bux;

32

33

34 fprintf(’m=%d n=%d\n’,m,n);35

36 fprintf(’First try\n’);37

38 tic

39 [rcode,res] = mosekopt(’minimize echo(0)’,prob);

40

41 % Display the solution time.

42 fprintf(’Time : %-.2f\n’,toc);43

44 try

45 % x solution:

46 x = res.sol.itr.xx;

47

48 % objective value:

49 fprintf(’Objective value: %-6e\n’,norm(F*x(1:n)-f)^2);50

51 % Check feasibility.

Page 64: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

46 CHAPTER 7. A GUIDED TOUR

52 fprintf(’Feasibility : %-6e\n’,min(x(1:n)-blx(1:n)));53 catch

54 fprintf(’MSKERROR: Could not get solution’)

55 end

56

57 % Clear prob.

58 prob=[];

59

60 %

61 % Next, we solve the dual problem.

62

63 % Index of lower bounds that are finite:

64 lfin = find(blx>-inf);

65

66 % Index of upper bounds that are finite:

67 ufin = find(bux<inf);

68

69 prob.qosubi = 1:m;

70 prob.qosubj = 1:m;

71 prob.qoval = -ones(m,1);

72 prob.c = [f;blx(lfin);-bux(ufin)];

73 prob.a = [F’,...

74 sparse(lfin,(1:length(lfin))’,...

75 ones(length(lfin),1),...

76 n,length(lfin)),...

77 sparse(ufin,(1:length(ufin))’,...

78 -ones(length(ufin),1),...

79 n,length(ufin))];

80 prob.blc = sparse(n,1);

81 prob.buc = sparse(n,1);

82 prob.blx = [-inf*ones(m,1);...

83 sparse(length(lfin)+length(ufin),1)];

84 prob.bux = [];

85

86 fprintf(’\n\nSecond try\n’);87 tic

88 [rcode,res] = mosekopt(’maximize echo(0)’,prob);

89

90 % Display the solution time.

91 fprintf(’Time : %-.2f\n’,toc);92

93 try

94 % x solution:

95 x = res.sol.itr.y;

96

97 % objective value:

98 fprintf(’Objective value: %-6e\n’,...99 norm(F*x(1:n)-f)^2);

100

101 % Check feasibility.

102 fprintf(’Feasibility : %-6e\n’,...103 min(x(1:n)-blx(1:n)));

104 catch

105 fprintf(’MSKERROR: Could not get solution’)

106 end

Here is the output produced:

Page 65: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

7.11. MORE ABOUT SOLVING LINEAR LEAST SQUARES PROBLEMS 47

m=2000 n=400

First try

Time : 2.07

Objective value: 2.257945e+001

Feasibility : 1.466434e-009

Second try

Time : 0.47

Objective value: 2.257945e+001

Feasibility : 2.379134e-009

Both formulations produced a strictly feasible solution having the same objective value. Moreover,using the dual formulation leads to a reduction in the solution time by about a factor 5: In this casewe can conclude that the dual formulation is far superior to the primal formulation of the problem.

7.11.1 Using conic optimization on linear least squares problems

Linear least squares problems can also be solved using conic optimization because the linear leastsquares problem

minimize ‖Fx− f‖ 2

subject to Ax = b,lx ≤ x ≤ ux

is equivalent to

minimize tsubject to Ax = b,

Fx− z = f,lx ≤ x ≤ ux,

‖z‖ 2 ≤ t.

This problem is a conic quadratic optimization problem having one quadratic cone and the correspond-ing dual problem is

maximize bT y + fT y + (lx)T sxl − (ux)T sxusubject to AT y + FT y + sxl − sxu = 0,

− y + sz = 0,st = 1,

‖sz‖ ≤ st,sxl , s

xu ≥ 0

which can be reduced to

maximize bT y + fT sz + (lx)T sxl − (ux)T sxusubject to AT y − FT sz + sxl − sxu = 0,

st = 1,‖sz‖ ≤ st,sxl , s

xu ≥ 0.

Page 66: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

48 CHAPTER 7. A GUIDED TOUR

Often the dual problem has much fewer constraints than the primal problem. In such cases it will bemore efficient to solve the dual problem and obtain the primal solution x as the dual solution of thedual problem.

7.12 Entropy optimization

7.12.1 Using mskenopt

An entropy optimization problem has the following form

minimize

n∑j=1

djxjln(xj) + cTx

subject to lc ≤ Ax ≤ uc,0 ≤ x,

where all the components of d must be nonnegative, i.e. dj ≥ 0. An example of an entropy optimizationproblem is

minimize x1ln(x1)− x1 + x2ln(x2)subject to 1 ≤ x1 + x2 ≤ 1,

0 ≤ x1, x2.

This problem can be solved using the mskenopt command as follows

d = [1 1]’;

c = [-1 0]’;

a = [1 1];

blc = 1;

buc = 1;

[res] = mskenopt(d,c,a,blc,buc);

res.sol.itr.xx;

7.13 Geometric optimization

A so-called geometric optimization problem can be stated as follows

minimize∑k∈J0

ck∏j=1

takjj

subject to∑k∈Ji

ck∏j=1

takjj ≤ 1, i = 1, . . . ,m,

t > 0,

(7.20)

where it is assumed that

Page 67: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

7.13. GEOMETRIC OPTIMIZATION 49

∪mk=0Jk = 1, . . . , T

and if i 6= j, then

Ji ∩ Jj = ∅.

Hence, A is a T×n matrix and c is a vector of length t. In general, the problem (7.20) is very hard tosolve, but the posynomial case where

c > 0

is relatively easy. Using the variable transformation

tj = exj (7.21)

we obtain the problem

minimize∑k∈J0

ckeak:x

subject to∑k∈Ji

ckeak:x ≤ 1, i = 1, . . . ,m,

(7.22)

which is convex in x for c > 0. We apply the log function to obtain the equivalent problem

minimize log(∑k∈J0

ckeak:x)

subject to log(∑k∈Ji

ckeak:x) ≤ log(1), i = 1, . . . ,m,

(7.23)

which is also a convex optimization problem since log is strictly increasing. Hence, the problem (7.23)can be solved by MOSEK For further details about geometric optimization we refer the reader to [3].

7.13.1 Using mskgpopt

MOSEK cannot handle a geometric optimization problem directly, but the transformation (7.23) canbe solved using the MOSEK optimization toolbox function mskgpopt Please note that the solution tothe transformed problem can easily be converted into a solution to the original geometric optimizationproblem using relation (7.21).

Subsequently, we will use the example

minimize 40t−11 t−1/22 t−1

3 + 20t1t3 + 40t1t2t3

subject to1

3t−21 t−2

2 +4

3t1/22 t−1

3 ≤ 1,

0 < t1, t2, t3

Page 68: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

50 CHAPTER 7. A GUIDED TOUR

to demonstrate how a geometric optimization problem is solved using mskgpopt Please note that boththe objective and the constraint functions consist of a sum of simple terms. These terms can bespecified completely using the matrix

A =

− 1 − 0.5 − 11 0 11 1 1− 2 − 2 00 0.5 − 1

,and the vectors

c =

4020401

34

3

and map =

00011

.

The interpretation is this: Each row of A, c describes one term, e.g. the first row of A and the firstelement of c describe the first term in the objective function. The vector map indicated whether aterm belongs to the objective or to a constraint. If mapk equals zero, the kth term belongs to theobjective function, otherwise it belongs to the mapkth constraint.

The following MATLAB code demonstrates how the example is solved using mskgpopt .

[ go1.m ]1 % go1.m

2

3 c = [40 20 40 1/3 4/3]’;

4 a = sparse([[-1 -0.5 -1];[1 0 1];...

5 [1 1 1];[-2 -2 0];[0 0.5 -1]]);

6 map = [0 0 0 1 1]’;

7 [res] = mskgpopt(c,a,map);

8

9 fprintf(’\nPrimal optimal solution to original gp:’);

10 fprintf(’ %e’,exp(res.sol.itr.xx));

11 fprintf(’\n\n’);12

13 % Compute the optimal objective value and

14 % the constraint activities.

15 v = c.*exp(a*res.sol.itr.xx);

16

17 % Add appropriate terms together.

18 f = sparse(map+1,1:5,ones(size(map)))*v;

19

20 % First objective value. Then constraint values.

21 fprintf(’Objective value: %e\n’,log(f(1)));22 fprintf(’Constraint values:’);

23 fprintf(’ %e’,log(f(2:end)));

24 fprintf(’\n\n’);25

26 % Dual multipliers (should be negative)

Page 69: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

7.13. GEOMETRIC OPTIMIZATION 51

27 fprintf(’Dual variables (should be negative):’);

28 fprintf(’ %e’,res.sol.itr.y);

29 fprintf(’\n\n’);

The code also computes the objective value and the constraint values at the optimal solution. Moreover,the optimal dual Lagrange multipliers for the constraints are shown and the gradient of the Lagrangefunction at the optimal point is computed. Feasibility of the computed solution can be checked as

max(res.sol.itr.xc) < = 0.0

or equivalently

exp(max(res.sol.itr.xc)) <= 1.0

7.13.2 Comments

7.13.2.1 Solving large scale problems

If you want to solve a large problem, i.e. a problem where A has large dimensions, then A must besparse or you will run out of space. Recall that a sparse matrix contains few non-zero elements, so ifA is a sparse matrix, you should construct it using MATLAB’s sparse sparse as follows

A = sparse(subi,subj,valij);

where

asubi[k],subj[k] = valij[k].

For further details on the sparse function, please enter

help sparse

in MATLAB.

7.13.2.2 Preprocessing tip

Before solving a geometric optimization problem it is worthwhile to check if a column of the A matrixinputted to mskgpopt contains only positive elements. If this is the case, the corresponding variable tican take the value zero in the optimal solution: This may cause problems for MOSEK so it is betterto remove such variables from the problem — doing so will have no influence on the optimal solution.

7.13.2.3 Reading and writing problems to a file

The functions mskgpread and mskgpwri can used to read and write geometric programming problemsto file, see the Command Reference Chap. 8.

Page 70: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

52 CHAPTER 7. A GUIDED TOUR

7.14 Separable convex optimization

This section discusses separable convex nonlinear optimization problems. A general separable nonlinearoptimization problem can be specified as follows:

minimize f(x) + cTxsubject to g(x) +Ax− xc = 0,

lc ≤ xc ≤ uc,lx ≤ x ≤ ux,

(7.24)

where

• m is the number of constraints.

• n is the number of decision variables.

• x ∈ Rn is a vector of decision variables.

• xc ∈ Rm is a vector of slack variables.

• c ∈ Rn is the linear part of the objective function.

• A ∈ Rm×n is the constraint matrix.

• lc ∈ Rm is the lower limit on the activity for the constraints.

• uc ∈ Rm is the upper limit on the activity for the constraints.

• lx ∈ Rn is the lower limit on the activity for the variables.

• ux ∈ Rn is the upper limit on the activity for the variables.

• f : Rn → R is a nonlinear function.

• g : Rn → Rm is a nonlinear vector function.

This implies that the ith constraint essentially has the form

lci ≤ gi(x) +

n∑j=1

aijxj ≤ uci

when the xci variable has been eliminated.

The problem (7.24) must satisfy the three important requirements:

• Separability: This requirement implies that all nonlinear functions can be written on the form

f(x) =

n∑j=1

f j(xj)

Page 71: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

7.14. SEPARABLE CONVEX OPTIMIZATION 53

and

gi(x) =

n∑j=1

gji (xj).

Hence, the nonlinear functions can be written as a sum of functions which depends on only onevariable.

• Differentiability: All functions should be twice differentiable for all xj satisfying

lxj < x < uxj

if xj occurs in at least one nonlinear function. Hence, if√x2 appears in the problem, then the

lower bound on x2 should be 0.

• Convexity: The problem should be a convex optimization problem. See Section 17.5 for adiscussion of this requirement.

7.14.1 Using mskscopt

Subsequently, we will use the following example

minimize x1 − ln(x1 + 2x2)subject to x2

1 + x22 ≤ 1

(7.25)

to demonstrate solving a convex separable optimization problem using the MOSEK optimization tool-box function mskscopt First, note that the problem (7.25) is not a separable optimization problemdue to the fact that the logarithmic term in objective is not a function of a single variable. However,by introducing one additional constraint and variable the problem can be made separable as follows

minimize x1 − ln(x3)subject to x2

1 + x22 ≤ 1,

x1 + 2x2 − x3 = 0,x3 ≥ 0.

(7.26)

This problem is separable and equivalent to the previous problem. Moreover, note that all nonlinearfunctions are well defined for values of x satisfying the variable bounds strictly, i.e.

x3 > 0.

This (almost) makes sure that function evaluation errors will not occur during the optimization processsince MOSEK will only evaluate ln(x3) for x3 > 0.

When using the mskscopt function to solve problem (7.26), the linear part of the problem, such as ac and A, is specified as usual using MATLAB vectors and matrices. However, the nonlinear functionsmust be specified using five arrays which in the case of problem (7.26) can have the form

opr = [’log’; ’pow’; ’pow’];

opri = [0; 1; 1 ];

Page 72: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

54 CHAPTER 7. A GUIDED TOUR

oprj = [3; 1; 2 ];

oprf = [-1; 1; 1 ];

oprg = [0; 2; 2; ];

Hence, opr(k,:) specifies the type of a nonlinear function, opri(k) specifies in which constraint thenonlinear function should be added (zero means objective), and oprj(k) means that the nonlinearfunction should be applied to xj . Finally, oprf(k) and oprg(k) are parameters used by the mskscopt

function according to the table:

opr(k) opri(k) oprj(k) oprf(k) oprg(k) functionent i j f (not used) fxjln(xj)exp i j f g fegxj

log i j f (not used) fln(xj)pow i j f g fxgj

The i value indicates which constraint the nonlinear function belongs to. However, if i is identical tozero, then the function belongs to the objective. Using this notation a separable convex optimizationproblem can be solved with the function:

mskscopt(opr,

opri, oprj, oprf, oprg,

c, a, blc, buc, blx, bux)

All the elements for solving a separable convex nonlinear optimization problem have now been discussedand therefore we will conclude this section by showing the MATLAB code that will solve the exampleproblem (7.26).

[ sco1.m ]1 % sco1.m

2

3 % Specify the linear part of the problem.

4

5 c = [1;0;0];

6 a = sparse([[0 0 0];[1 2 -1]]);

7 blc = [-inf; 0];

8 buc = [1;0];

9 blx = [-inf;-inf;0];

10

11 % Specify the nonlinear part.

12

13 opr = [’log’; ’pow’; ’pow’];

14 opri = [0; 1; 1 ];

15 oprj = [3; 1; 2 ];

16 oprf = [-1; 1; 1 ];

17 oprg = [0; 2; 2 ];

18

19 % Call the optimizer.

20 % Note that bux is an optional parameter which should be added if the variables

21 % have an upper bound.

22

23 [res] = mskscopt(opr,opri,oprj,oprf,oprg,c,a,blc,buc,blx);

24

25

26 % Print the solution.

27 res.sol.itr.xx

Page 73: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

7.15. MIXED-INTEGER OPTIMIZATION 55

7.15 Mixed-integer optimization

Up until now it has been assumed that the variables in an optimization problem are continuous. Hence,it has been assumed that any value between the bounds on a variable is feasible. In many cases thisis not a valid assumption because some variables are integer-constrained. E.g. a variable may denotethe number of persons assigned to a given job and it may not be possible to assign a fractional person.

Using a mixed-integer optimizer MOSEK is capable of solving linear and quadratic optimization prob-lems where one or more of the variables are integer-constrained.

7.15.1 A linear mixed-integer example

Using the example

minimize − 2x1 − 3x2

subject to 195x1 + 273x2 ≤ 1365,4x1 + 40x2 ≤ 140,x1 ≤ 4,

x1, x2 ≥ 0, and integer

(7.27)

we will demonstrate how to solve an integer optimization problem using MOSEK

[ milo1.m ]1 % milo1.m

2

3 % Specify the linear problem data as if

4 % the problem is a linear optimization

5 % problem.

6

7 clear prob

8 prob.c = [-2 -3];

9 prob.a = sparse([[195 273];[4 40]]);

10 prob.blc = -[inf inf];

11 prob.buc = [1365 140];

12 prob.blx = [0 0];

13 prob.bux = [4 inf];

14

15 % Specify indexes of variables that are integer

16 % constrained.

17

18 prob.ints.sub = [1 2];

19

20 % Optimize the problem.

21 [r,res] = mosekopt(’minimize’,prob);

22

23 try

24 % Display the optimal solution.

25 res.sol.int

26 res.sol.int.xx’

27 catch

28 fprintf(’MSKERROR: Could not get solution’)

29 end

Page 74: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

56 CHAPTER 7. A GUIDED TOUR

Please note that compared to a linear optimization problem with no integer-constrained variables:

• The prob.ints.sub field is used to specify the indexes of the variables that are integer-constrained.

• The optimal integer solution is returned in the res.sol.int MATLAB structure.

MOSEK also provides a wrapper for the bintprog function found in the MATLAB optimizationtoolbox. This function solves linear problems with binary variables only (i.e., without linear variables);see the reference section for details.

7.15.2 A conic quadratic mixed-integer example

The problem

minimize x5 + x6

subject to x1 + x2 + x3 + x4 = 1,x1, x2, x3, x4 ≥ 0,

x5 ≥√x2

1 + x23,

x6 ≥√x2

2 + x24

x5, x6 integer

(7.28)

is an example of a mixed-integer conic quadratic optimization problem. It is similar to example (7.6),with the exception that x5 and x6 are restricted to integers.

The following MATLAB code demonstrates how to solve the example (7.6) using MOSEK

[ micqo1.m ]1 % micqo1.m

2

3 clear prob;

4

5 [r, res] = mosekopt(’symbcon’);

6

7 % Specify the non-confic part of the problem.

8

9 prob.c = [0 0 0 0 1 1];

10 prob.a = sparse([1 1 1 1 0 0]);

11 prob.blc = 1;

12 prob.buc = 1;

13 prob.blx = [0 0 0 0 -inf -inf];

14 prob.bux = inf*ones(6,1);

15

16 % Specify the cones.%

17 prob.cones.type = [res.symbcon.MSK CT QUAD, res.symbcon.MSK CT QUAD];

18 prob.cones.sub = [5, 3, 1, 6, 2, 4];

19 prob.cones.subptr = [1, 4];

20

21 % indices of integer variables

22 prob.ints.sub = [5 6];

23

24 % Optimize the problem.

Page 75: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

7.15. MIXED-INTEGER OPTIMIZATION 57

25

26 [r,res]=mosekopt(’minimize’,prob);

27

28 % Display the primal solution.

29

30 res.sol.int.xx’

7.15.3 Speeding up the solution of a mixed-integer problem

In general, a mixed-integer optimization problem can be very difficult to solve. Therefore, in somecases it may be necessary to improve upon the problem formulation and ”assist” the mixed-integeroptimizer.

How to obtain a good problem formulation is beyond the scope of this section and the reader is referredto [5]. However, two methods for assisting the mixed-integer optimizer are discussed subsequently.

7.15.3.1 Specifying an initial feasible solution

In many cases a good feasible integer solution to the optimization problem may be known. If thisis the case, it is worthwhile to inform the mixed-integer optimizer since this will reduce the solutionspace searched by the optimizer.

Consider the problem:

maximize 7x0 + 10x1 + x2 + 5x3

subject to x0 + x1 + x2 + x3 ≤ 2.5x3 ≥ 0

x0, x1, x2 ≥ 0 and integer,

(7.29)

where only some of the variables are integer and the remaining are continuous. A feasible solution tothis problem is:

x0 = 0, x1 = 2, x2 = 0, x3 = 0.5

The following example demonstrates how to input this initial solution to MOSEK

[ milo2.m ]1 % milo2.m

2

3 clear prob

4 clear param

5 [r,res] = mosekopt(’symbcon’);

6 sc = res.symbcon;

7

8

9 prob.c = [7 10 1 5];

10 prob.a = sparse([1 1 1 1 ]);

11 prob.blc = -[inf];

12 prob.buc = [2.5];

13 prob.blx = [0 0 0 0];

Page 76: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

58 CHAPTER 7. A GUIDED TOUR

14 prob.bux = [inf inf inf inf];

15 prob.ints.sub = [1 2 3];

16

17 prob.sol.int.xx = [0 2 0 0.5]’;

18

19 % Optionally set status keys too.

20 % prob.sol.int.skx = [sc.MSK SK SUPBAS;sc.MSK SK SUPBAS;...

21 % sc.MSK SK SUPBAS;sc.MSK SK BAS]

22 % prob.sol.int.skc = [sc.MSK SK UPR]

23

24 [r,res] = mosekopt(’maximize’,prob);

25

26 try

27 % Display the optimal solution.

28 res.sol.int.xx’

29 catch

30 fprintf(’MSKERROR: Could not get solution’)

31 end

It is also possible to specify only the values of the integer variables and then let MOSEK com-pute values for the remaining continuous variables in order to obtain a feasible solution. If theMSK IPAR MIO CONSTRUCT SOL parameter is set to MSK ON then MOSEK triesl to compute a feasi-ble solution from the specified values of the integer variables. MOSEK generates the feasible solutionby temporarily fixing all integer variables to the specified values and then optimizing the resultingcontinuous linear optimization problem. Hence, using this feature it is necessary to specify only thevalues of prob.sol.int.xx corresponding to the integer-constrained variables.

Suppose it is known that x0 = 0, x1 = 2, x2 = 0 are candidates for good integer values to our problem,then the following example demonstrates how to optimize the problem (7.28) using a feasible startingsolution generated from the integer values as x0 = 0, x1 = 2, x2 = 0.

[ milo3.m ]1 % milo3.m

2

3 [r,res] = mosekopt(’symbcon’);

4 sc = res.symbcon;

5

6 clear prob

7

8 prob.c = [7 10 1 5];

9 prob.a = sparse([1 1 1 1 ]);

10 prob.blc = -[inf];

11 prob.buc = [2.5];

12 prob.blx = [0 0 0 0];

13 prob.bux = [inf inf inf inf];

14 prob.ints.sub = [1 2 3];

15

16 % Values for the integer variables are specified.

17 prob.sol.int.xx = [0 2 0 0]’;

18

19 % Tell Mosek to construct a feasible solution from a given integer

20 % value.

21 param.MSK IPAR MIO CONSTRUCT SOL = sc.MSK ON;

22

23 [r,res] = mosekopt(’maximize’,prob,param);

Page 77: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

7.16. SENSITIVITY ANALYSIS 59

24

25 try

26 % Display the optimal solution.

27 res.sol.int.xx’

28 catch

29 fprintf(’MSKERROR: Could not get solution’)

30 end

7.16 Sensitivity analysis

Given an optimization problem it is often useful to obtain information about how the optimal objectivevalue changes when a problem parameter is perturbed. E.g. the objective function may reflect theprice of a raw material such as oil which may not be known with certainty. Therefore, it is interestingto know how the optimal objective value changes as the oil price changes.

Analyzing how the optimal objective value changes when the problem data is changed is called sensi-tivity analysis.

Consider the problem:

Minimize

1x11 + 2x12 + 5x23 + 2x24 + 1x31 + 2x33 + 1x34

subject to

x11 + x12 ≤ 400,x23 + x24 ≤ 1200,

x31 + x33 + x34 ≤ 1000,x11 + x31 = 800,

x12 = 100,x23 + x33 = 500,

x24 + x34 = 500,x11, x12, x23, x24, x31, x33, x34 ≥ 0.

The example below demonstrate how sensitivity analysis can answer questions of the type: Whathappens to the optimal solution if we decrease the upper bound of the first constraint with 1? Formore information on sensitivity analysis see Chapter 16.

[ sensitivity2.m ]1 % sensitivity2.m

2

3 % Setup problem data.

4 clear prob

5 prob.a = sparse([1, 1, 0, 0, 0, 0, 0;

6 0, 0, 1, 1, 0, 0, 0;

7 0, 0, 0, 0, 1, 1, 1;

8 1, 0, 0, 0, 1, 0, 0;

9 0, 1, 0, 0, 0, 0, 0;

10 0, 0, 1, 0, 0, 1, 0;

Page 78: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

60 CHAPTER 7. A GUIDED TOUR

11 0, 0, 0, 1, 0, 0, 1]);

12

13 prob.c = [1,2,5,2,1,2,1];

14 prob.blc = [-Inf,-Inf,-Inf,800,100,500, 500];

15 prob.buc =[400,1200,1000,800,100,500,500];

16 prob.bux(1:7) = Inf;

17 prob.blx(1:7) = 0;

18

19 % Analyze upper bound of constraint 1.

20 prob.prisen.cons.subu = [1];

21

22 [r,res] = mosekopt(’minimize echo(0)’,prob);

23 fprintf (’Optimal objective value: %e\n’,prob.c * res.sol.bas.xx );

24 fprintf(’Sensitivity results for constraint 1:’);

25 res.prisen.cons

26

27 % If we change the upper bound of constraint 1 with a

28 % value v in [res.prisen.cons.lr bu(1),res.prisen.cons.rr bu(1)]

29 % then the optimal objective changes with - v * ls bu(0)

30 % e.g. changing prob.buc(1) with -1

31 prob.buc(1) = prob.buc(1) - 1;

32 new sol predicted = prob.c * res.sol.bas.xx + 1 * res.prisen.cons.ls bu(1);

33 fprintf (’New optimal objective after changing bound predicted to:%e\n’, ...

34 new sol predicted);

35 [r,res] = mosekopt(’minimize echo(0)’,prob);

36 fprintf (’New optimal objective value: %e\n’,prob.c * res.sol.bas.xx );

The output from running the example is given below:

Optimal objective value: 3.000000e+03

Sensitivity results for constraint 1:

ans =

lr bl: []

rr bl: []

ls bl: []

rs bl: []

lr bu: -300

rr bu: 0

ls bu: 3

rs bu: 3

New optimal objective after changing bound predicted to:3.003000e+03

New optimal objective value: 3.003000e+03

7.17 Inspecting a problem

The problem analyzer (discussed in detail in Sec. 14.1) provides useful diagnostics about an optimiza-tion problem, and is a quick way to verify that a model has been specified correctly. For example,executing the command

mosekopt(’anapro’,prob)

will generate a report looking like

Page 79: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

7.17. INSPECTING A PROBLEM 61

Constraints Bounds Variables

upper bd: 19 lower bd: all cont: all

fixed : 8

-------------------------------------------------------------------------------

Objective, cx

range: min |c|: 0.00000 min |c|>0: 0.320000 max |c|: 10.0000

distrib: |c| vars

0 27

[0.32, 1) 4

[1, 10] 1

-------------------------------------------------------------------------------

Constraint matrix A has

27 rows (constraints)

32 columns (variables)

83 (9.60648%) nonzero entries (coefficients)

Row nonzeros, A i

range: min A i: 1 (3.125%) max A i: 9 (28.125%)

distrib: A i rows rows% acc%

1 2 7.41 7.41

2 16 59.26 66.67

[3, 7] 8 29.63 96.30

[8, 9] 1 3.70 100.00

Column nonzeros, A|j

range: min A|j: 1 (3.7037%) max A|j: 4 (14.8148%)

distrib: A|j cols cols% acc%

1 1 3.12 3.12

2 21 65.62 68.75

[3, 4] 10 31.25 100.00

A nonzeros, A(ij)

range: min |A(ij)|: 0.107000 max |A(ij)|: 2.42900

distrib: A(ij) coeffs

[0.107, 1) 17

[1, 2.43] 66

-------------------------------------------------------------------------------

Constraint bounds, lb <= Ax <= ub

distrib: |b| lbs ubs

0 7 20

[10, 100) 1 3

[100, 1000] 4

Variable bounds, lb <= x <= ub

distrib: |b| lbs ubs

0 32

The report provides an overview of the objective function and the number of constraints and boundsas well as sparsity information and distributions of nonzero elements.

Page 80: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

62 CHAPTER 7. A GUIDED TOUR

7.18 The solutions

Whenever an optimization problem is solved using MOSEK one or more optimal solutions are reporteddepending on which optimizer is used. These solutions are available in the

res.sol

structure, which has one or more of the subfields

res.sol.itr % Interior solution.

res.sol.bas % Basic solution.

res.sol.int % Integer solution.

The interior (point) solution is an arbitrary optimal solution which is computed using the interior-point optimizer. The basic solution is available only for linear problems and is produced by thesimplex optimizer or the basis identification process which is an add-on to the interior-point optimizer.Finally, the integer solution is available only for problems having integer-constrained variables and iscomputed using the integer optimizer. Each of the three solutions may contain one or more of thefollowing subfields:

.prosta

Problem status. See Appendix MSKprostae.

.solsta

Solution status. See Appendix MSKsolstae.

.skc

Constraint status keys. See Tablen 7.1 below.

.skx

Variable status keys. See Table 7.1 below.

.xc

Constraint activities.

.xx

Variable activities.

.y

Identical to -.slc+.suc.

.slc

Dual variables corresponding to lower constraint bounds.

.suc

Dual variables corresponding to upper constraint bounds.

.slx

Dual variables corresponding to lower variable bounds.

Page 81: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

7.19. VIEWING THE TASK INFORMATION 63

Numeric String Interpretationconstant constant code

0 UN Unknown statusMSK SK BAS 1 BS Is basicMSK SK SUPBAS 2 SB Is superbasicMSK SK LOW 3 LL Is at the lower limit (bound)MSK SK UPR 4 UL Is at the upper limit (bound)MSK SK FIX 5 EQ Lower limit is identical to upper limitMSK SK INF 6 ** Is infeasible i.e. the lower limit is

greater than the upper limit.

Table 7.1: Constraint and variable status keys.

.sux

Dual variables corresponding to upper variable bounds.

.snx

Dual variables corresponding to the conic constraints.

7.18.1 The constraint and variable status keys

In a solution both constraints and variables are assigned a status key which indicates whether theconstraint or variable is at its lower limit, its upper limit, is super basic and so forth in the optimalsolution. For interior-point solutions these status keys are only indicators which the optimizer produces.

In Table 7.1 the possible values for the status keys are shown accompanied with an interpretation ofthe key. By default the constraint and variable status keys are reported using string codes but it iseasy to have MOSEK report the numeric codes instead. Indeed in the example

% Status keys in string format.

[rcode,res]=mosekopt(’minimize statuskeys(0)’,prob);

res.sol.skc(1)

res.sol.prosta

the status keys are represented using string codes whereas in the example

% Status keys in string format.

[rcode,res]=mosekopt(’minimize statuskeys(1)’,prob);

res.sol.skc(1)

res.sol.prosta

the status keys are represented using numeric codes.

7.19 Viewing the task information

In MOSEK the optimization problem and the related instructions with respect to the optimizationprocess are called an optimization task or for short a task. Whenever MOSEK performs operations on

Page 82: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

64 CHAPTER 7. A GUIDED TOUR

a task it stores information in the task information database. Examples of information that is storedare the number of interior-point iterations performed to solve the problem and time spent doing theoptimization.

All the items stored in the task information database are listed in Appendixes MSKdinfiteme andMSKiinfiteme. It is possible to see the whole or part of the task information database from withinMATLAB.

% Solve a problem and obtain

% the task information database.

[r,res]=mosekopt(’minimize info’,prob);

% View one item

res.info.MSK IINF INTPNT ITER

% View the whole database

res.info

7.20 Inspecting and setting parameters

A large number of parameters controls the behavior of MOSEK, e.g. there is a parameter controllingwhich optimizer is used, one that limits the maximum number of iterations allowed, and several pa-rameters specifying the termination tolerance. All these parameters are stored in a database internallyin MOSEK The complete parameter database can be obtained and viewed using the commands:

[r,res]=mosekopt(’param’);

res.param

We will not describe the purpose of each parameter here but instead refer the reader to Appendix 23where all the parameters are presented in detail.

In general, it should not be necessary to change any of the parameters but if required, it is easily done.In the following example code it is demonstrated how to modify a few parameters and afterwardsperforming the optimization using these parameters.

% Obtain all symbolic constants

% defined by MOSEK.

[r,res] = mosekopt(’symbcon’);

sc = res.symbcon;

param = [];

% Basis identification is unnecessary.

param.MSK IPAR INTPNT BASIS = sc.MSK OFF;

% Alternatively you can use

%

% param.MSK IPAR INTPNT BASIS = ’MSK OFF’;

%

Page 83: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

7.21. ADVANCED START (HOT-START) 65

% Use another termination tolerance.

param.MSK DPAR INTPNT TOLRGAP = 1.0e-9;

% Perform optimization using the

% modified parameters.

[r,res] = mosekopt(’minimize’,prob,param);

7.21 Advanced start (hot-start)

In practice it frequently occurs that when an optimization problem has been solved, then the sameproblem slightly modified should be reoptimized. Moreover, if it is just a small the modification, it canbe expected that the optimal solution to the original problem is a good approximation to the modifiedproblem. Therefore, it should be efficient to start the optimization of the modified problem from theprevious optimal solution.

Currently, the interior-point optimizer in MOSEKcannot take advantage of a previous optimal solu-tion, however, the simplex optimizer can exploit any basic solution.

7.21.1 Some examples using hot-start

Using the example

minimize x1 + 2x2

subject to 4 ≤ x1 + x3 ≤ 6,1 ≤ x1 + x2,

0 ≤ x1, x2, x3

(7.30)

the hot-start facility using the simplex optimizer will be demonstrated. A quick inspection of theproblem indicates that (x1, x3) = (1, 3) is an optimal solution. Hence, it seems to be a good idea tolet the initial basis consist of x1 and x3 and all the other variables be at their lower bounds. This ideais used in the example code:

[ advs1.m ]1 % advs1.m

2

3 clear prob param bas

4

5 % Specify an initial basic solution.

6 bas.skc = [’LL’;’LL’];

7 bas.skx = [’BS’;’LL’;’BS’];

8 bas.xc = [4 1]’;

9 bas.xx = [1 3 0]’;

10

11 prob.sol.bas = bas;

12

13 % Specify the problem data.

14 prob.c = [ 1 2 0]’;

15 subi = [1 2 2 1];

Page 84: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

66 CHAPTER 7. A GUIDED TOUR

16 subj = [1 1 2 3];

17 valij = [1.0 1.0 1.0 1.0];

18 prob.a = sparse(subi,subj,valij);

19 prob.blc = [4.0 1.0]’;

20 prob.buc = [6.0 inf]’;

21 prob.blx = sparse(3,1);

22 prob.bux = [];

23

24 % Use the primal simplex optimizer.

25 param.MSK IPAR OPTIMIZER = ’MSK OPTIMIZER PRIMAL SIMPLEX’;

26 [r,res] = mosekopt(’minimize’,prob,param)

Some comments:

• In the example the dual solution is defined. This is acceptable because the primal simplexoptimizer is used for the reoptimization and it does not exploit a dual solution. In the futureMOSEK will also contain a dual simplex optimizer and if that optimizer is used, it will beimportant that a ”good” dual solution is specified.

• The status keys bas.skc and bas.skx must contain only the entries BS, EQ, LL, UL, and SB.Moreover, e.g. EQ must be specified only for a fixed constraint or variable. LL and UL can beused only for a variable that has a finite lower or upper bound respectively.

• The number of constraints and variables defined to be basic must correspond exactly to thenumber of constraints, i.e. the row dimension of A.

7.21.2 Adding a new variable

Next, assume that the problem

minimize x1 + 2x2 − x4

subject to 4 ≤ x1 + x3 + x4 ≤ 6,1 ≤ x1 + x2,

0 ≤ x1, x2, x3, x4.

(7.31)

should be solved. It is identical to the problem (7.30) except that a new variable x4 has been added.In continuation of the previous example this problem can be solved as follows (using hot-start):

[ advs2.m ]1 % advs2.m. Continuation of advs1.m.

2

3 prob.c = [prob.c;-1.0];

4 prob.a = [prob.a,sparse([1.0 0.0]’)];

5 prob.blx = sparse(4,1);

6

7 % Reuse the old optimal basic solution.

8 bas = res.sol.bas;

9

10 % Add to the status key.

11 bas.skx = [res.sol.bas.skx;’LL’];

12

Page 85: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

7.21. ADVANCED START (HOT-START) 67

13 % The new variable is at it lower bound.

14 bas.xx = [res.sol.bas.xx;0.0];

15 bas.slx = [res.sol.bas.slx;0.0];

16 bas.sux = [res.sol.bas.sux;0.0];

17

18 prob.sol.bas = bas;

19

20 [rcode,res] = mosekopt(’minimize’,prob,param);

21

22 % The new primal optimal solution

23 res.sol.bas.xx’

7.21.3 Fixing a variable

In e.g. branch-and-bound methods for integer programming problems it is necessary to reoptimize theproblem after a variable has been fixed to a value. This can easily be achieved as follows:

[ advs3.m ]1 % advs3.m. Continuation of advs2.m.

2

3 prob.blx(4) = 1;

4 prob.bux = [inf inf inf 1]’;

5

6 % Reuse the basis.

7 prob.sol.bas = res.sol.bas;

8

9 [rcode,res] = mosekopt(’minimize’,prob,param);

10

11 % Display the optimal solution.

12 res.sol.bas.xx’

The x4 variable is simply fixed at the value 1 and the problem is reoptimized. Please note that thebasis from the previous optimization can immediately be reused.

7.21.4 Adding a new constraint

Now, assume that the constraint

x1 + x2 ≥ 2

should be added to the problem and the problem should be reoptimized. The following exampledemonstrates how to do this.

[ advs4.m ]1 % advs4.m. A continuation of advs3.m.

2

3 % Modify the problem.

4 prob.a = [prob.a;sparse([1.0 1.0 0.0 0.0])];

5 prob.blc = [prob.blc;2.0];

6 prob.buc = [prob.buc;inf];

7

Page 86: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

68 CHAPTER 7. A GUIDED TOUR

8 % Obtain the previous optimal basis.

9 bas = res.sol.bas;

10

11 % Set the solution to the modified problem.

12 bas.skc = [bas.skc;’BS’];

13 bas.xc = [bas.xc;bas.xx(1)+bas.xx(2)];

14 bas.y = [bas.y;0.0];

15 bas.slc = [bas.slc;0.0];

16 bas.suc = [bas.suc;0.0];

17

18 % Reuse the basis.

19 prob.sol.bas = bas;

20

21 % Reoptimize.

22 [rcode,res] = mosekopt(’minimize’,prob,param);

23

24 res.sol.bas.xx’

Please note that the slack variable corresponding to the new constraint are declared basic. This impliesthat the new basis is nonsingular and can be reused.

7.21.5 Removing a constraint

We can remove a constraint in two ways:

• Set the bounds for the constraint to +∞ or −∞, as appropriate.

• Remove the corresponding row from prob.a, prob.c, prob.blc and prob.buc and update thebasis.

In the following example we use the latter approach to again remove the constraint x1 + x2 ≥ 2.

[ advs5.m ]1 % advs5.m. A continuation of advs4.m.

2

3 % Modify the problem.

4 prob.a = prob.a(1:end-1,:);

5 prob.blc = prob.blc(1:end-1);

6 prob.buc = prob.buc(1:end-1);

7

8 % Obtain the previous optimal basis.

9 bas = res.sol.bas;

10

11 % Set the solution to the modified problem.

12 bas.skc = bas.skc(1:end-1,:);

13 bas.xc = bas.xc(1:end-1);

14 bas.y = bas.y(1:end-1);

15 bas.slc = bas.slc(1:end-1);

16 bas.suc = bas.suc(1:end-1);

17

18 % Reuse the basis.

19 prob.sol.bas = bas;

20

21 % Reoptimize.

Page 87: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

7.21. ADVANCED START (HOT-START) 69

22 [rcode,res] = mosekopt(’minimize’,prob,param);

23

24 res.sol.bas.xx’

7.21.6 Removing a variable

Similarly we can remove a variable in two ways:

• Fixing the variable to zero.

• Remove the corresponding row from prob.a, prob.blx and prob.bux and update the basis.

The following example uses the latter approach to remove x4.

[ advs6.m ]1 % advs6.m. A continuation of advs5.m.

2

3 % Modify the problem.

4 prob.c = prob.c(1:end-1);

5 prob.a = prob.a(:,1:end-1);

6 prob.blx = prob.blx(1:end-1);

7 prob.bux = prob.bux(1:end-1);

8

9 % Obtain the previous optimal basis.

10 bas = res.sol.bas;

11

12 % Set the solution to the modified problem.

13 bas.xx = bas.xx(1:end-1);

14 bas.skx = bas.skx(1:end-1,:);

15 bas.slx = bas.slx(1:end-1);

16 bas.sux = bas.sux(1:end-1);

17

18 % Reuse the basis.

19 prob.sol.bas = bas;

20

21 % Reoptimize.

22 [rcode,res] = mosekopt(’minimize’,prob,param);

23

24 res.sol.bas.xx’

7.21.7 Using numeric values to represent status key codes

In the previous examples the constraint and variable status keys are represented using string codes.Although the status keys are easy to read they are sometimes difficult to work with in a program.Therefore, the status keys can also be represented using numeric values as demonstrated in the example:

[ sk1.m ]1 % sk1.m

2

3 % Obtain all symbolic constants

4 % defined in MOSEK.

Page 88: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

70 CHAPTER 7. A GUIDED TOUR

5

6 clear prob bas;

7

8 [r,res] = mosekopt(’symbcon’);

9 sc = res.symbcon;

10

11 % Specify an initial basic solution.

12 % Please note that symbolic constants are used.

13 % I.e. sc.MSK SK LOW instead of 4.

14 bas.skc = [sc.MSK SK LOW;sc.MSK SK LOW];

15 bas.skx = [sc.MSK SK BAS;sc.MSK SK LOW;sc.MSK SK BAS];

16 bas.xc = [4 1]’;

17 bas.xx = [1 3 0]’;

18 prob.sol.bas = bas;

19

20 % Specify the problem data.

21 prob.c = [ 1 2 0]’;

22 subi = [1 2 2 1];

23 subj = [1 1 2 3];

24 valij = [1.0 1.0 1.0 1.0];

25 prob.a = sparse(subi,subj,valij);

26 prob.blc = [4.0 1.0]’;

27 prob.buc = [6.0 inf]’;

28 prob.blx = sparse(3,1);

29 prob.bux = [];

30

31 % Use the primal simplex optimizer.

32 clear param;

33 param.MSK IPAR OPTIMIZER = sc.MSK OPTIMIZER PRIMAL SIMPLEX;

34

35 [r,res] = mosekopt(’minimize statuskeys(1)’,prob,param)

36

37 % Status keys will be numeric now i.e.

38

39 res.sol.bas.skc’

40

41 % is a vector of numeric values.

Please note that using the commands

[r,res] = mosekopt(’symbcon’);

sc = res.symbcon;

all the symbolic constants defined within MOSEK are obtained and used in the lines

bas.skc = [sc.MSK SK LOW;sc.MSK SK LOW];

bas.skx = [sc.MSK SK BAS;sc.MSK SK LOW;sc.MSK SK BAS];

These two lines are in fact equivalent to

bas.skc = [1;1];

bas.skx = [3;1;3];

However, it is not recommended to specify the constraint and variable status keys this way because itis less readable and portable. Indeed if e.g. MOSEK later changes the definition that 1 is equivalentto ‘LL’, all programs using numerical keys will be incorrect whereas using the symbolic constants theprograms remain correct.

Page 89: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

7.22. USING NAMES 71

7.22 Using names

In MOSEK it is possible to give the objective, each constraint, each variable, and each cone a name.In general such names are not really needed except in connection with reading and writing MPS files.See Section 7.23 for details.

All the names are specified in the prob.names structure.

% The problem is named.

prob.names.name = ’CQO example’;

% Objective name.

prob.names.obj = ’cost’;

% The two constraints are named.

prob.names.con1 = ’constraint 1’;

prob.names.con2 = ’constraint 2’;

% The six variables are named.

prob.names.var = cell(6,1);

for j=1:6

prob.names.varj = sprintf(’x%d’,j);

end

% Finally the two cones are named.

prob.names.cone1 = ’cone a’;

prob.names.cone2 = ’cone b’;

7.22.1 Blanks in names

Although it is allowed to use blanks (spaces) in names it is not recommended to do so except for theproblem name. In general, avoid names like ”x 1” or ”con 1”.

7.23 MPS and other file formats

An industry standard format for storing linear optimization problems in an ASCII file is the so-called MPS format. For readers not familiar with the MPS format a specification of the MPS formatsupported by MOSEK can be seen in Appendix 18.

The advantage of the MPS format is that problems stored in this format can be read by any commercialoptimization software, so it facilitates communication of optimization problems.

7.23.1 Reading an MPS file

It is possible to use mosekopt to read an MPS file containing the problem data. In this case mosekopt

reads data from an MPS file and returns both the problem data and the optimal solution, if required.

Page 90: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

72 CHAPTER 7. A GUIDED TOUR

Assume that afiro.mps is the MPS file from which mosekopt should read the problem data, then thistask is performed using the command

[r,res] = mosekopt(’read(afiro.mps’));

In this case res.prob will contain several fields with the problem data. E.g.

res.prob.c’

will display the c-vector.

The names used in the MPS file is also available in the prob.names structure.

% All names.

prob.names

% Constraint names.

prob.names.con

The quadratic terms of a problem can be accessed and displayed in a similar manner:

[ mpsrd.m ]1 % mpsrd.m

2

3 % Read data from the file wp12-20.mps.

4

5 [r,res] = mosekopt(’read(wp12-20.mps)’);

6

7 % Looking at the problem data

8 prob = res.prob;

9 clear res;

10

11 % Form the quadratic term in the objective.

12 q = sparse(prob.qosubi,prob.qosubj,prob.qoval);

13

14 % Get a graphical picture.

15 spy(q) % Notice that only the lower triangular part is defined.

7.23.2 Writing a MPS files

It is possible to write an MPS file using MOSEK. To write a problem contained in a MATLAB structureprob to the file ”datafile.mps”, use the command:

% Write the data defined by prob to an MPS file

% named datafile.mps

mosekopt(’write(datafile.mps)’,prob);

If the prob.names field is defined, MOSEK will use those names when writing the MPS file, otherwiseMOSEK will use generic (automatically generated) names.

7.23.3 Other file formats

In addition to MPS files, MOSEK supports the following file formats.

LP file format

Page 91: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

7.24. USER CALL-BACK FUNCTIONS 73

Uses an .lp extension. See Chapter 19 for details.

OPF format

Uses an .opf extension. See Chapter 20 for details.

TASK file format

Uses a .task extension. See Chapter 21 for details.

XML (OSiL) file format

Uses an .xml extension. See Chapter 22 for details.

The format is determined by the file extension, for example, an .opf file can be written as

mosekopt(’write(problem.opf)’);

7.24 User call-back functions

A call-back function is a user-defined MATLAB function to be called by MOSEK on a given event.The optimization toolbox supports two types of call-back functions which are presented below.

7.24.1 Log printing via call-back function

When using mosekopt it is possible to control the amount of information that mosekopt prints to thescreen, e.g.

[r,res] = mosekopt(’minimize echo(0)’,prob)

forces mosekopt to not print log information — the string echo(0) indicates that no output shouldbe printed during optimization. A high value in the echo(n) command, e.g. echo(3), forces MOSEKto display more log information. It is possible to redirect the MOSEK log printing almost anywhereusing a user-defined log call-back function. It works as follows. Create an m-file to handle the logoutput, similar to:

[ myprint.m ]1 function myprint(handle,str)

2 % handle: Is user defined data structure

3 % str : Is a log string.

4 %

5

6 fprintf(handle,’%s’,str);

The name and actions of the function are not important, but its argument list must be identical tothe example: It must accept two arguments. The first argument, handle, is a user-defined MATLABstructure and the second argument, str, is a text string. In the example above myprint prints thestring to a file defined by handle.

The following code fragment shows how to tell MOSEK to send log output to the myprint function.

%

Page 92: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

74 CHAPTER 7. A GUIDED TOUR

% In this example the MOSEK log info

% should be printed to the screen and to a file named

% mosek.log.

%

fid = fopen(’mosek.log’,’wt’);

callback.log = ’myprint’;

callback.loghandle = fid;

%

% The ’handle’ argument in myprint() will be identical to

% callback.loghandle when called.

%

mosekopt(’minimize’,prob,[],callback);

7.24.2 The iteration call-back function

It is possible to specify a function to be called frequently during the optimization. Typically thiscall-back function is used to display information about the optimization process or to terminate it.

The iteration call-back function has the following form:

[ myiter.m ]1 function [r] = myiter(handle,where,info)

2 % handle: Is a user-defined data structure.

3 % where : Is an integer indicating from where in the optimization

4 % process the callback was invoked.

5 % info : A MATLAB structure containing information about the state of the

6 % optimization.

7

8 r = 0; % r should always be assigned a value.

9

10 if handle.symbcon.MSK CALLBACK BEGIN INTPNT==where

11 fprintf(’Interior point optimizer started\n’);12 end

13

14

15 % Print primal objective

16 fprintf(’Interior-point primal obj.: %e\n’,info.MSK DINF INTPNT PRIMAL OBJ);

17

18 % Terminate when cputime > handle.maxtime

19 if info.MSK DINF INTPNT TIME > handle.maxtime

20 r = 1;

21 else

22 r = 0;

23 end

24

25

26 if handle.symbcon. MSK CALLBACK END INTPNT==where

27 fprintf(’Interior-point optimizer terminated\n’);28 end

The function accepts three arguments: The first argument, handle, is a user-defined MATLAB struc-

Page 93: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

7.25. THE LICENSE SYSTEM 75

ture, the second argument, where, indicates from where in the optimization process the call-back wasinvoked and the third argument, info, is a structure containing information about the process. Fordetails about info see Section 8.1.9g If the function returns a non-zero value, MOSEK will terminatethe optimization process immediately.

In order to inform MOSEK about the iteration call-back function the fields iter and iterhandle areinitialized as shown in the following example.

[r,res] = mosekopt(’symbcon’);

data.maxtime = 100.0;

data.symbcon = res.symbcon;

callback.iter = ’myiter’;

callback.iterhandle = data;

mosekopt(’minimize’,prob,[],callback);

7.25 The license system

By default a license token remains checked out for the duration of the matlab session. This canbe changed such that the license is returned after each call to mosek by setting the parameterMSK IPAR CACHE LICENSE.

param.MSK IPAR CACHE LICENSE = ’MSK OFF’; %set parameter.

[r,res] = mosekopt(’minimize’,prob,param); %call mosek.

By default an error will be returned if no license token is available. By setting the parameterMSK IPAR LICENSE WAIT mosek can be instructed to wait until a license token is available.

param.MSK IPAR LICENSE WAIT = ’MSK ON’; %set parameter.

[r,res] = mosekopt(’minimize’,prob,param); %call mosek.

7.26 Caveats using the MATLAB compiler

When using MOSEK with the MATLAB compiler it is necessary to manually

• remove mosekopt.m before compilation

• copy the mosek .mex file to the directory with MATLAB binary files

• copy the mosekopt.m file back after compilation

Page 94: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

76 CHAPTER 7. A GUIDED TOUR

Page 95: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

Chapter 8

Command reference

After studying the examples presented in the previous chapter, it should be possible to use most of thefacilities in the MOSEK optimization toolbox. A more formal specification of the main data structuresemployed by MOSEK and a command reference are provided in this chapter.

8.1 Data structures

In each of the subsequent sections the most important data structures employed by MOSEK arediscussed.

8.1.1 prob

Description:

The prob data structure is used to communicate an optimization problem to MOSEK or forMOSEK to return an optimization problem to the user. It defines an optimization problemusing a number of subfields.

Subfields:

.names

A MATLAB structure which contains the problem name, the name of the objective, and soforth. See Section 8.1.2.

.qosubi

i subscript for element qoij in Qo. See (8.3).

.qosubj

j subscript for element qoij in Qo. See (8.3).

.qoval

Numerical value for element qoij in Qo. See (8.3).

77

Page 96: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

78 CHAPTER 8. COMMAND REFERENCE

.qcsubk

k subscript for element qpij in Qp. See (8.4).

.qcsubi

i subscript for element qpij in Qp. See (8.4).

.qcsubj

j subscript for element qpij in Qp. See (8.4).

.qcval

Numerical value for element qpij in Qp. See (8.4).

.c

Linear term in the objective.

.a

The constraint matrix. It must be a sparse matrix having the number of rows andcolumns equivalent to the number of constraints and variables in the problem. This fieldshould always be defined, even if the problem does not have any constraints. In that casea sparse matrix having zero rows and the correct number of columns is the appropriatedefinition of the field.

.blc

Lower bounds of the constraints. −∞ denotes an infinite lower bound. If the field is notdefined or blc==[], then all the lower bounds are assumed to be equal to −∞.

.bardim

A list with the dimensions of the semidefinite variables.

.barc

A MATLAB structure for specifying Cj . The structure has the following subfields:

.subj

.subk

.subl

.val

See Section 8.1.4 for details on this structure.

.bara

A MATLAB structure for specifying Aij . The structure has the following subfields:

.subi

.subj

.subk

.subl

.val

See Section 8.1.5 for details on this structure.

.buc

Upper bounds of the constraints. ∞ denotes an infinite upper bound. If the field is notdefined or buc==[], then all the upper bounds are assumed to be equal to ∞.

Page 97: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

8.1. DATA STRUCTURES 79

.blx

Lower bounds on the variables. −∞ denotes an infinite lower bound. If the field is notdefined or blx==[], then all the lower bounds are assumed to be equal to −∞.

.bux

Upper bounds on the variables. ∞ denotes an infinite upper bound. If the field is notdefined or bux==[], then all the upper bounds are assumed to be equal to ∞.

.ints

A MATLAB structure which has the subfields.sub; % Required.

.pri; % Subfields.

ints.sub is a one-dimensional array containing the indexes of the integer-constrained vari-ables. Hence, ints.sub is identical to the set J in (8.2). ints.pri is also a one dimensionalarray of the same length as ints.sub. The ints.pri(k) is the branching priority assignedto variable index ints.sub(k).

.cones

A MATLAB structure defining the conic constraints (8.1). See Section 8.1.3 for details.

.sol

A MATLAB structure containing a guess on the optimal solution which some of the opti-mizers in MOSEK may exploit. See Section 8.1.6 for details on this structure.

.primalrepair

A MATLAB structure used for primal feasibility repair which can optimally contain eitherof the subfields:

.wlc

Weights for lower bounds on constraints.

.wuc

Weights for upper bounds on constraints.

.wlx

Weights for lower bounds on variables.

.wlc

Weights for upper bounds on variables.

If either of the subfields is missing, it assumed to be a vector with value 1 of appropriatedimension.

.prisen

A MATLAB structure which has the subfields:

.cons.subu

Indeces of constraints, where upper bounds are analyzed for sensitivity.

.cons.subl

Indeces of constraints, where lower bounds are analyzed for sensitivity.

.vars.subu

Indeces of variables, where upper bounds are analyzed for sensitivity.

.vars.subl

Indeces of variables, where lower bounds are analyzed for sensitivity.

Page 98: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

80 CHAPTER 8. COMMAND REFERENCE

.sub

Index of variables where coefficients are analysed for sensitivity.

Comments:

MOSEK solves linear, quadratic, quadratically constrained, and conic optimization problems.The simplest of those is a linear problem, which is posed in MOSEK as

minimize

n∑j=1

cjxj + cf

subject to lci ≤n∑j=1

aijxj ≤ uci , i = 1, . . . ,m,

lxj ≤ xj ≤ uxj , j = 1, . . . , n.

An extension is a linear conic problem where the variables can belong to quadratic or semidefinitecones. A conic problem in MOSEK has the form

minimize

n∑j=1

cjxj +

p∑j=1

⟨Cj , Xj

⟩+ cf

subject to lci ≤n∑j=1

aijxj +

p∑j=1

⟨Aij , Xj

⟩≤ uci , i = 1, . . . ,m,

lxj ≤ xj ≤ uxj , j = 1, . . . , n,

x ∈ C, Xj ∈ S+rj , j = 1, . . . , p

where the conic constraint

x ∈ C (8.1)

means that a partitioning of x belongs to a set of quadratic cones (elaborated below). Further,the problem has p symmetric positive semidefinite variables Xj ∈ S+

rj of dimension rj with

symmetric coefficient matrices Cj ∈ Srj and Ai,j ∈ Srj .Alternatively, MOSEK can solve convex quadratically constrained quadratic problems

minimize1

2

n∑i=1

n∑j=1

qoijxixj +

n∑j=1

cjxj + cf

subject to lci ≤ 1

2

n∑j=1

n∑k=1

qijkxjxk +

n∑j=1

aijxj ≤ uci , i = 1, . . . ,m,

lxj ≤ x ≤ uxj , j = 1, . . . , n.

The matrix

Qo =

qo11 · · · qo1n· · ·

q0n1 · · · qonn

Page 99: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

8.1. DATA STRUCTURES 81

must be symmetric positive semidefinite and the matrix

Qi =

qi11 · · · qi1n· · ·

qin1 · · · qinn

must be either symmetric negative semidefinite with the ith constraint

lci ≤1

2

n∑j=1

n∑k=1

qij,kxjxk +

n∑j=1

ai,jxj ,

or Qi must be symmetric positive semidefinite with the ith constraint

1

2

n∑j=1

n∑k=1

qij,kxjxk +

n∑j=1

ai,jxj ≤ uci .

Note that the if the quadratic terms Qi are absent, the problem reduces to a standard quadraticoptimization problem.

Finally, some variables may be integer-constrained, i.e.,

xj integer-constrained for all j ∈ J (8.2)

where xj (and possibly Xj) are the decision variables and all the other quantities are the param-eters of the problem and they are presented below:

• Since Qo and Qi are symmetric, only the lower triangular part should be specified.

• The coefficients cj are coefficients for the linear term cjxj in the objective.

• cf is a constant term in the objective, i.e., independent of all variables.

• The constraint matrix A is given by

A =

a11 · · · a1n

· · ·am1 · · · amn

.In MOSEK it is assumed that A is a sparse matrix, i.e. most of the coefficients in A arezero. Therefore, only non-zeros elements in A are stored and worked with. This usuallysaves a lot of storage and speeds up the computations.

• The symmetric matrices Cj are coefficient matrices for the linear term tr(CjXj) in theobjective for semidefinite problems. The matrices are specified in triplet format discardingzero elements, and since they are symmetric, only the lower triangular parts should bespecified.

• The constraint matrices Aij are symmetric matrices used in the constraints

lci ≤n∑j=1

aijxj +

p∑j=1

⟨Aij , Xj

⟩≤ uci , i = 1, . . . ,m,

Page 100: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

82 CHAPTER 8. COMMAND REFERENCE

for semidefinite problems. The matrices are specifed in triplet format discard zero elements,and since they are symmetric only the lower triangulars should be specified.

• lc specifies the lower bounds of the constraints.

• uc specifies the upper bounds of the constraints.

• lx specifies the lower bounds on the variables x.

• ux specifies the upper bounds on the variables x.

• In conic problems, a partitioning of x belongs to a set of free variables and quadratic cones.Let

xt ∈ Rnt

, t = 1, . . . , k

be vectors comprised of disjoint subsets of the decision variables x (each decision variableis a member of exactly one xt), e.g.,

x1 =

x1

x4

x7

and x2 =

x6

x5

x3

x2

.Next, define

C :=x ∈ Rn : xt ∈ Ct, t = 1, . . . , k

where Ct must have one of the following forms

– Free variables:

Ct = x ∈ Rnt

.

– Quadratic cones:

Ct =

x ∈ Rnt

: x1 ≥

√√√√ nt∑j=2

x2j

.

– Rotated quadratic cones:

Ct =

x ∈ Rnt

: 2x1x2 ≥nt∑j=3

x2j , x1, x2 ≥ 0

.

All the parameters of the optimization problem are stored using one or more subfields of the probstructure using the naming convention in Table 8.1. In Table 8.1 all the parameters are listedwith their corresponding type. The int type indicates that the field must contain an integervalue, double indicates a real number. The relationship between Qo and Qp and the subfieldsof the prob structure is as follows:

Page 101: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

8.1. DATA STRUCTURES 83

Field name Type Dimension Optional Problemparameter

qosubi int length(qoval) Yes qoijqosubj int length(qoval) Yes qoijqoval double length(qoval) Yes qoijc double n Yes cjqcsubk int length(qcval) Yes qpijqcsubi int length(qcval) Yes qpijqcsubj int length(qcval) Yes qpijqcval double length(qcval) Yes qpija Sparse matrix m×n No aijbardim int p Yes rjbarc MATLAB structure Yes Cjbara MATLAB structure Yes Aijblc double m Yes lckbuc double m Yes uckblx double n Yes lxkbux double n Yes uxkints MATLAB structure |J | Yes Jcones MATLAB cell array k Yes C

Table 8.1: The relation between fields and problem parameters.

• The quadratic terms in the objective:

qoqosubi(t),qoval(t) = qoval(t), t = 1, 2, . . . , length(qoval). (8.3)

Since Qo by assumption is symmetric, all elements are assumed to belong to the lowertriangular part. If an element is specified multiple times, the different elements are addedtogether.

• The quadratic terms in the constraints:

qqcsubk(t)qcsubi(t),qcsubj(t) = qcval(t), t = 1, 2, . . . , length(qcval). (8.4)

Since Qp by assumption is symmetric, all elements are assumed to belong to the lowertriangular part. If an element is specified multiple times, the different elements are addedtogether.

8.1.2 names

This structure is used to store all the names of individual items in the optimization problem such asthe constraints and the variables. The structure contains the subfields:

.name

Contains the problem name.

Page 102: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

84 CHAPTER 8. COMMAND REFERENCE

.obj

Contains the name of the objective.

.con

Is a MATLAB cell array where names.coni contains the name of the ith constraint.

.var

Is a MATLAB cell array where names.varj contains the name of the jth variable.

.barvar

Is a MATLAB cell array where names.barvarj contains the name of the jth semidefinitevariable.

.cone

Is a MATLAB cell array where names.conet contains the name of the tth conic constraint.

8.1.3 cones

cones is a MATLAB structure with the following subfields:

.type

cones.type is an array with the cone types for each cone; ’MSK CT QUAD’ or MSK CT RQUAD,indicating if the cone is a quadratic cone or a rotated quadratic cone.

.sub

cones.sub is an array of variable indexes specifying which variables are members of the cones.The array is a concatenation of index lists of all the cones.

.subptr

cones.sub is an array of pointers into cones.sub indicating the beginning of the different coneindex-sets.

For example the quadratic cone

x5 ≥√x2

3 + x21

and rotated quadratic cone

2x6x4 ≥ x22 + x2

7

would be specified using the two arrays

cones.type = [0, 1];

cones.sub = [5, 3, 1, 6, 4, 2, 7];

cones.subptr = [1, 4];

Alternatively, cones can be specified as a cell array with the sub-fields

Page 103: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

8.1. DATA STRUCTURES 85

.type

conesi.type contains the cone type for the ith cone; ’MSK CT QUAD’ or MSK CT RQUAD, indicat-ing if cone is a quadratic cone or a rotated quadratic cone.

.sub

conesi.sub is a list of variable indexes specifying which variables are members of the cone.

This specification is deprecated and might be removed in future versions of MOSEK.

8.1.4 barc

Together with .bardim this structure specifies the symmetric matrices Cj in the objective for semidef-inite problems.

The structure has the following fields, which must be arrays of the same length:

.subj

Semidefinite variable indices j.

.subk

Subscripts of nonzeros elements.

.subl

Subscripts of nonzeros elements.

.val

Numerical values.

The symmetric matrices are specified in block-triplet format as

[Cbarc.subj(t)]barc.subk(t),barc.subl(t) = barc.val(t), t = 1, 2, . . . , length(barc.subj).

Only the lower triangular parts of Cj are specified, i.e., it is required that

barc.subk(t) ≥ barc.subl(t), t = 1, 2, . . . , length(barc.subk),

and that

1 ≤ barc.subk(t) ≤ bardim(barc.subj(t)), t = 1, 2, . . . , length(barc.subj),

1 ≤ barc.subl(t) ≤ bardim(barc.subj(t)), t = 1, 2, . . . , length(barc.subj).

Page 104: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

86 CHAPTER 8. COMMAND REFERENCE

8.1.5 bara

Together with .bardim this structure specifies the symmetric matrices Aij in the constraints of semidef-inite problems.

The structure has the following fields, which must be arrays of the same length:

.subi

Constraint indices i.

.subj

Semidefinite variable indices j.

.subk

Subscripts of nonzeros elements.

.subl

Subscripts of nonzeros elements.

.val

Numerical values.

The symmetric matrices are specified in block-triplet format as

[Abara.subi(t),bara.subj(t)]bara.subk(t),bara.subl(t) = bara.val(t), t = 1, 2, . . . , length(bara.subi).

Only the lower triangular parts of Aij are specified, i.e., it is required that

bara.subk(t) ≥ bara.subl(t), t = 1, 2, . . . , length(bara.subk),

and that

1 ≤ bara.subk(t) ≤ bardim(bara.subj(t)), t = 1, 2, . . . , length(bara.subj),

1 ≤ bara.subl(t) ≤ bardim(bara.subj(t)), t = 1, 2, . . . , length(bara.subj).

8.1.6 sol

Description:

A MATLAB structure used to store one or more solutions to an optimization problem. Thestructure has one subfield for each possible solution type.

Subfields:

Page 105: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

8.1. DATA STRUCTURES 87

.itr

Interior (point) solution computed by the interior-point optimizer.

.bas

Basic solution computed by the simplex optimizers and basis identification procedure.

.int

Integer solution computed by the mixed-integer optimizer.

Comments:

Each of the solutions sol.itr, sol.bas, and sol.int may contain one or more of the fields:

.prosta

Problem status. See Appendix MSKprostae.

.solsta

Solution status. See Appendix MSKsolstae.

.skc

Constraint status keys. See Table 7.1.

.skx

Variable status keys. See Table 7.1.

.skn

Conic status keys. See Section 7.1.

.xc

Constraint activities, i.e., xc = Ax where x is the optimal solution.

.xx

The optimal x solution.

.barx

The optimal solution of Xj , j = 1, 2, . . . , length(bardim).

.bars

The optimal solution of Sj , j = 1, 2, . . . , length(bardim).

.y

Identical to sol.slc-sol.suc.

.slc

Dual solution corresponding to the lower constraint bo-unds.

.suc

Dual solution corresponding to the upper constraint bo-unds.

.slx

Dual solution corresponding to the lower variable bou-nds.

.sux

Dual solution corresponding to the upper variable bou-nds.

Page 106: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

88 CHAPTER 8. COMMAND REFERENCE

.snx

Dual solution corresponding to the conic constraint.

.pobjval

The primal objective value.

The fields .skn and .snx cannot occur in the .bas and .int solutions. In addition the fields .y,.slc, .suc, .slx, and .sux cannot occur in the .int solution since integer problems does nothave a well-defined dual problem, and hence no dual solution.

8.1.7 prisen

Description:

Results of the primal sensitivity analysis.

Subfields:

.cons

MATLAB structure with the subfields:

.lr bl

Left value β1 in the linearity interval for a lower bound.

.rr bl

Right value β2 in the linearity interval for a lower bound.

.ls bl

Left shadow price sl for a lower bound.

.rs bl

Right shadow price sr for a lower bound.

.lr bu

Left value β1 in the linearity interval for an upper bound.

.rr bu

Right value β2 in the linearity interval for an upper bound.

.ls bu

Left shadow price sl for an upper bound.

.rs bu

Right shadow price sr for an upper bound.

.var

MATLAB structure with the subfields:

.lr bl

Left value β1 in the linearity interval for a lower bound on a variable.

.rr bl

Right value β2 in the linearity interval for a lower bound on a variable.

.ls bl

Left shadow price sl for a lower bound on a variable.

Page 107: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

8.1. DATA STRUCTURES 89

.rs bl

Right shadow price sr for a lower bound on a variable.

.lr bu

Left value β1 in the linearity interval for an upper bound on a variable.

.rr bu

Right value β2 in the linearity interval for an upper bound on a variable.

.ls bu

Left shadow price sl for an upper bound on a variable.

.rs bu

Right shadow price sr for an upper bound on a variable.

8.1.8 duasen

Description:

Results of dual the sensitivity analysis.

Subfields:

.lr c

Left value β1 in linearity interval for an objective coefficient.

.rr c

Right value β2 in linearity interval for an objective coefficient.

.ls c

Left shadow price sl for an objective coefficient.

.rs c

Right shadow price sr for an objective coefficient.

8.1.9 info

info is a MATLAB structure containing a subfield for each item in the MOSEK optimization taskdatabase, e.g., the info.MSK DINF BI TIME field specifies the amount of time spent in the basis iden-tification in the last optimization. In Sections MSKdinfiteme and MSKiinfiteme all the items in thetask information database are listed.

8.1.10 symbcon

symbcon is a MATLAB structure containing a subfield for each MOSEK symbolic constant, e.g., thefield symbcon.MSK DINF BI TIME specifies the value of the symbolic constant ”MSK DINF BI TIME”. InAppendix 25 allthe symbolic constants are listed.

Page 108: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

90 CHAPTER 8. COMMAND REFERENCE

8.1.11 callback

callback A MATLAB structure containing the subfields (all of them are optional):

.loghandle

A MATLAB data structure or just [].

.log

The name of a user-defined function which must accept two input arguments, e.g.,

function myfunc(handle,str)

where handle will be identical to callback.handle when myfunc is called, and str is a stringof text from the log file.

.iterhandle

A MATLAB data structure or just [].

.iter

The name of a user-defined function which must accept three input arguments,

function myfunc(handle,where,info)

where handle will be identical to callback.iterhandle when myfunc is called, where indicatesthe current progress of the colver and info is the current information database. See 8.1.9 forfurther details about the info data structure.

8.2 An example of a command reference

All functions are documented using the format:

somefunction

Description:

The purpose of the function.

Syntax:

[ret1,ret2] = somefunction(arg1,arg2)

Arguments:

arg1

A description of this argument.

arg2

(Optional) A description of this argument which is optional. However, if argument 3 isspecified, this argument must be specified too.

arg3

Another useful argument.

Returns:

Page 109: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

8.3. FUNCTIONS PROVIDED BY THE MOSEK OPTIMIZATION TOOLBOX 91

ret1

A description of the first return ret1.

ret2

(Optional) A description of the second return ret2.

Comments:

Potentially some comments about the function.

Examples:

Some examples of the use of the function.

8.3 Functions provided by the MOSEK optimization toolbox

mosekopt

Description

Solves an optimization problem. Data specifying the optimization problem can either beread from a file or be inputted directly from MATLAB. It is also possible to write a fileusing mosekopt

Syntax:

[rcode,res] = mosekopt(cmd,prob,param,callback)

Arguments:

cmd

cmd is a string containing commands to MOSEK on what to do. E.g., the string‘minimize info’ means that the ob-jec-tive should be minimized, and informationabout the optimization process should be returned in res.info. The following com-mands are recognized by mosekopt

anapro

Runs the problem analyzer.

echo(n)

Controls how much information is echoed to the scre-en. Here, n must be a non-negative integer, where 0 means that no information is displayed and 3 means thatall information is displayed.

info

Return the complete task information database in res.info. This database con-tains various task specific information. See Section 8.1.9 for details the info datastructure.

param

Return the complete parameter database in res.param.

primalrepair

Performs a primal feasibility repair. See Chapter 15 for details.

maximize

Maximize the objective.

Page 110: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

92 CHAPTER 8. COMMAND REFERENCE

max

Sets the objective sense (similar to .maximize), without performing an optimiza-tion.

minimize

Minimize the objective.

min

Sets the objective sense (similar to .minimize), without performing an optimiza-tion.

nokeepenv

Delete the MOSEK environment after each run. This can increase the licensecheckout overhead significantly and is therefore only intended as a debug feature.

read(name)

Request that data is read from a file ”name”.

statuskeys(n)

Controls the format of status keys (problem status, solution status etc.) in thereturned problem, where statuskeys(0) means that all the status keys are re-turned as strings, and statuskeys(1) means that all the status keys are returnedas numeric codes.

symbcon

Return the symbcon data structure in res.symbcon. See Section 8.1.10 for detailson the symbcon data structure.

write(name)

Write problem to the file ”name”.

version

Return the MOSEK version numbers in res.version.

prob

(Optional) A MATLAB structure containing the problem data. See Table 8.1 for details.

param

(Optional) A MATLAB structure which is used to specify algorithmic parameters toMOSEK. The fields of param must be valid MOSEK parameter names. Moreover, thevalues corresponding to the fields must be of a valid type, i.e. the value of a stringparameter must be a string, the value of an integer paramter must be an integer etc.

callback

(Optional) A MATLAB structure defining call-back data and functions. See Sections7.24 and 8.1.11 for details.

Returns:

rcode

Return code. The interpretation of the value of the return code is listed in Appendix25.

res

(Optional) Solution obtained by the interior-point algorithm.

.sol

The data structure of the type sol is discussed in Section 8.1.

Page 111: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

8.3. FUNCTIONS PROVIDED BY THE MOSEK OPTIMIZATION TOOLBOX 93

.info

A MATLAB structure containing the task information database which containsvarious task related information such as the number of iterations used to solve theproblem. However, this field is only defined if info appeared in the cmd commandwhen mosekopt is invoked.

.param

A MATLAB structure which contain the complete MOSEK parameter database.However, this field is defined only if the param command is present in cmd whenmosekopt is invoked.

.prob

Contains the problem data if the problem data was read from a file.

Examples:

The following example demonstrates how to display the MOSEK parameter database andhow to use the primal simplex optimizer instead of the default optimizer.

msklpopt

mskqpopt

mskenopt

mskgpopt

mskscopt

Description

These functions provide an easy-to-use but less flexible interface than the mosekopt function.In fact these procedures is just wrappers around the mosekopt interface and they are definedin MATLAB m-files.

Syntax:

res = msklpopt(c,a,blc,buc,blx,bux,param,cmd);

res = mskqpopt(q,c,a,blc,buc,blx,bux,param,cmd);

res = mskenopt(d,c,a,blc,buc,blx,bux,param,cmd);

res = mskgpopt(d,a,map,param,cmd);

res = mskscopt(opr,opri,oprj,oprf,oprg,...

c,a,blc,buc,blx,bux,param,cmd)

Arguments:

For a description of the arguments we refer the reader to the actual m files stored in<root>\mosek\7\toolbox\matlab\solvers

Please note that the MATLAB command help,help msklpopt

will produce some usage information for the functions.

Returns:

Identical to the res structure returned by mosekopt

mskgpwri

Page 112: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

94 CHAPTER 8. COMMAND REFERENCE

Description

This function writes a Geometric Programming (gp) problem to a file in a format compatiblewith the mskexpopt command line tool.

Syntax:

res = mskgpwri(c,a,map,filename)

Arguments:

c,a,map

Data in the same format accepted by mskgpopt.

filename

The output file name.

Returns:

Nothing.

mskgpread

Description

This function reads a Geometric Programming (gp) problem from a file compatible withthe mskexpopt command line tool.

Syntax:

[c,a,map] = mskgpread (filename)

Arguments:

filename

The name of the file to read.

Returns:

c,a,map

Data in the same format accepted by mskgpopt.

8.4 MATLAB optimization toolbox compatible functions

The functions presented in this section intents to provide compatibility with the corresponding MAT-LAB optimization toolbox functions. Although they are not perfectly compatible, the differencesusually do not cause any problems.

8.4.1 Linear and quadratic optimization

linprog

Description

Solves the linear optimization problem:

Page 113: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

8.4. MATLAB OPTIMIZATION TOOLBOX COMPATIBLE FUNCTIONS 95

minimize fTxsubject to Ax ≤ b,

Bx = c,l ≤ x ≤ u.

Syntax:

[x,fval,exitflag,output,lambda]

= linprog(f,A,b,B,c,l,u,x0,options)

Syntax:

[x,fval,exitflag,output,lambda]

= linprog(problem)

Arguments:

f

The objective function.

A

Constraint matrix for the less-than equal inequalities. Use A = [] if there are noinequalities.

b

Right-hand side for the less-than equal inequalities. Use b = [] if there are no inequali-ties.

B

(Optional) Constraint matrix for the equalities. Use B = [] if there are no equalities.

c

(Optional) Right-hand side for the equalities. Use c = [] if there are no equalities.

l

(Optional) Lower bounds on the variables. Please use −∞ to represent infinite lowerbounds.

u

(Optional) Upper bounds on the variables. Please use ∞ to represent infinite upperbounds.

x0

(Optional) An initial guess for the starting point. This is only used for the primal sim-plex algorithm; For more advanced hot-starting (e.g., using dual simplex), use mosekoptdirectly.

options(Optional) An optimization options structure. See the mskoptimset function for thedefinition of the optimization options structure. linprog uses the options

.Diagnostics

.Display

.MaxIter

.Simplex

Valid values are ’on’, ’primal’ or ’dual’. If Simplex is ’on’ then MOSEK willuse either a primal or dual simplex solver (similar as specifying ’MSK OPTIMIZER FREE SIMPLEX’

Page 114: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

96 CHAPTER 8. COMMAND REFERENCE

in mosekopt; otherwise either a primal or dual simplex algorithm is used. Note,that the ’primal’ and ’dual’ values are specific for the MOSEK interface, andnot present in the standard MATLAB version.

.Write

Filename of problem file (e.g., ’prob.opf’) to be saved. This is useful for reportingbugs or problems.

problemA structure containing the fields f , A, b, B, c, l, u, x0 and options.

Returns:

x

The optimal x solution.

fval

The optimal objective value, i.e. fTx.

exitflag

A number which has the interpretation:

< 0The problem is likely to be either primal or dual infeasible.

= 0The maximum number of iterations was reached.

> 0x is an optimal solution.

output

.iterations

Number of iterations spent to reach the optimum.

.algorithm

Always defined as ’large-scale: interior-point’.

lambda

.lower

Lagrange multipliers for lower bounds l.

.upper

Lagrange multipliers for upper bounds u.

.ineqlin

Lagrange multipliers for the inequalities.

.eqlin

Lagrange multipliers for the equalities.

quadprog

Description

Solves the quadratic optimization problem:

minimize1

2xTHx+ fTx

subject to Ax ≤ b,Bx = c,

l ≤ x ≤ u.

(8.5)

Page 115: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

8.4. MATLAB OPTIMIZATION TOOLBOX COMPATIBLE FUNCTIONS 97

Syntax:

[x,fval,exitflag,output,lambda]

= quadprog(H,f,A,b,B,c,l,u,x0,options)

Arguments:

H

Hessian of the objective function. H must be a symmetric matrix. Contrary to theMATLAB optimization toolbox, MOSEK handles only the cases where H is positivesemidefinite. On the other hand MOSEK always computes a global optimum, i.e. theobjective function has to be strictly convex.

f

See (8.5) for the definition.

A

Constraint matrix for the less-than equal inequalities. Use A = [] if there are noinequalities.

b

Right-hand side for the less-than equal inequalities. Use b = [] if there are no inequali-ties.

B

(Optional) Constraint matrix for the equalities. Use B = [] if there are no equalities.

c

(Optional) Right-hand side for the equalities. Use c = [] if there are no equalities.

l

(Optional) Lower bounds on the variables. Please use −∞ to represent infinite lowerbounds.

u

(Optional) Upper bounds on the variables. Please use ∞ to represent infinite upperbounds.

x0

(Optional) An initial guess for the starting point. This information is ignored byMOSEK

options(Optional) An optimization options structure. See the mskoptimset function for thedefinition of the optimizations options structure. qu-ad-prog uses the options

.Diagnostics

.Display

.MaxIter

.Write

Returns:

x

The x solution.

fval

The optimal objective value i.e. 12x

THx+ fTx.

Page 116: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

98 CHAPTER 8. COMMAND REFERENCE

exitflag

A scalar which has the interpretation:

< 0The problem is likely to be either primal or dual infeasible.

= 0The maximum number of iterations was reached.

> 0x is an optimal solution.

output

.iterations

Number of iterations spent to reach the optimum.

.algorithm

Always defined as ’large-scale: interior-point’.

lambda

.lower

Lagrange multipliers for lower bounds l.

.upper

Lagrange multipliers for upper bounds u.

.ineqlin

Lagrange multipliers for inequalities.

.eqlin

Lagrange multipliers for equalities.

Examples:

8.4.2 Linear optimization with binary variables

bintprog

Description

Solves the binary linear optimization problem:

minimize fTxsubject to Ax ≤ b,

Bx = c,x ∈ 0, 1n

Syntax:

[x,fval,exitflag,output] = bintprog(f,A,b,B,c,x0,options)

Syntax:

[x,fval,exitflag,output] = bintprog(problem)

Arguments:

f

The objective function.

Page 117: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

8.4. MATLAB OPTIMIZATION TOOLBOX COMPATIBLE FUNCTIONS 99

A

Constraint matrix for the less-than equal inequalities. Use A = [] if there are noinequalities.

b

Right-hand side for the less-than equal inequalities. Use b = [] if there are no inequali-ties.

B

(Optional) Constraint matrix for the equalities. Use B = [] if there are no equalities.

c

(Optional) Right-hand side for the equalities. Use c = [] if there are no equalities.

x0

(Optional) A feasible starting point.

options(Optional) An optimization options structure. See the mskoptimset function for thedefinition of the optimization options structure. bintprog uses the options

.Diagnostics

.Display

.MaxTime

The maximum number of seconds in the solution-time

.MaxNodes

The maximum number of branch-and-bounds allowed

.Write

Filename of problem file to save.

problemA structure containing the fields f , A, b, B, c, x0 and options.

Returns:

x

The solution x.

fval

The objective fTx.

exitflag

A number which has the interpretation:

1The function returned an integer feasible solution.

−2The problem is infeasible.

−4maxNodes reached without converging.

−5maxTime reached without converging.

8.4.3 For linear least squares problems

lsqlin

Page 118: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

100 CHAPTER 8. COMMAND REFERENCE

Description

Solves the linear least squares problem:

minimize1

2‖Cx− d‖ 2

2

subject to Ax ≤ b,Bx = c,

l ≤ x ≤ u.

(8.6)

Syntax:

[x,resnorm,residual,exitflag,output,lambda]

= lsqlin(C,d,A,b,B,c,l,u,x0,options)

Arguments:

C

A matrix. See problem (8.6) for the purpose of the argument.

d

A vector. See problem (8.6) for the purpose of the argument.

A

Constraint matrix for the less-than equal inequalities. Use A = [] if there are noinequalities.

b

Right-hand side for the less-than equal inequalities. Use b = [] if there are no inequali-ties.

B

(Optional) Constraint matrix for the equalities. Use B = [] if there are no equalities.

c

(Optional) Right-hand side for the equalities. Use c = [] if there are no equalities.

l

(Optional) Lower bounds on the variables. Please use −∞ to represent infinite lowerbounds.

u

(Optional) Upper bounds on the variables. Please use ∞ to represent infinite lowerbounds.

x0

(Optional) An initial guess for the starting point. This information is ignored byMOSEK

options(Optional) An optimization options structure. See the function mskoptimset functionfor the definition of the optimization options structure. lsqprog uses the options

.Diagnostics

.Display

.MaxIter

.Write

Returns:

Page 119: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

8.4. MATLAB OPTIMIZATION TOOLBOX COMPATIBLE FUNCTIONS 101

x

The optimal x solution.

resnorm

The squared norm of the optimal residuals, i.e. ‖Cx− d‖ 2 evaluated at the optimalsolution.

residual

The residual Cx− d.

exitflag

A scalar which has the interpretation:

< 0The problem is likely to be either primal or dual infeasible.

= 0The maximum number of iterations was reached.

> 0x is the optimal solution.

output

.iterations

Number of iterations spent to reach the optimum.

.algorithm

Always defined as ’large-scale: interior-point’.

lambda

.lower

Lagrange multipliers for lower bounds l.

.upper

Lagrange multipliers for upper bounds u.

.ineqlin

Lagrange multipliers for inequalities.

.eqlin

Lagrange multipliers for equalities.

Examples:

lsqnonneg

Description

Solves the linear least squares problem:

minimize1

2‖Cx− d‖ 2

2

subject to x ≥ 0.(8.7)

Syntax:

[x,resnorm,residual,exitflag,output,lambda]

= lsqnonneg(C,d,x0,options)

Arguments:

Page 120: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

102 CHAPTER 8. COMMAND REFERENCE

C

See problem (8.7).

d

See problem (8.7).

x0

(Optional) An initial guess for the starting point. This information is ignored byMOSEK

options(Optional) An optimizations options structure. See the mskoptimset function for thedefinition of the optimization options structure. lsqlin uses the options

.Diagnostics

.Display

.MaxIter

.Write

Returns:

x

The x solution.

resnorm

The squared norm of the optimal residuals, i.e.

‖Cx− d‖ 2

evaluated at the optimal solution.

residual

The residual Cx− d.

exitflag

A number which has the interpretation:

< 0The problem is likely to be either primal or dual infeasible.

= 0The maximum number of iterations was reached.

> 0x is optimal solution.

output

.iterations

Number of iterations spend to reach the optimum.

.algorithm

Always defined to be ’large-scale: interior-point’.

lambda

.lower

Lagrange multipliers for lower bounds l.

.upper

Lagrange multipliers for upper bounds u.

Page 121: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

8.4. MATLAB OPTIMIZATION TOOLBOX COMPATIBLE FUNCTIONS 103

.ineqlin

Lagrange multipliers for inequalities.

.eqlin

Lagrange multipliers for equalities.

Comments:

This procedure just provides an easy interface to lsqlin. Indeed all the procedure does isto call lsqlin with the appropriate arguments.

Examples:

8.4.4 The optimization options

The procedures in the optimization toolbox accepts some options controlling, e.g., the amount ofinformation displayed or the stopping criterion.

In general, due to the fact that MOSEK and MATLAB optimization toolboxes employ different algo-rithms the toolboxes use different options. Therefore, the MOSEK optimization toolbox ignores mostof the options recognized by the MATLAB toolbox. The description of the mskoptimset function listswhich MATLAB options MOSEK recoginizes.

8.4.4.1 Viewing and modifying the optimization options

mskoptimget

Description

Obtains a value of an optimization parameter.

Syntax:

val = mskoptimget(options,param,default)

Arguments:

options

The optimization options structure.

param

Name of the optimization parameter for which the value should be obtained.

default

(Optional) If param is not defined, the value of default is returned instead.

Returns:

val

Value of the required option. If the option does not exist, then [] is returned unlessthe value ’default’ is defined in which case the default value is returned.

Comments:

See the mskoptimset function for which parameters that can be set.

Examples:

Page 122: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

104 CHAPTER 8. COMMAND REFERENCE

mskoptimset

Description

Obtains and modifies the optimization options structure. Only a subset of the fields inthe optimization structure recognized by the MATLAB optimization toolbox is recognizedby MOSEK In addition the optimization options structure can be used to modify all theMOSEK specific parameters defined in Appendix 23.

.Diagnostics

Used to control how much diagnostic information is printed. Following values areaccepted:

off

No diagnostic information is printed.

on

Diagnostic information is printed.

.Display

Defines what information is displayed. The following values are accepted:

off

No output is displayed.

iter

Some output is displayed for each iteration.

final

Only the final output is displayed.

.MaxIter

Maximum number of iterations allowed.

.Write

A filename to write the problem to. If equal to the empty string no file is written. E.gthe optionWrite(myfile.opf)

writes the file myfile.opf in the opf format.

Syntax:

options = mskoptimset(arg1,arg2,

param1,value1,

param2,value2,...)

Arguments:

arg1

(Optional) Is allowed to be any of the following two things:

Any stringThe same as using no argument.

A structureThe argument is assumed to be a structure containing options, which are copied tothe return options.

param1

(Optional) A string containing the name of a parameter that should be modified.

Page 123: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

8.4. MATLAB OPTIMIZATION TOOLBOX COMPATIBLE FUNCTIONS 105

value1

(Optional) The new value assigned to the parameter with the name param1.

param2

(Optional) Has the same interpretation as param1.

value2

(Optional) Has the same interpretation as value1.

Returns:

options

The updated optimization options structure.

Examples:

Page 124: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

106 CHAPTER 8. COMMAND REFERENCE

Page 125: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

Chapter 9

Case studies

9.1 Robust linear optimization

In most linear optimization examples discussed in this manual it is implicitly assumed that the problemdata, such as c and A, is known with certainty. However, in practice this is seldom the case, e.g. thedata may just be roughly estimated, affected by measurement errors or be affected by random events.

In this section a robust linear optimization methodology is presented which removes the assumptionthat the problem data is known exactly. Rather it is assumed that the data belongs to some set, i.e.a box or an ellipsoid.

The computations are performed using the MOSEK optimization toolbox for MATLAB but couldequally well have been implemented using the MOSEK API.

This section is co-authored with A. Ben-Tal and A. Nemirovski.

9.1.1 Introductory example

Consider the following toy-sized linear optimization problem: A company produces two kinds of drugs,DrugI and DrugII, containing a specific active agent A, which is extracted from a raw materials thatshould be purchased on the market. The drug production data are as follows:

DrugI DrugIISelling price$ per 1000 packs 6200 6900Contentof agent Agm per 100 packs 0.500 0.600Production expenses per 1000 packsManpower, hours 90.0 100.0Equipment, hours 40.0 50.0Operational cost, $ 700 800

107

Page 126: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

108 CHAPTER 9. CASE STUDIES

There are two kinds of raw materials, RawI and RawII, which can be used as sources of the activeagent. The related data is as follows:

Raw material Purchasing price, Content of agent A,$ per kg gm per kg

RawI 100.00 0.01RawII 199.90 0.02

Finally, the monthly resources dedicated to producing the drugs are as follows:

Budget, $ Manpower Equipment Capacity of raw materialshours hours storage, kg

100000 2000 800 1000

The problem is to find the production plan which maximizes the profit of the company, i.e. minimizethe purchasing and operational costs

100 · RawI + 199.90 · RawII + 700 · DrugI + 800 · DrugII

and maximize the income

6200 · DrugI + 6900 · DrugII

The problem can be stated as the following linear programming program:

Minimize

− (100 · RawI + 199.90 · RawII + 700 · DrugI + 800 · DrugII) + (6200 · DrugI + 6900 · DrugII) (9.1)

subject to

0.01 · RawI + 0.02 · RawII− 0.500 · DrugI− 0.600 · DrugII ≥ 0 (a)RawI + RawII ≤ 1000 (b)

90.0 · DrugI + 100.0 · DrugII ≤ 2000 (c)40.0 · DrugI + 50.0 · DrugII ≤ 800 (d)

100.0 · RawI + 199.90 · RawII + 700 · DrugI + 800 · DrugII ≤ 100000 (d)RawI, RawII, DrugI, DrugII ≥ 0 (e)

where the variables are the amounts RawI, RawII (in kg) of raw materials to be purchased and theamounts DrugI, DrugII (in 1000 of packs) of drugs to be produced. The objective (9.1) denotes theprofit to be maximized, and the inequalities can be interpreted as follows:

• Balance of the active agent.

• Storage restriction.

• Manpower restriction.

Page 127: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

9.1. ROBUST LINEAR OPTIMIZATION 109

• Equipment restriction.

• Ducget restriction.

Here is the MATLAB script which specifies the problem and solves it using the MOSEK optimizationtoolbox:

[ rlo1.m ]1 % rlo1.m

2

3 clear prob;

4

5 prob.c = [-100;-199.9;6200-700;6900-800];

6 prob.a = sparse([0.01,0.02,-0.500,-0.600;1,1,0,0;

7 0,0,90.0,100.0;0,0,40.0,50.0;100.0,199.9,700,800]);

8 prob.blc = [0;-inf;-inf;-inf;-inf];

9 prob.buc = [inf;1000;2000;800;100000];

10 prob.blx = [0;0;0;0];

11 prob.bux = [inf;inf;inf;inf];

12 [r,res] = mosekopt(’maximize’,prob);

13 xx = res.sol.itr.xx;

14 RawI = xx(1);

15 RawII = xx(2);

16 DrugI = xx(3);

17 DrugII = xx(4);

18

19 disp(sprintf(’*** Optimal value: %8.3f’,prob.c’*xx));

20 disp(’*** Optimal solution:’);

21 disp(sprintf(’RawI: %8.3f’,RawI));

22 disp(sprintf(’RawII: %8.3f’,RawII));

23 disp(sprintf(’DrugI: %8.3f’,DrugI));

24 disp(sprintf(’DrugII: %8.3f’,DrugII));

When executing this script, the following is displayed:

*** Optimal value: 8819.658

*** Optimal solution:

RawI: 0.000

RawII: 438.789

DrugI: 17.552

DrugII: 0.000

We see that the optimal solution promises the company a modest but quite respectful profit of 8.8%.Please note that at the optimal solution the balance constraint is active: the production process utilizesthe full amount of the active agent contained in the raw materials.

9.1.2 Data uncertainty and its consequences.

Please note that not all problem data can be regarded as ”absolutely reliable”; e.g. one can hardlybelieve that the contents of the active agent in the raw materials are exactly the ”nominal data”0.01 gm/kg for RawI and 0.02 gm/kg for RawII. In reality, these contents definitely vary around theindicated values. A natural assumption here is that the actual contents of the active agent aI inRawI and aII in RawII are realizations of random variables somehow distributed around the ”nominalcontents” an

I = 0.01 and anII = 0.02. To be more specific, assume that aI drifts in the 0.5% margin of

Page 128: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

110 CHAPTER 9. CASE STUDIES

anI , i.e. it takes with probability 0.5 the values from the interval an

I (1±0.005) = anI 0.00995; 0.01005.

Similarly, assume that aII drifts in the 2% margin of anII , taking with probabilities 0.5 the values

anII(1±0.02) = an

I 0.0196; 0.0204. How do the perturbations of the contents of the active agent affectthe production process?

The optimal solution prescribes to purchase 438.8 kg of RawII and to produce 17552 packs of DrugI.With the above random fluctuations in the content of the active agent in RawII, this production plan,with probability 0.5, will be infeasible – with this probability, the actual content of the active agent inthe raw materials will be less than required to produce the planned amount of DrugI. For the sake ofsimplicity, assume that this difficulty is resolved in the simplest way: when the actual content of theactive agent in the raw materials is insufficient, the output of the drug is reduced accordingly. Withthis policy, the actual production of DrugI becomes a random variable which takes, with probabilities0.5, the nominal value of 17552 packs and the 2% less value of 17201 packs. These 2% fluctuations inthe production affect the profit as well; the latter becomes a random variable taking, with probabilities0.5, the nominal value 8,820 and the 21% less value 6,929. The expected profit is 7,843,which is by11% less than the nominal profit 8,820 promised by the optimal solution of the problem.

We see that in our toy example that small (and in reality unavoidable) perturbations of the data maymake the optimal solution infeasible, and a straightforward adjustment to the actual solution valuesmay heavily affect the solution quality.

It turns out that the outlined phenomenon is found in many linear programs of practical origin. Usually,in these programs at least part of the data is not known exactly and can vary around its nominalvalues, and these data perturbations can make the nominal optimal solution – the one correspondingto the nominal data – infeasible. It turns out that the consequences of data uncertainty can be muchmore severe than in our toy example. The analysis of linear optimization problems from the NETLIBcollection reported in [6] demonstrates that for 13 of 94 NETLIB problems, already 0.01% perturbationsof ”clearly uncertain” data can make the nominal optimal solution severely infeasible: with theseperturbations, the solution, with a non-negligible probability, violates some of the constraints by 50%and more. It should be added that in the general case, in contrast to the toy example we haveconsidered, there is no evident way to adjust the optimal solution by a small modification to the actualvalues of the data. Moreover there are cases when such an adjustment is impossible — in order tobecome feasible for the perturbed data, the nominal optimal solution should be ”completely reshaped”.

9.1.3 Robust linear optimization methodology

A natural approach to handling data uncertainty in optimization is offered by the Robust OptimizationMethodology which, as applied to linear optimization, is as follows.

9.1.3.1 Uncertain linear programs and their robust counterparts.

Consider a linear optimization problem

minimize cTxsubject to lc ≤ Ax ≤ uc,

lx ≤ x ≤ ux,(9.2)

Page 129: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

9.1. ROBUST LINEAR OPTIMIZATION 111

with the data (c, A, lc, uc, lx, ux), and assume that this data is not known exactly; all we know is thatthe data varies in a given uncertainty set U . The simplest example is the one of interval uncertainty,where every data entry can run through a given interval:

U = (c, A, lc, uc, lx, ux) :(cn − dc,An − dA, lnc − dlc, un

c − duc, lnx − dlx, unx − dux) ≤ (c, A, lc, uc, lx, ux)

≤ (cn + dc,An + dA, lnc + dlc, unc + duc, l

nx + dlx, u

nx + dux).

(9.3)

Here

(cn, An, lnc , unc , l

nx , u

nx )

is the nominal data,

dc, dA, dlc, duc, dlx, dux ≥ 0

is the data perturbation bounds. Please note that some of the entries in the data perturbation boundscan be zero, meaning that the corresponding data entries are certain (the expected values equals theactual values).

• The family of instances (9.2) with data running through a given uncertainty set U is called anuncertain linear optimization problem.

• Vector x is called a robust feasible solution to an uncertain linear optimization problem, if itremains feasible for all realizations of the data from the uncertainty set, i.e. if

lc ≤ Ax ≤ uc, lx ≤ x ≤ uxforall(c, A, lc, uc, lx, ux) ∈ U .

• If for some value t we have cTx ≤ t for all realizations of the objective from the uncertainty set,we say that robust value of the objective at x does not exceed t.

The Robust Optimization methodology proposes to associate with an uncertain linear program itsrobust counterpart (RC) which is the problem of minimizing the robust optimal value over the set ofall robust feasible solutions, i.e. the problem

mint,xt : cTx ≤ t, lc ≤ Ax ≤ uc, lx ≤ x ≤ uxforall(c, A, lc, uc, lx, ux) ∈ U

. (9.4)

The optimal solution to (9.4) is treated as the ”uncertainty-immuned” solution to the original uncertainlinear programming program.

9.1.3.2 Robust counterpart of an uncertain linear optimization problem with intervaluncertainty

In general, the RC (9.4) of an uncertain linear optimization problem is not a linear optimizationproblem since(9.4) has infinitely many linear constraints. There are, however, cases when (9.4) can

Page 130: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

112 CHAPTER 9. CASE STUDIES

be rewritten equivalently as a linear programming program; in particular, this is the case for intervaluncertainty (9.3). Specifically, in the case of (9.3), the robust counterpart of uncertain linear programis equivalent to the following linear program in variables x, y, t:

minimize t

subject to (cn)Tx+ (dc)T y − t ≤ 0, (a)lnc + dlc ≤ (An)x− (dA)y, (b)

(An)x+ (dA)y ≤ unc − duc, (c)

0 ≤ x+ y, (d)0 ≤ − x+ y, (e)

lnx + dlx ≤ x ≤ unx − dux, (f)

(9.5)

The origin of (9.5) is quite transparent: The constraints (9.5.d − e) linking x and y merely say thatyi ≥ |xi| for all i. With this in mind, it is evident that at every feasible solution to (9.5) the entries inthe vector

(An)x− (dA)y

are lower bounds on the entries of Ax with A from the uncertainty set (9.3), so that (9.5.b) ensuresthat lc ≤ Ax for all data from the uncertainty set. Similarly, (9.5.c) and (9.5.a), (9.5.f) ensure, for alldata from the uncertainty set, that Ax ≤ uc, c

Tx ≤ t, and that the entries in x satisfy the requiredlower and upper bounds, respectively.

Please note that at the optimal solution to (9.5), one clearly has yj = |xj |. It follows that when thebounds on the entries of x impose nonnegativity (nonpositivity) of an entry xj , then there is no needto introduce the corresponding additional variable yi — from the very beginning it can be replacedwith xj , if xj is nonnegative, or with −xj , if xj is nonpositive.

Another possible formulation of problem (9.5) is the following. Let

lnc + dlc = (An)x− (dA)y − f, f ≥ 0

then this equation is equivalent to (a) in (9.5.b). If (lc)i = −∞, then equation i should be droppedfrom the computations. Similarly,

−x+ y = g ≥ 0

is equivalent to (9.5.d). This implies that

lnc + dlc − (An)x+ f = −(dA)y

and that

y = g + x

Substituting these values into (9.5) gives

Page 131: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

9.1. ROBUST LINEAR OPTIMIZATION 113

minimize t

subject to (cn)Tx+ (dc)T (g + x)− t ≤ 0,0 ≤ f,

2(An)x+ (dA)(g + x) + f + lnc + dlc ≤ unc − duc,

0 ≤ g,0 ≤ 2x+ g,

lnx + dlx ≤ x ≤ unx − dux,

which after some simplifications leads to

minimize t

subject to (cn + dc)Tx+ (dc)T g − t ≤ 0, (a)0 ≤ f, (b)

2(An + dA)x+ (dA)g + f − (lnc + dlc) ≤ unc − duc, (c)

0 ≤ g, (d)0 ≤ 2x+ g, (e)

lnx + dlx ≤ x ≤ unx − dux, (f)

and

minimize t

subject to (cn + dc)Tx+ (dc)T g − t ≤ 0, (a)2(An + dA)x+ (dA)g + f ≤ un

c − duc + lnc + dlc, (b)0 ≤ 2x+ g, (c)0 ≤ f, (d)0 ≤ g, (e)

lnx + dlx ≤ x ≤ unx − dux. (f)

(9.6)

Please note that this problem has more variables but much fewer constraints than (9.5). Therefore,(9.6) is likely to be solved faster than (9.5). Note too that (9.6.b) is trivially redundant if lnx +dlx ≥ 0.

9.1.3.3 Introductory example (continued)

Let us apply the Robust Optimization methodology to our drug production example presented inSection 9.1.1, assuming that the only uncertain data is the contents of the active agent in the rawmaterials, and that these contents vary in 0.5% and 2% neighborhoods of the respective nominalvalues 0.01 and 0.02. With this assumption, the problem becomes an uncertain LP affected by intervaluncertainty; the robust counterpart (9.5) of this uncertain LP is the linear program

Page 132: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

114 CHAPTER 9. CASE STUDIES

(Drug RC) :maximize

tsubject to

t ≤ − 100 · RawI− 199.9 · RawII + 5500 · DrugI + 6100 · DrugII0.01 · 0.995 · RawI + 0.02 · 0.98 · RawII− 0.500 · DrugI− 0.600 · DrugII ≥ 0

RawI + RawII ≤ 100090.0 · DrugI + 100.0 · DrugII ≤ 200040.0 · DrugI + 50.0 · DrugII ≤ 800

100.0 · RawI + 199.90 · RawII + 700 · DrugI + 800 · DrugII ≤ 100000RawI, RawII, DrugI, DrugII ≥ 0

Solving this problem with MOSEK we get the following output:

*** Optimal value: 8294.567

*** Optimal solution:

RawI: 877.732

RawII: 0.000

DrugI: 17.467

DrugII: 0.000

We see that the robust optimal solution we have built ”costs money” – it promises a profit of just $8,295 (cf. with the profit of $ 8,820 promised by the nominal optimal solution). Please note, however,that the robust optimal solution remains feasible whatever are the realizations of the uncertain datafrom the uncertainty set in question, while the nominal optimal solution requires adjustment to thisdata and, with this adjustment, results in the average profit of $ 7,843, which is by 5.4% less than theprofit of $ 8,295 guaranteed by the robust optimal solution. Note too that the robust optimal solutionis significantly different from the nominal one: both solutions prescribe to produce the same drugDrugI (in the amounts 17,467 and 17,552 packs, respectively) but from different raw materials, RawIin the case of the robust solution and RawII in the case of the nominal solution. The reason is thatalthough the price per unit of the active agent for RawII is sligthly less than for RawI, the content ofthe agent in RawI is more stable, so when possible fluctuations of the contents are taken into account,RawI turns out to be more profitable than RawII.

9.1.4 Random uncertainty and ellipsoidal robust counterpart

In some cases, it is natural to assume that the perturbations affecting different uncertain data entriesare random and independent of each other. In these cases, the robust counterpart based on the intervalmodel of uncertainty seems to be too conservative: Why should we expect that all the data will besimultaneously driven to its most unfavorable values and immune the solution against this highlyunlikely situation? A less conservative approach is offered by the ellipsoidal model of uncertainty. Tomotivate this model, let us seseee what happens with a particular linear constraint

aTx ≤ b (9.7)

at a given candidate solution x in the case when the vector a of coefficients of the constraint is affectedby random perturbations:

Page 133: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

9.1. ROBUST LINEAR OPTIMIZATION 115

a = an + ζ, (9.8)

where an is the vector of nominal coefficients and ζ is a random perturbation vector with zero meanand covariance matrix Va. In this case the value of the left-hand side of (9.7), evaluated at a given x,

becomes a random variable with the expected value (an)Tx and the standard deviation√xTVax. Now

let us act as an engineer who believes that the value of a random variable never exceeds its mean plus3 times the standard deviation; we do not intend to be that specific and replace ”3” in the above ruleby a safety parameter Ω which will be in our control. Believing that the value of a random variable”never” exceeds its mean plus Ω times the standard deviation, we conclude that a ”safe” version of(9.7) is the inequality

(an)Tx+ Ω√xTVax ≤ b. (9.9)

The word ”safe” above admits a quantitative interpretation: If x satisfies (9.9), one can bound fromabove the probability of the event that random perturbations (9.8) result in violating the constraint(9.7) evaluated at x. The bound in question depends on what we know about the distribution of ζ,e.g.

• We always have the bound given by the Tschebyshev inequality: x satisfies (9.9)⇒

ProbaTx > b

≤ 1

Ω2. (9.10)

• When ζ is Gaussian, then the Tschebyshev bound can be improved to: x satisfies (9.9)⇒

ProbaTx > b

≤ 1√

∫ ∞Ω

exp−t2/2dt ≤ 0.5exp−Ω2/2. (9.11)

• Assume that ζ = Dξ, where ∆ is certain n×m matrix, and ξ = (ξ1, ..., ξm)T is a random vectorwith independent coordinates ξ1, ..., ξm symmetrically distributed in the segment [−1, 1]. SettingV = DDT (V is a natural ”upper bound” on the covariance matrix of ζ), one has: x satisfies(9.9)⇒

ProbaTx > b

≤ 0.5exp−Ω2/2. (9.12)

Please note that in order to ensure the bounds in (9.11) and (9.12) to be ≤ 10−6, it suffices to setΩ = 5.13.

Now, assume that we are given a linear program affected by random perturbations:

minimize [cn + dc]Tx

subject to (lc)i ≤ [ani + dai]

Tx ≤ (uc)i, i = 1, ...,m,lx ≤ x ≤ ux,

(9.13)

where (cn, ani mi=1, lc, uc, lx, ux) are the nominal data, and dc, dai are random perturbations with zero

means. Assume, for the sake of definiteness, that every one of the random perturbations dc, da1, ..., damsatisfies either the assumption of item 2 or the assumption of item 3, and let Vc, V1, ..., Vm be the

Page 134: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

116 CHAPTER 9. CASE STUDIES

corresponding (upper bounds on the) covariance matrices of the perturbations. Choosing a safetyparameter Ω and replacing the objective and the bodies of all the constraints by their safe bounds asexplained above, we arrive at the following optimization problem:

minimize t

subject to [cn]Tx+ Ω√xTVcx ≤ t,

(lc)i ≤ [ani ]Tx− Ω

√xTVaix,

[ani ]Tx+ Ω

√xTVaix ≤ (uc)i, i = 1, ...,m,

lx ≤ x ≤ ux.

(9.14)

The relation between problems (9.14) and (9.13) is as follows:

• If (x, t) is a feasible solution of (9.14), then with probability at least

p = 1− (m+ 1)exp−Ω2/2x is feasible for randomly perturbed problem (9.13), and t is an upper bound on the objectiveof (9.13) evaluated at x.

• We see that if Ω is not too small (9.14) can be treated as a ”safe version” of (9.13).

On the other hand, it is easily seen that (9.14) is nothing but the robust counterpart of the uncer-tain linear optimization problem with the nominal data (cn, an

i mi=1, lc, uc, lx, ux) and the row-wiseellipsoidal uncertainty given by the matrices Vc, Va1 , ..., Vam . In the corresponding uncertainty set,the uncertainty affects the coefficients of the objective and the constraint matrix only, and the per-turbation vectors affecting the objective and the vectors of coefficients of the linear constraints run,independently of each other, through the respective ellipsoids

Ec =dc = ΩV 1/2

c u : uTu ≤ 1,

Eai =dai = ΩV 1/2

ai u : uTu ≤ 1, i = 1, ...,m.

It turns out that in many cases the ellipsoidal model of uncertainty is significantly less conservativeand thus better suited for practice, than the interval model of uncertainty.

Last but not least, it should be mentioned that problem (9.14) is equivalent to a conic quadraticprogram, specifically to the program

minimize t

subject to [cn]Tx+ Ωz ≤ t,

(lc)i ≤ [ani ]Tx− Ωzi,

[ani ]Tx+ Ωzi ≤ (uc)i, i = 1, ...,m,

0 = w −Dcx0 = wi −Daix, i = 1, ...,m,

0 ≤ z −√wTw,

0 ≤ zi −√

(wi)Twi, i = 1, ...,m,

lx ≤ x ≤ ux.

Page 135: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

9.1. ROBUST LINEAR OPTIMIZATION 117

where Dc and Dai are matrices satisfying the relations

Vc = DTc Dc, Vai = DT

aiDai , i = 1, ...,m.

9.1.4.1 Example: Interval and Ellipsoidal robust counterparts of uncertain linear con-straint with independent random perturbations of coefficients

Consider a linear constraint

l ≤n∑j=1

ajxj ≤ u (9.15)

and assume that the aj coefficients of the body of the constraint are uncertain and vary in intervalsanj ±σj . The worst-case-oriented model of uncertainty here is the interval one, and the corresponding

robust counterpart of the constraint is given by the system of linear inequalities

l ≤n∑j=1

anj xj −

∑j=1

σjyj ,

n∑j=1

anj xj +

n∑j=1

σjyj ≤ u,

0 ≤ xj + yj ,0 ≤ − xj + yj , j = 1, ..., n.

(9.16)

Now, assume that we have reasons to believe that the true values of the coefficients aj are obtainedfrom their nominal values an

j by random perturbations, independent for different j and symmetricallydistributed in the segments [−σj , σj ]. With this assumption, we are in the situation of item 3 and canreplace the uncertain constraint (9.15) with its ellipsoidal robust counterpart

l ≤n∑j=1

anj xj − Ωz,

n∑j=1

anj xj + Ωz ≤ u,

0 ≤ z −

√√√√ n∑j=1

σ2jx

2j .

(9.17)

Please note that with the model of random perturbations, a vector x satisfying (9.17) satisfies arealization of (9.15) with probability at least 1− expΩ2/2; for Ω = 6. This probability is ≥ 1− 1.5 ·10−8, which for all practical purposes is the same as sayiong that x satisfies all realizations of (9.15).On the other hand, the uncertainty set associated with (9.16) is the box

B =a = (a1, ..., an)T : an

j − σj ≤ aj ≤ anj + σj , j = 1, ..., n

,

while the uncertainty set associated with (9.17) is the ellipsoid

Page 136: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

118 CHAPTER 9. CASE STUDIES

E(Ω) =

a = (a1, ..., an)T :

n∑j=1

(aj − anj )

2

σ2j ≤ Ω2

.

For a moderate value of Ω, say Ω = 6, and n ≥ 40, the ellipsoid E(Ω) in its diameter, typical linearsizes, volume, etc. is incomparably less than the box B, the difference becoming more dramatic thelarger the dimension n of the box and the ellipsoid. It follows that the ellipsoidal robust counterpart(9.17) of the randomly perturbed uncertain constraint (9.15) is much less conservative than the intervalrobust counterpart (9.16), while ensuring basically the same ”robustness guarantees”. To illustratethis important point, consider the following numerical examples:

There are n different assets on the market. The return on $ 1 invested in asset j is a random variabledistributed symmetrically in the segment [δj − σj , δj + σj ], and the returns on different assets areindependent of each other. The problem is to distribute $ 1 among the assets in order to get thelargest possible total return on the resulting portfolio.

A natural model of the problem is an uncertain linear optimization problem

maximize

n∑j=1

ajxj

subject to

n∑j=1

xj = 1,

0 ≤ xj , j = 1, ..., n.

(9.18)

where aj are the uncertain returns of the assets. Both the nominal optimal solution (set all returns ajequal to their nominal values δj) and the risk-neutral Stochastic Programming approach (maximize theexpected total return) result in the same solution: Our $ 1 should be invested in the most promisingasset(s) – the one(s) with the maximal nominal return. This solution, however, can be very unreliableif, as is typically the case in reality, the most promising asset has the largest volatility σ and is in thissense the most risky. To reduce the risk, one can use the Robust Counterpart approach which resultsin the following optimization problems.

The Interval Model of Uncertainty:maximize t

subject to 0 ≤ − t+

n∑j=1

(δj − σj)xj ,

n∑j=1

xj = 1,

0 ≤ xj , j = 1, ..., n

(9.19)

and

Page 137: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

9.1. ROBUST LINEAR OPTIMIZATION 119

The ellipsoidal Model of Uncertainty:maximize t

subject to 0 ≤ − t+

n∑j=1

(δj)xj − Ωz,

0 ≤ z −

√√√√ n∑j=1

σ2jx

2j ,

n∑j=1

xj = 1,

0 ≤ xj , j = 1, ..., n.(9.20)

Note that the problem (9.20) is essentially the risk-averted portfolio model proposed in mid-50’s byMarkowitz.

The solution of (9.19) is evident — our $ 1 should be invested in the asset(s) with the largest possibleguaranteed return δj − σj . In contrast to this very conservative policy (which in reality prescribes tokeep the initial capital in a bank or in the most reliable, and thus low profit, assets), the optimalsolution to (9.20) prescribes a quite reasonable diversification of investments which allows to get muchbetter total return than (9.19) with basically zero risk. To illustrate this, assume that there are n = 300assets with the nominal returns (per year) varying from 1.04 (bank savings) to 2.00:

δj = 1.04 + 0.96j − 1

n− 1, j = 1, 2, ..., n = 300

and volatilities varying from 0 for the bank savings to 1.2 for the most promising asset:

σj = 1.152j − 1

n− 1, j = 1, ..., n = 300.

Here is a MATLAB script which builds the associated problem (9.20), solves it via the MOSEKoptimization toolbox, displays the resulting robust optimal value of the total return and the distributionof investments, and finally runs 10,000 simulations to get the distribution of the total return on theresulting portfolio (in these simulations, the returns on all assets are uniformly distributed in thecorresponding intervals):

[ rlo2.m ]1 % File: rlo2.m

2

3 % Problem:

4 %

5 % Maximize t subject to

6 % t <= sum(delta(j)*x(j)) -Omega*z,

7 % y(j) = sigma(j)*x(j), j=1,...,n,

8 % sum(x(j)) = 1,

9 % norm(y) <= z,

10 % 0 <= x.

11

12 clear prob;

13 n = 300;

14 Omega = 6;

Page 138: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

120 CHAPTER 9. CASE STUDIES

15

16 % Set nominal returns and volatilities

17 delta = (0.96/(n-1))*[0:1:n-1]+1.04;

18 sigma = (1.152/(n-1))*[0:1:n-1];

19

20 % Set mosekopt description of the problem

21 prob.c = -[1;zeros(2*n+1,1)];

22 A = [-1,ones(1,n)+delta,-Omega,zeros(1,n);zeros(n+1,2*n+2)];

23 for j=1:n,

24 % Body of the constraint y(j) - sigma(j)*x(j) = 0:

25 A(j+1,j+1) = -sigma(j);

26 A(j+1,2+n+j) = 1;

27 end;

28 A(n+2,2:n+1) = ones(1,n);

29 prob.a = sparse(A);

30 prob.blc = [zeros(n+1,1);1];

31 prob.buc = [inf;zeros(n,1);1];

32 prob.blx = [-inf;zeros(n,1);0;zeros(n,1)];

33 prob.bux = inf*ones(2*n+2,1);

34 prob.cones = cell(1,1);

35 prob.cones1.type = ’MSK CT QUAD’;

36 prob.cones1.sub = [n+2;[n+3:1:2*n+2]’];

37

38 % Run mosekopt

39 [r,res]=mosekopt(’minimize echo(1)’,prob);

40

41 % Display the solution

42 xx = res.sol.itr.xx;

43 t = xx(1);

44

45 disp(sprintf(’Robust optimal value: %5.4f’,t));

46 x = max(xx(2:1+n),zeros(n,1));

47 plot([1:1:n],x,’-m’);

48 grid on;

49

50 disp(’Press <Enter> to run simulations’);

51 pause

52

53 % Run simulations

54

55 Nsim = 10000;

56 out = zeros(Nsim,1);

57 for i=1:Nsim,

58 returns = delta+(2*rand(1,n)-1).*sigma;

59 out(i) = returns*x;

60 end;

61 disp(sprintf(’Actual returns over %d simulations:’,Nsim));

62 disp(sprintf(’Min=%5.4f Mean=%5.4f Max=%5.4f StD=%5.2f’,...

63 min(out),mean(out),max(out),std(out)));

64 hist(out);

Here are the results displayed by the script:

Robust optimal value: 1.3428

Actual returns over 10000 simulations:

Min=1.5724 Mean=1.6965 Max=1.8245 StD= 0.03

Please note that with our set-up there is exactly one asset with guaranteed return greater than 1 –

Page 139: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

9.1. ROBUST LINEAR OPTIMIZATION 121

Figure 9.1: Distribution of investments among the assets in the optimal solution of.

asset # 1 (bank savings, return 1.04, zero volatility). Consequently, the interval robust counterpart(9.19) prescribes to put our $ 1 in the bank, thus getting a 4% profit. In contrast to this, the diversifiedportfolio given by the optimal solution of (9.20) never yields profit less than 57.2%, and yields at averagea 69.67% profit with pretty low (0.03) standard deviation. We see that in favorable circumstances theellipsoidal robust counterpart of an uncertain linear program indeed is less conservative than, althoughbasically as reliable as, the interval robust counterpart.

Finally, let us compare our results with those given by the nominal optimal solution. The latterprescribes to invest everything we have in the most promising asset (in our example this is the asset #300 with a nominal return of 2.00 and volatility of1.152). Assuming that the actual return is uniformlydistributed in the corresponding interval and running 10,000 simulations, we get the following results:

Nominal optimal value: 2.0000

Actual returns over 10000 simulations:

Min=0.8483 Mean=1.9918 Max=3.1519 StD= 0.66

We see that the nominal solution results in a portfolio which is much more risky, although better ataverage, than the portfolio given by the robust solution.

9.1.4.2 Combined Interval-Ellipsoidal Robust Counterpart

We have considered the case when the coefficients aj of uncertain linear constraint (9.15) are affectedby uncorrelated random perturbations symmetrically distributed in given intervals [−σj , σj ], and wehave discussed two ways to model the uncertainty:

• The interval uncertainty model (the uncertainty set U is the box B), where we ignore the stochas-tic nature of the perturbations and their independence. This model yields the Interval RobustCounterpart (9.16);

Page 140: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

122 CHAPTER 9. CASE STUDIES

• The ellipsoidal uncertainty model (U is the ellipsoid E(Ω)), which takes into account the stochas-tic nature of data perturbations and yields the Ellipsoidal Robust Counterpart (9.17).

Please note that although for large n the ellipsoid E(Ω) in its diameter, volume and average linear sizesis incomparably smaller than the box B, in the case of Ω > 1 the ellipsoid E(Ω) in certain directionsgoes beyond the box. E.g. the ellipsoid E(6), although much more narrow than B in most of thedirections, is 6 times wider than B in the directions of the coordinate axes. Intuition says that ithardly makes sense to keep in the uncertainty set realizations of the data which are outside of B andthus forbidden by our model of perturbations, so in the situation under consideration the intersection ofE(Ω) and B is a better model of the uncertainty set than the ellipsoid E(Ω) itself. What happens whenthe model of the uncertainty set is the ”combined interval-ellipsoidal” uncertainty U(Ω) = E(Ω)∩B ?

First, it turns out that the RC of (9.15) corresponding to the uncertainty set U(Ω) is still given by asystem of linear and conic quadratic inequalities, specifically the system

l ≤n∑j=1

anj xj −

n∑j=1

σjyj − Ω

√√√√ n∑j=1

σ2ju

2j ,

n∑j=1

anj xj +

n∑j=1

σjzj + Ω

√√√√ n∑j=1

σ2j v

2j ≤ u,

− yj ≤ xj − uj ≤ yj , j = 1, ..., n,− zj ≤ xj − vj ≤ zj , j = 1, ..., n.

(9.21)

Second, it turns out that our intuition is correct: As a model of uncertainty, U(Ω) is as reliable as theellipsoid E(Ω). Specifically, if x can be extended to a feasible solution of (9.21), then the probabilityfor x to satisfy a realization of (9.15) is ≥ 1− exp−Ω2/2.The conclusion is that if we have reasons to assume that the perturbations of uncertain coefficientsin a constraint of an uncertain linear optimization problem are (a) random, (b) independent of eachother, and (c) symmetrically distributed in given intervals, then it makes sense to associate with thisconstraint an interval-ellipsoidal model of uncertainty and use a system of linear and conic quadraticinequalities (9.21). Please note that when building the robust counterpart of an uncertain linear opti-mization problem, one can use different models of the uncertainty (e.g., interval, ellipsoidal, combinedinterval-ellipsoidal) for different uncertain constraints within the same problem.

9.1.5 Further references

For further information about robust linear optimization consult [6], [7].

9.2 Geometric (posynomial) optimization

9.2.1 The problem

A geometric optimization problem can be stated as follows

Page 141: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

9.2. GEOMETRIC (POSYNOMIAL) OPTIMIZATION 123

minimize∑k∈J0

ck

n−1∏j=0

takjj

subject to∑k∈Ji

ck

n−1∏j=0

takjj ≤ 1, i = 1, . . . ,m,

t > 0,

(9.22)

where it is assumed that

∪mk=0Jk = 1, . . . , T

and if i 6= j, then

Ji ∩ Jj = ∅.

Hence, A is a T×n matrix and c is a vector of length T . Given ck > 0 then

ck

n−1∏j=0

takjj

is called a monomial. A sum of monomials i.e.

∑k∈Ji

ck

n−1∏j=0

takjj

is called a posynomial.In general, the problem (9.22) is very hard to solve. However, the posynomialcase where it is required that

c > 0

is relatively easy. The reason is that using a simple variable transformation a convex optimizationproblem can be obtained. Indeed using the variable transformation

tj = exj (9.23)

we obtain the problem

minimize∑k∈J0

cke∑n−1j=0 akjxj

subject to∑k∈Ji

cke∑n−1j=0 akjxj ≤ 1, i = 1, . . . ,m,

(9.24)

which is a convex optimization problem that can be solved using MOSEK. We will call

cte(∑n−1j=0 atjxj) = e(log(ct)+

∑n−1j=0 atjxj)

Page 142: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

124 CHAPTER 9. CASE STUDIES

a term and hence the number of terms is T .

As stated, the problem (9.24) is non-separable. However, using

vt = log(ct) +

n−1∑j=0

atjxj

we obtain the separable problem

minimize∑t∈J0

evt

subject to∑t∈Ji

evt ≤ 1, i = 1, . . . ,m,

n−1∑j=0

atjxj − vt = − log(ct), t = 0, . . . , T,

(9.25)

which is a separable convex optimization problem.

A warning about this approach is that the exponential function ex is only numerically well-defined forvalues of x in a small interval around 0 since ex grows very rapidly as x becomes larger. Thereforenumerical problems may arise when solving the problem on this form.

9.2.2 Applications

A large number of practical applications, particularly in electrical circuit design, can be cast as ageometric optimization problem. We will not review these applications here but rather refer the readerto [8] and the references therein.

9.2.3 Modeling tricks

A lot of tricks that can be used for modeling posynomial optimization problems are described in [8].Therefore, in this section we cover only one important case.

9.2.3.1 Equalities

In general, equalities are not allowed in (9.22), i.e.

∑k∈Ji

ck

n−1∏j=0

takjj = 1

is not allowed. However, a monomial equality is not a problem. Indeed consider the example

xyz−1 = 1

Page 143: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

9.2. GEOMETRIC (POSYNOMIAL) OPTIMIZATION 125

of a monomial equality. The equality is identical to

1 ≤ xyz−1 ≤ 1

which in turn is identical to the two inequalities

xyz−1 ≤ 1,1

xyz−1= x−1y−1z ≤ 1.

Hence, it is possible to model a monomial equality using two inequalities.

9.2.4 Problematic formulations

Certain formulations of geometric optimization problems may cause problems for the algorithms im-plemented in MOSEK. Basically there are two kinds of problems that may occur:

• The solution vector is finite, but an optimal objective value can only be a approximated.

• The optimal objective value is finite but implies that a variable in the solution is infinite.

9.2.4.1 Finite unattainable solution

The following problem illustrates an unattainable solution:

minimize x2ysubject to xy ≤ 1,

x, y > 0.

Clearly, the optimal objective value is 0 but because of the constraint the x, y > 0 constraint this valuecan never be attained: To see why this is a problem, remember that MOSEK substitutes x = etx andy = ety and solves the problem as

minimize e2txety

subject to etxety ≤ 1,tx, ty ∈ R.

The optimal solution implies that tx = −∞ or ty = −∞, and thus it is unattainable.

Now, the issue should be clear: If a variable x appears only with nonnegative exponents, then fixingx = 0 will minimize all terms in which it appears — but such a solution cannot be attained.

9.2.4.2 Infinite solution

A similar problem will occur if a finite optimal objective value requires a variable to be infinite. Thiscan be illustrated by the following example:

Page 144: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

126 CHAPTER 9. CASE STUDIES

minimize x−2

subject to x−1 ≤ 1,x > 0,

which is a valid geometric programming problem. In this case the optimal objective is 0, but thisrequires x =∞, which is unattainable.

Again, this specific case will appear if a variable x appears only with negative exponents in the problem,implying that each term in which it appears can be minimized for x→∞.

9.2.5 An example

Consider the example

minimize x−1y

subject to x2y−12 + 3y

12 z−1 ≤ 1,

xy−1 = z2,

− x ≤ − 1

10,

x ≤ 3,x, y, z > 0,

which is not a geometric optimization problem. However, using the obvious transformations we obtainthe problem

minimize x−1y

subject to x2y−12 + 3y

12 z−1 ≤ 1,

xy−1z−2 ≤ 1,x−1yz2 ≤ 1,1

10x−1 ≤ 1,

1

3x ≤ 1,

x, y, z > 0,

(9.26)

which is a geometric optimization problem.

9.2.6 Solving the example

The problem (9.26) can be defined and solved in the MOSEK toolbox as shown below.

[ go2.m ]1 % go2.m

2

3 c = [1 1 3 1 1 0.1 1/3]’;

4 a = sparse([[-1 1 0];

5 [2 -0.5 0];

6 [0 0.5 -1];

Page 145: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

9.2. GEOMETRIC (POSYNOMIAL) OPTIMIZATION 127

7 [1 -1 -2];

8 [-1 1 2];

9 [-1 0 0];

10 [1 0 0]]);

11

12 map = [0 1 1 2 3 4 5]’;

13 [res] = mskgpopt(c,a,map);

14

15 fprintf(’\nPrimal optimal solution to original gp:’);

16 fprintf(’ %e’,exp(res.sol.itr.xx));

17 fprintf(’\n\n’);18

19 % Compute the optimal objective value and

20 % the constraint activities.

21 v = c.*exp(a*res.sol.itr.xx);

22

23 % Add appropriate terms together.

24 f = sparse(map+1,1:7,ones(size(map)))*v;

25

26 % First objective value. Then constraint values.

27 fprintf(’Objective value: %e\n’,log(f(1)));28 fprintf(’Constraint values:’);

29 fprintf(’ %e’,log(f(2:end)));

30 fprintf(’\n\n’);31

32 % Dual multipliers (should be negative)

33 fprintf(’Dual variables (should be negative):’);

34 fprintf(’ %e’,res.sol.itr.y);

35 fprintf(’\n\n’);

9.2.7 Exporting to a file

It’s possible to write a geometric optimization problem to a file with the command:

mskgpwri(c,a,map,filename)

This file format is compatible with the mskexpopt command line tool. See the MOSEK Tools User’smanual for details on mskexpopt. This file format can be useful for sending debug information toMOSEK or for testing. It’s also possible to read the above format with the command:

[c,a,map] = mskgpread(filename)

9.2.8 Further information

More information about geometric optimization problems is located in [3], [9], [8].

Page 146: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

128 CHAPTER 9. CASE STUDIES

Page 147: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

Chapter 10

The optimizers for continuousproblems

The most essential part of MOSEK is the optimizers. Each optimizer is designed to solve a particularclass of problems i.e. linear, conic, or general nonlinear problems. The purpose of the present chapteris to discuss which optimizers are available for the continuous problem classes and how the performanceof an optimizer can be tuned, if needed.

This chapter deals with the optimizers for continuous problems with no integer variables.

10.1 How an optimizer works

When the optimizer is called, it roughly performs the following steps:

Presolve:

Preprocessing to reduce the size of the problem.

Dualizer:

Choosing whether to solve the primal or the dual form of the problem.

Scaling:

Scaling the problem for better numerical stability.

Optimize:

Solve the problem using selected method.

The first three preprocessing steps are transparent to the user, but useful to know about for tuningpurposes. In general, the purpose of the preprocessing steps is to make the actual optimization moreefficient and robust.

129

Page 148: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

130 CHAPTER 10. THE OPTIMIZERS FOR CONTINUOUS PROBLEMS

10.1.1 Presolve

Before an optimizer actually performs the optimization the problem is preprocessed using the so-calledpresolve. The purpose of the presolve is to

• remove redundant constraints,

• eliminate fixed variables,

• remove linear dependencies,

• substitute out (implied) free variables, and

• reduce the size of the optimization problem in general.

After the presolved problem has been optimized the solution is automatically postsolved so that thereturned solution is valid for the original problem. Hence, the presolve is completely transparent. Forfurther details about the presolve phase, please see [10], [11].

It is possible to fine-tune the behavior of the presolve or to turn it off entirely. If presolve consumestoo much time or memory compared to the reduction in problem size gained it may be disabled. Thisis done by setting the parameter MSK IPAR PRESOLVE USE to MSK PRESOLVE MODE OFF.

The two most time-consuming steps of the presolve are

• the eliminator, and

• the linear dependency check.

Therefore, in some cases it is worthwhile to disable one or both of these.

10.1.1.1 Numerical issues in the presolve

During the presolve the problem is reformulated so that it hopefully solves faster. However, in rarecases the presolved problem may be harder to solve then the original problem. The presolve may alsobe infeasible although the orinal problem is not.

If it is suspected that presolved problem is much harder to solve than the original then it is suggestedto first turn the eliminator off by setting the parameter MSK IPAR PRESOLVE ELIMINATOR USE. If thatdoes not help, then trying to turn presolve off may help.

Since all computations are done in finite prescision then the presolve employs some tolerances whenconcluding a variable is fixed or constraint is redundant. If it happens that MOSEK incorrectlyconcludes a problem is primal or dual infeasible, then it is worthwhile to try to reduce the parame-ters MSK DPAR PRESOLVE TOL X and MSK DPAR PRESOLVE TOL S. However, if actually help reducing theparameters then this should be taken as an indication of the problem is badly formulated.

Page 149: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

10.1. HOW AN OPTIMIZER WORKS 131

10.1.1.2 Eliminator

The purpose of the eliminator is to eliminate free and implied free variables from the problem usingsubstitution. For instance, given the constraints

y =∑

xj ,

y, x ≥ 0,

y is an implied free variable that can be substituted out of the problem, if deemed worthwhile.

If the eliminator consumes too much time or memory compared to the reduction in problem sizegained it may be disabled. This can be done with the parameter MSK IPAR PRESOLVE ELIMINATOR USE

to MSK OFF.

In rare cases the eliminator may cause that the problem becomes much hard to solve.

10.1.1.3 Linear dependency checker

The purpose of the linear dependency check is to remove linear dependencies among the linear equal-ities. For instance, the three linear equalities

x1 + x2 + x3 = 1,x1 + 0.5x2 = 0.5,0.5x2 + x3 = 0.5

contain exactly one linear dependency. This implies that one of the constraints can be dropped withoutchanging the set of feasible solutions. Removing linear dependencies is in general a good idea since itreduces the size of the problem. Moreover, the linear dependencies are likely to introduce numericalproblems in the optimization phase.

It is best practise to build models without linear dependencies. If the linear dependencies are removedat the modeling stage, the linear dependency check can safely be disabled by setting the parameterMSK IPAR PRESOLVE LINDEP USE to MSK OFF.

10.1.2 Dualizer

All linear, conic, and convex optimization problems have an equivalent dual problem associated withthem. MOSEK has built-in heuristics to determine if it is most efficient to solve the primal or dualproblem. The form (primal or dual) solved is displayed in the MOSEK log. Should the internalheuristics not choose the most efficient form of the problem it may be worthwhile to set the dualizermanually by setting the parameters:

• MSK IPAR INTPNT SOLVE FORM: In case of the interior-point optimizer.

• MSK IPAR SIM SOLVE FORM: In case of the simplex optimizer.

Note that currently only linear problems may be dualized.

Page 150: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

132 CHAPTER 10. THE OPTIMIZERS FOR CONTINUOUS PROBLEMS

10.1.3 Scaling

Problems containing data with large and/or small coefficients, say 1.0e+ 9 or 1.0e− 7 , are often hardto solve. Significant digits may be truncated in calculations with finite precision, which can result inthe optimizer relying on inaccurate calculations. Since computers work in finite precision, extremecoefficients should be avoided. In general, data around the same ”order of magnitude” is preferred,and we will refer to a problem, satisfying this loose property, as being well-scaled. If the problem isnot well scaled, MOSEK will try to scale (multiply) constraints and variables by suitable constants.MOSEK solves the scaled problem to improve the numerical properties.

The scaling process is transparent, i.e. the solution to the original problem is reported. It is importantto be aware that the optimizer terminates when the termination criterion is met on the scaled problem,therefore significant primal or dual infeasibilities may occur after unscaling for badly scaled problems.The best solution to this problem is to reformulate it, making it better scaled.

By default MOSEK heuristically chooses a suitable scaling. The scaling for interior-point and simplexoptimizers can be controlled with the parameters MSK IPAR INTPNT SCALING and MSK IPAR SIM SCALING

respectively.

10.1.4 Using multiple threads

The interior-point optimizers in MOSEK have been parallelized. This means that if you solve linear,quadratic, conic, or general convex optimization problem using the interior-point optimizer, you cantake advantage of multiple CPU’s.

By default MOSEK will automatically select the number of threads to be employed when solvingthe problem. However, the number of threads employed can be changed by setting the parameterMSK IPAR NUM THREADS. This should never exceed the number of cores on the computer.

The speed-up obtained when using multiple threads is highly problem and hardware dependent, andconsequently, it is advisable to compare single threaded and multi threaded performance for the givenproblem type to determine the optimal settings.

For small problems, using multiple threads is not be worthwhile and may even be counter productive.

10.2 Linear optimization

10.2.1 Optimizer selection

Two different types of optimizers are available for linear problems: The default is an interior-pointmethod, and the alternatives are simplex methods. The optimizer can be selected using the parameterMSK IPAR OPTIMIZER.

Page 151: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

10.2. LINEAR OPTIMIZATION 133

10.2.2 The interior-point optimizer

The purpose of this section is to provide information about the algorithm employed in MOSEK interior-point optimizer.

In order to keep the discussion simple it is assumed that MOSEK solves linear optimization problemson standard form

minimize cTxsubject to Ax = b,

x ≥ 0.(10.1)

This is in fact what happens inside MOSEK; for efficiency reasons MOSEK converts the problem tostandard form before solving, then convert it back to the input form when reporting the solution.

Since it is not known beforehand whether problem (10.1) has an optimal solution, is primal infeasibleor is dual infeasible, the optimization algorithm must deal with all three situations. This is the reasonthat MOSEK solves the so-called homogeneous model

Ax− bτ = 0,

AT y + s− cτ = 0,

− cTx+ bT y − κ = 0,x, s, τ, κ ≥ 0,

(10.2)

where y and s correspond to the dual variables in (10.1), and τ and κ are two additional scalar variables.Note that the homogeneous model (10.2) always has solution since

(x, y, s, τ, κ) = (0, 0, 0, 0, 0)

is a solution, although not a very interesting one.

Any solution

(x∗, y∗, s∗, τ∗, κ∗)

to the homogeneous model (10.2) satisfies

x∗js∗j = 0 and τ∗κ∗ = 0.

Moreover, there is always a solution that has the property

τ∗ + κ∗ > 0.

First, assume that τ∗ > 0 . It follows that

Page 152: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

134 CHAPTER 10. THE OPTIMIZERS FOR CONTINUOUS PROBLEMS

Ax∗

τ∗= b,

ATy∗

τ∗+s∗

τ∗= c,

− cT x∗

τ∗+ bT

y∗

τ∗= 0,

x∗, s∗, τ∗, κ∗ ≥ 0.

This shows that x∗

τ∗ is a primal optimal solution and ( y∗

τ∗ ,s∗

τ∗ ) is a dual optimal solution; this is reportedas the optimal interior-point solution since

(x, y, s) =

(x∗

τ∗,y∗

τ∗,s∗

τ∗

)is a primal-dual optimal solution.

On other hand, if κ∗ > 0 then

Ax∗ = 0,

AT y∗ + s∗ = 0,

− cTx∗ + bT y∗ = κ∗,x∗, s∗, τ∗, κ∗ ≥ 0.

This implies that at least one of

− cTx∗ > 0 (10.3)

or

bT y∗ > 0 (10.4)

is satisfied. If (10.3) is satisfied then x∗ is a certificate of dual infeasibility, whereas if (10.4) is satisfiedthen y∗ is a certificate of dual infeasibility.

In summary, by computing an appropriate solution to the homogeneous model, all information requiredfor a solution to the original problem is obtained. A solution to the homogeneous model can becomputed using a primal-dual interior-point algorithm [12].

10.2.2.1 Interior-point termination criterion

For efficiency reasons it is not practical to solve the homogeneous model exactly. Hence, an exactoptimal solution or an exact infeasibility certificate cannot be computed and a reasonable terminationcriterion has to be employed.

In every iteration, k, of the interior-point algorithm a trial solution

(xk, yk, sk, τk, κk)

to homogeneous model is generated where

Page 153: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

10.2. LINEAR OPTIMIZATION 135

xk, sk, τk, κk > 0.

Whenever the trial solution satisfies the criterion

∥∥∥∥Axkτk − b∥∥∥∥∞ ≤ εp(1 + ‖b‖∞),∥∥∥∥AT ykτk +

sk

τk− c∥∥∥∥∞ ≤ εd(1 + ‖c‖∞), and

min

((xk)T sk

(τk)2,

∣∣∣∣cTxkτk− bT yk

τk

∣∣∣∣ ) ≤ εgmax

(1,

min(∣∣cTxk∣∣ , ∣∣bT yk∣∣ )

τk

),

(10.5)

the interior-point optimizer is terminated and

(xk, yk, sk)

τk

is reported as the primal-dual optimal solution. The interpretation of (10.5) is that the optimizer isterminated if

• xk

τkis approximately primal feasible,

•(yk

τk, s

k

τk

)is approximately dual feasible, and

• the duality gap is almost zero.

On the other hand, if the trial solution satisfies

−εicTxk >‖c‖∞

max(1, ‖b‖∞)

∥∥Axk∥∥∞then the problem is declared dual infeasible and xk is reported as a certificate of dual infeasibility.The motivation for this stopping criterion is as follows: First assume that

∥∥Axk∥∥∞ = 0 ; then xk isan exact certificate of dual infeasibility. Next assume that this is not the case, i.e.

∥∥Axk∥∥∞ > 0,

and define

x := εimax(1, ‖b‖∞)

‖Axk‖∞ ‖c‖∞xk.

It is easy to verify that

‖Ax‖∞ = εimax(1, ‖b‖∞)

‖c‖∞and − cT x > 1,

which shows x is an approximate certificate of dual infeasibility where εi controls the quality of theapproximation. A smaller value means a better approximation.

Page 154: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

136 CHAPTER 10. THE OPTIMIZERS FOR CONTINUOUS PROBLEMS

Tolerance Parameter nameεp MSK DPAR INTPNT TOL PFEAS

εd MSK DPAR INTPNT TOL DFEAS

εg MSK DPAR INTPNT TOL REL GAP

εi MSK DPAR INTPNT TOL INFEAS

Table 10.1: Parameters employed in termination criterion.

Finally, if

εibT yk >

‖b‖∞max(1, ‖c‖∞)

∥∥AT yk + sk∥∥∞

then yk is reported as a certificate of primal infeasibility.

It is possible to adjust the tolerances εp, εd, εg and εi using parameters; see table 10.1 for details. Thedefault values of the termination tolerances are chosen such that for a majority of problems appearingin practice it is not possible to achieve much better accuracy. Therefore, tightening the tolerancesusually is not worthwhile. However, an inspection of (10.5) reveals that quality of the solution isdependent on ‖b‖∞ and ‖c‖∞; the smaller the norms are, the better the solution accuracy.

The interior-point method as implemented by MOSEK will converge toward optimality and primaland dual feasibility at the same rate [12]. This means that if the optimizer is stopped prematurelythen it is very unlikely that either the primal or dual solution is feasible. Another consequence is thatin most cases all the tolerances, εp, εd and εg, has to be relaxed together to achieve an effect.

The basis identification discussed in section 10.2.2.2 requires an optimal solution to work well; hencebasis identification should turned off if the termination criterion is relaxed.

To conclude the discussion in this section, relaxing the termination criterion is usually is not worthwhile.

10.2.2.2 Basis identification

An interior-point optimizer does not return an optimal basic solution unless the problem has aunique primal and dual optimal solution. Therefore, the interior-point optimizer has an optionalpost-processing step that computes an optimal basic solution starting from the optimal interior-pointsolution. More information about the basis identification procedure may be found in [13].

Please note that a basic solution is often more accurate than an interior-point solution.

By default MOSEK performs a basis identification. However, if a basic solution is not needed, thebasis identification procedure can be turned off. The parameters

• MSK IPAR INTPNT BASIS,

• MSK IPAR BI IGNORE MAX ITER, and

• MSK IPAR BI IGNORE NUM ERROR

controls when basis identification is performed.

Page 155: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

10.2. LINEAR OPTIMIZATION 137

10.2.2.3 The interior-point log

Below is a typical log output from the interior-point optimizer presented:

Optimizer - threads : 1

Optimizer - solved problem : the dual

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 : 7.00e+001

ITE PFEAS DFEAS GFEAS PRSTATUS POBJ DOBJ MU TIME

0 1.0e+000 8.6e+000 6.1e+000 1.00e+000 0.000000000e+000 -2.208000000e+003 1.0e+000 0.00

1 1.1e+000 2.5e+000 1.6e-001 0.00e+000 -7.901380925e+003 -7.394611417e+003 2.5e+000 0.00

2 1.4e-001 3.4e-001 2.1e-002 8.36e-001 -8.113031650e+003 -8.055866001e+003 3.3e-001 0.00

3 2.4e-002 5.8e-002 3.6e-003 1.27e+000 -7.777530698e+003 -7.766471080e+003 5.7e-002 0.01

4 1.3e-004 3.2e-004 2.0e-005 1.08e+000 -7.668323435e+003 -7.668207177e+003 3.2e-004 0.01

5 1.3e-008 3.2e-008 2.0e-009 1.00e+000 -7.668000027e+003 -7.668000015e+003 3.2e-008 0.01

6 1.3e-012 3.2e-012 2.0e-013 1.00e+000 -7.667999994e+003 -7.667999994e+003 3.2e-012 0.01

The first line displays the number of threads used by the optimizer and second line tells that theoptimizer choose to solve the dual problem rather than the primal problem. The next line displaysthe problem dimensions as seen by the optimizer, and the ”Factor...” lines show various statistics.This is followed by the iteration log.

Using the same notation as in section 10.2.2 the columns of the iteration log has the following meaning:

• ITE: Iteration index.

• PFEAS:∥∥Axk − bτk∥∥∞ . The numbers in this column should converge monotonically towards to

zero but may stall at low level due to rounding errors.

• DFEAS:∥∥AT yk + sk − cτk

∥∥∞ . The numbers in this column should converge monotonically to-ward to zero but may stall at low level due to rounding errors.

• GFEAS:∥∥− cxk + bT yk − κk

∥∥∞ . The numbers in this column should converge monotonicallytoward to zero but may stall at low level due to rounding errors.

• PRSTATUS: This number converge to 1 if the problem has an optimal solution whereas it convergeto −1 if that is not the case.

• POBJ: cTxk/τk. An estimate for the primal objective value.

• DOBJ: bT yk/τk. An estimate for the dual objective value.

• MU: (xk)T sk+τkκk

n+1 . The numbers in this column should always converge monotonically to zero.

• TIME: Time spend since the optimization started.

Page 156: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

138 CHAPTER 10. THE OPTIMIZERS FOR CONTINUOUS PROBLEMS

10.2.3 The simplex based optimizer

An alternative to the interior-point optimizer is the simplex optimizer.

The simplex optimizer uses a different method that allows exploiting an initial guess for the optimalsolution to reduce the solution time. Depending on the problem it may be faster or slower to use aninitial guess; see section 10.2.4 for a discussion.

MOSEK provides both a primal and a dual variant of the simplex optimizer — we will return to thislater.

10.2.3.1 Simplex termination criterion

The simplex optimizer terminates when it finds an optimal basic solution or an infeasibility certifi-cate. A basic solution is optimal when it is primal and dual feasible; see (17.1) and (17.2) for adefinition of the primal and dual problem. Due the fact that to computations are performed in finiteprecision MOSEK allows violation of primal and dual feasibility within certain tolerances. The usercan control the allowed primal and dual infeasibility with the parameters MSK DPAR BASIS TOL X andMSK DPAR BASIS TOL S.

10.2.3.2 Starting from an existing solution

When using the simplex optimizer it may be possible to reuse an existing solution and thereby reducethe solution time significantly. When a simplex optimizer starts from an existing solution it is said toperform a hot-start. If the user is solving a sequence of optimization problems by solving the problem,making modifications, and solving again, MOSEK will hot-start automatically.

Setting the parameter MSK IPAR OPTIMIZER to MSK OPTIMIZER FREE SIMPLEX instructs MOSEK toselect automatically between the primal and the dual simplex optimizers. Hence, MOSEK tries tochoose the best optimizer for the given problem and the available solution.

By default MOSEK uses presolve when performing a hot-start. If the optimizer only needs very fewiterations to find the optimal solution it may be better to turn off the presolve.

10.2.3.3 Numerical difficulties in the simplex optimizers

Though MOSEK is designed to minimize numerical instability, completely avoiding it is impossiblewhen working in finite precision. MOSEK counts a ”numerical unexpected behavior” event inside theoptimizer as a set-back. The user can define how many set-backs the optimizer accepts; if that numberis exceeded, the optimization will be aborted. Set-backs are implemented to avoid long sequenceswhere the optimizer tries to recover from an unstable situation.

Set-backs are, for example, repeated singularities when factorizing the basis matrix, repeated lossof feasibility, degeneracy problems (no progress in objective) and other events indicating numericaldifficulties. If the simplex optimizer encounters a lot of set-backs the problem is usually badly scaled;in such a situation try to reformulate into a better scaled problem. Then, if a lot of set-backs stilloccur, trying one or more of the following suggestions may be worthwhile:

Page 157: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

10.2. LINEAR OPTIMIZATION 139

• Raise tolerances for allowed primal or dual feasibility: Hence, increase the value of

– MSK DPAR BASIS TOL X, and

– MSK DPAR BASIS TOL S.

• Raise or lower pivot tolerance: Change the MSK DPAR SIMPLEX ABS TOL PIV parameter.

• Switch optimizer: Try another optimizer.

• Switch off crash: Set both MSK IPAR SIM PRIMAL CRASH and MSK IPAR SIM DUAL CRASH to 0.

• Experiment with other pricing strategies: Try different values for the parameters

– MSK IPAR SIM PRIMAL SELECTION and

– MSK IPAR SIM DUAL SELECTION.

• If you are using hot-starts, in rare cases switching off this feature may improve stability. This iscontrolled by the MSK IPAR SIM HOTSTART parameter.

• Increase maximum set-backs allowed controlled by MSK IPAR SIM MAX NUM SETBACKS.

• If the problem repeatedly becomes infeasible try switching off the special degeneracy handling.See the parameter MSK IPAR SIM DEGEN for details.

10.2.4 The interior-point or the simplex optimizer?

Given a linear optimization problem, which optimizer is the best: The primal simplex, the dual simplexor the interior-point optimizer?

It is impossible to provide a general answer to this question, however, the interior-point optimizerbehaves more predictably — it tends to use between 20 and 100 iterations, almost independently ofproblem size — but cannot perform hot-start, while simplex can take advantage of an initial solution,but is less predictable for cold-start. The interior-point optimizer is used by default.

10.2.5 The primal or the dual simplex variant?

MOSEK provides both a primal and a dual simplex optimizer. Predicting which simplex optimizeris faster is impossible, however, in recent years the dual optimizer has seen several algorithmic andcomputational improvements, which, in our experience, makes it faster on average than the primalsimplex optimizer. Still, it depends much on the problem structure and size.

Setting the MSK IPAR OPTIMIZER parameter to MSK OPTIMIZER FREE SIMPLEX instructs MOSEK tochoose which simplex optimizer to use automatically.

To summarize, if you want to know which optimizer is faster for a given problem type, you should tryall the optimizers.

Page 158: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

140 CHAPTER 10. THE OPTIMIZERS FOR CONTINUOUS PROBLEMS

Parameter name PurposeMSK DPAR INTPNT CO TOL PFEAS Controls primal feasibilityMSK DPAR INTPNT CO TOL DFEAS Controls dual feasibilityMSK DPAR INTPNT CO TOL REL GAP Controls relative gapMSK DPAR INTPNT TOL INFEAS Controls when the problem is declared infeasibleMSK DPAR INTPNT CO TOL MU RED Controls when the complementarity is reduced enough

Table 10.2: Parameters employed in termination criterion.

10.3 Linear network optimization

10.3.1 Network flow problems

Linear optimization problems with network flow structure can often be solved significantly faster witha specialized version of the simplex method [14] than with the general solvers.

MOSEK includes a network simplex solver which frequently solves network problems significantly fasterthan the standard simplex optimizers.

To use the network simplex optimizer, do the following:

• Input the network flow problem as an ordinary linear optimization problem.

• Set the parameters

– MSK IPAR OPTIMIZER to MSK OPTIMIZER NETWORK PRIMAL SIMPLEX.

MOSEK will automatically detect the network structure and apply the specialized simplex optimizer.

10.4 Conic optimization

10.4.1 The interior-point optimizer

For conic optimization problems only an interior-point type optimizer is available. The interior-pointoptimizer is an implementation of the so-called homogeneous and self-dual algorithm. For a detaileddescription of the algorithm, please see [15].

10.4.1.1 Interior-point termination criteria

The parameters controlling when the conic interior-point optimizer terminates are shown in Table 10.2.

Page 159: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

10.5. NONLINEAR CONVEX OPTIMIZATION 141

10.5 Nonlinear convex optimization

10.5.1 The interior-point optimizer

For quadratic, quadratically constrained, and general convex optimization problems an interior-pointtype optimizer is available. The interior-point optimizer is an implementation of the homogeneous andself-dual algorithm. For a detailed description of the algorithm, please see [16], [17].

10.5.1.1 The convexity requirement

Continuous nonlinear problems are required to be convex. For quadratic problems MOSEK test thisrequirement before optimizing. Specifying a non-convex problem results in an error message.

The following parameters are available to control the convexity check:

• MSK IPAR CHECK CONVEXITY: Turn convexity check on/off.

• MSK DPAR CHECK CONVEXITY REL TOL: Tolerance for convexity check.

• MSK IPAR LOG CHECK CONVEXITY: Turn on more log information for debugging.

10.5.1.2 The differentiabilty requirement

The nonlinear optimizer in MOSEK requires both first order and second order derivatives. This ofcourse implies care should be taken when solving problems involving non-differentiable functions.

For instance, the function

f(x) = x2

is differentiable everywhere whereas the function

f(x) =√x

is only differentiable for x > 0 . In order to make sure that MOSEK evaluates the functions at pointswhere they are differentiable, the function domains must be defined by setting appropriate variablebounds.

In general, if a variable is not ranged MOSEK will only evaluate that variable at points strictly withinthe bounds. Hence, imposing the bound

x ≥ 0

in the case of√x is sufficient to guarantee that the function will only be evaluated in points where it

is differentiable.

However, if a function is differentiable on closed a range, specifying the variable bounds is not sufficient.Consider the function

Page 160: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

142 CHAPTER 10. THE OPTIMIZERS FOR CONTINUOUS PROBLEMS

Parameter name PurposeMSK DPAR INTPNT NL TOL PFEAS Controls primal feasibilityMSK DPAR INTPNT NL TOL DFEAS Controls dual feasibilityMSK DPAR INTPNT NL TOL REL GAP Controls relative gapMSK DPAR INTPNT TOL INFEAS Controls when the problem is declared infeasibleMSK DPAR INTPNT NL TOL MU RED Controls when the complementarity is reduced enough

Table 10.3: Parameters employed in termination criteria.

f(x) =1

x+

1

1− x. (10.6)

In this case the bounds

0 ≤ x ≤ 1

will not guarantee that MOSEK only evaluates the function for x between 0 and 1 . To force MOSEK tostrictly satisfy both bounds on ranged variables set the parameter MSK IPAR INTPNT STARTING POINT

to MSK STARTING POINT SATISFY BOUNDS.

For efficiency reasons it may be better to reformulate the problem than to force MOSEK to observeranged bounds strictly. For instance, (10.6) can be reformulated as follows

f(x) =1

x+

1

y0 = 1− x− y0 ≤ x0 ≤ y.

10.5.1.3 Interior-point termination criteria

The parameters controlling when the general convex interior-point optimizer terminates are shown inTable 10.3.

10.6 Solving problems in parallel

If a computer has multiple CPUs, or has a CPU with multiple cores, it is possible for MOSEK to takeadvantage of this to speed up solution times.

10.6.1 Thread safety

The MOSEK API is thread-safe provided that a task is only modified or accessed from one thread atany given time — accessing two separate tasks from two separate threads at the same time is safe.Sharing an environment between threads is safe.

Page 161: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

10.6. SOLVING PROBLEMS IN PARALLEL 143

10.6.2 The parallelized interior-point optimizer

The interior-point optimizer is capable of using multiple CPUs or cores. This implies that wheneverthe MOSEK interior-point optimizer solves an optimization problem, it will try to divide the work sothat each core gets a share of the work. The user decides how many coress MOSEK should exploit.

It is not always possible to divide the work equally, and often parts of the computations and thecoordination of the work is processed sequentially, even if several cores are present. Therefore, thespeed-up obtained when using multiple cores is highly problem dependent. However, as a rule ofthumb, if the problem solves very quickly, i.e. in less than 60 seconds, it is not advantageous to usethe parallel option.

The MSK IPAR NUM THREADS parameter sets the number of threads (and therefore the number of cores)that the interior point optimizer will use.

10.6.3 The concurrent optimizer

An alternative to the parallel interior-point optimizer is the concurrent optimizer. The idea of theconcurrent optimizer is to run multiple optimizers on the same problem concurrently, for instance,it allows you to apply the interior-point and the dual simplex optimizers to a linear optimizationproblem concurrently. The concurrent optimizer terminates when the first of the applied optimizershas terminated successfully, and it reports the solution of the fastest optimizer. In that way a newoptimizer has been created which essentially performs as the fastest of the interior-point and thedual simplex optimizers. Hence, the concurrent optimizer is the best one to use if there are multipleoptimizers available in MOSEK for the problem and you cannot say beforehand which one will befaster.

Note in particular that any solution present in the task will also be used for hot-starting the simplexalgorithms. One possible scenario would therefore be running a hot-start dual simplex in parallel withinterior point, taking advantage of both the stability of the interior-point method and the ability ofthe simplex method to use an initial solution.

By setting the

MSK IPAR OPTIMIZER

parameter to

MSK OPTIMIZER CONCURRENT

the concurrent optimizer chosen.

The number of optimizers used in parallel is determined by the

MSK IPAR CONCURRENT NUM OPTIMIZERS.

parameter. Moreover, the optimizers are selected according to a preassigned priority with optimizershaving the highest priority being selected first. The default priority for each optimizer is shown inTable 10.6.3. For example, setting the MSK IPAR CONCURRENT NUM OPTIMIZERS parameter to 2 tells theconcurrent optimizer to the apply the two optimizers with highest priorities: In the default case thatmeans the interior-point optimizer and one of the simplex optimizers.

Page 162: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

144 CHAPTER 10. THE OPTIMIZERS FOR CONTINUOUS PROBLEMS

Optimizer Associated Defaultparameter priority

MSK OPTIMIZER INTPNT MSK IPAR CONCURRENT PRIORITY INTPNT 4MSK OPTIMIZER FREE SIMPLEX MSK IPAR CONCURRENT PRIORITY FREE SIMPLEX 3MSK OPTIMIZER PRIMAL SIMPLEX MSK IPAR CONCURRENT PRIORITY PRIMAL SIMPLEX 2MSK OPTIMIZER DUAL SIMPLEX MSK IPAR CONCURRENT PRIORITY DUAL SIMPLEX 1

Table 10.4: Default priorities for optimizer selection in concurrent optimization.

10.6.3.1 Concurrent optimization through the API

The following example shows how to call the concurrent optimizer through the API.

Page 163: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

Chapter 11

The solution summary

All computations inside MOSEK are performed using finite precision floating point numbers. Thisimplies the reported solution isonly be an approximate optimal solution. Therefore after solving anoptimization problem it is important to investigate how good an approximation the solution is. Recallfor a convex optimization problem the optimality conditions are:

• The primal solution must satisfy all the primal constraints.

• The dual solution much satisfy all the dual constraints.

• The primal and dual objective values must be identical.

Thus the solution summary reports information that makes it possible to evaluate the quality of thesolution obtained.

Suppose we have solved a problem as

[rcode,res] = mosekopt(’minimize info’,prob,param)

In case of a linear optimization problem the solution summary may look like

Basic solution summary

Problem status : PRIMAL AND DUAL FEASIBLE

Solution status : OPTIMAL

Primal. obj: -4.6475314286e+002 Viol. con: 2e-014 var: 0e+000

Dual. obj: -4.6475316001e+002 Viol. con: 7e-009 var: 4e-016

The summary reports information for the basic solution. In this case we see:

• The problem status is primal and dual feasible which means the problem has an optimal solution.The problem status can be obtained using res.sol.itr.prosta.

• The solution status is optimal. The solution status can be obtained using res.sol.itr.solsta.

• Next information about the primal solution is reported. The information consists of the objectivevalue and violation meassures for the primal solution. In this case violations for the constraintsand variables are small meaning the solution is very close to being an exact feasible solution.The primal feasibility measure is reported in res.info.MSK DINF INTPNT PRIMAL FEAS.

145

Page 164: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

146 CHAPTER 11. THE SOLUTION SUMMARY

• Similarly for the dual solution the violations are small and hence the dual solution is feasible.The dual feasibility measure is reported in res.info.MSK DINF INTPNT DUAL FEAS.

• Finally, it can be seen that the primal and dual objective values are almost identical. Usingres.info.MSK DINF INTPNT PRIMAL OBJ and res.info.MSK DINF INTPNT DUAL OBJ the primaland dual objective values can be obtained.

To summarize in this case a primal and a dual solution with small feasiblity violations are available.Moreover, the primal and dual objective values are almost identical and hence it can be concludedthat the reported solution is a good approximation to the optimal solution.

Now what happens if the problem does not have an optimal solution e.g. it is primal infeasible. Inthat case the solution summary may look like

Basic solution summary

Problem status : PRIMAL INFEASIBLE

Solution status : PRIMAL INFEASIBLE CER

Dual. obj: 3.5894503823e+004 Viol. con: 0e+000 var: 2e-008

i.e. MOSEK reports that the solution is a certificate of primal infeasibility. Since the problem is primalinfeasible it does not make sense to report any information about the primal solution. However, thedual solution should be a certificate of the primal infeasibility. If the problem is a minimization problemthen the dual objective value should be positive and in the case of a maximization problem it should benegative. The quality of the certificate can be evaluated by comparing the dual objective value to theviolations. Indeed if the objective value is large compared to the largest violation then the certificatehighly accurate. Here is an example

Basic solution summary

Problem status : PRIMAL INFEASIBLE

Solution status : PRIMAL INFEASIBLE CER

Dual. obj: 3.0056574100e-005 Viol. con: 9e-013 var: 2e-011

of a not so strong infeasibility certificate because the dual objective value is small compared to largestviolation.

In the case a problem is dual infeasible then the solution summary may look like

Basic solution summary

Problem status : DUAL INFEASIBLE

Solution status : DUAL INFEASIBLE CER

Primal. obj: -1.4500853392e+001 Viol. con: 0e+000 var: 0e+000

Observe when a solution is a certificate of dual infeasibility then the primal solution contains thecertificate. Moreoever, given the problem is a minimization problem the objective value should negativeand the objective should be large compared to the worst violation if the certificate is strong.

Page 165: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

Chapter 12

The optimizers for mixed-integerproblems

A problem is a mixed-integer optimization problem when one or more of the variables are constrainedto be integer valued. MOSEK contains two optimizers for mixed integer problems that is capable forsolving mixed-integer

• linear,

• quadratic and quadratically constrained, and

• conic

problems.

Readers unfamiliar with integer optimization are recommended to consult some relevant literature,e.g. the book [5] by Wolsey.

12.1 Some concepts and facts related to mixed-integer opti-mization

It is important to understand that in a worst-case scenario, the time required to solve integer optimiza-tion problems grows exponentially with the size of the problem. For instance, assume that a problemcontains n binary variables, then the time required to solve the problem in the worst case may beproportional to 2n . The value of 2n is huge even for moderate values of n .

In practice this implies that the focus should be on computing a near optimal solution quickly ratherthan at locating an optimal solution. Even if the problem is only solved approximately, it is importantto know how far the approximate solution is from an optimal one. In order to say something aboutthe goodness of an approximate solution then the concept of a relaxation is important.

147

Page 166: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

148 CHAPTER 12. THE OPTIMIZERS FOR MIXED-INTEGER PROBLEMS

Name Run-to-run deterministic Parallelized Strength CostMixed-integer conic Yes Yes Conic Free add-onMixed-integer No Partial Linear Payed add-on

Table 12.1: Mixed-integer optimizers.

The mixed-integer optimization problem

z∗ = minimize cTxsubject to Ax = b,

x ≥ 0xj ∈ Z, ∀j ∈ J ,

(12.1)

has the continuous relaxation

z = minimize cTxsubject to Ax = b,

x ≥ 0(12.2)

The continuos relaxation is identical to the mixed-integer problem with the restriction that somevariables must be integer removed.

There are two important observations about the continuous relaxation. Firstly, the continuous relax-ation is usually much faster to optimize than the mixed-integer problem. Secondly if x is any feasiblesolution to (12.1) and

z := cT x

then

z ≤ z∗ ≤ z.

This is an important observation since if it is only possible to find a near optimal solution within areasonable time frame then the quality of the solution can nevertheless be evaluated. The value z isa lower bound on the optimal objective value. This implies that the obtained solution is no furtheraway from the optimum than z − z in terms of the objective value.

Whenever a mixed-integer problem is solved MOSEK rapports this lower bound so that the quality ofthe reported solution can be evaluated.

12.2 The mixed-integer optimizers

MOSEK includes two mixed-integer optimizer which is compared in Table 12.1. Both optimizers canhandle problems with linear, quadratic objective and constraints and conic constraints. However, aproblem must not contain both quadratic objective and constraints and conic constraints.

Page 167: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

12.3. THE MIXED-INTEGER CONIC OPTIMIZER 149

The mixed-integer conic optimizer is specialized for solving linear and conic optimization problems. Itcan also solve pure quadratic and quadratically constrained problems, these problems are automaticallyconverted to conic problems before being solved. Whereas the mixed-integer optimizer deals withquadratic and quadratically constrained problems directly.

The mixed-integer conic optimizer is run-to-run deterministic. This means that if a problem is solvedtwice on the same computer with identical options then the obtained solution will be bit-for-bit identicalfor the two runs. However, if a time limit is set then this may not be case since the time taken to solvea problem is not deterministic. Moreover, the mixed-integer conic optimizer is parallelized i.e. it canexploit multiple cores during the optimization. Finally, the mixed-integer conic optimizer is a free add-on to the continuous optimizers. However, for some linear problems the mixed-integer optimizer mayoutperform the mixed-integer conic optimizer. On the other hand the mixed-integer conic optimizeris included with continuous optimizers free of charge and usually the fastest for conic problems.

None of the mixed-integer optimizers handles symmetric matrix variables i.e semi-definite optimizationproblems.

12.3 The mixed-integer conic optimizer

The mixed-integer conic optimizer is employed by setting the parameter MSK IPAR OPTIMIZER toMSK OPTIMIZER MIXED INT CONIC.

The mixed-integer conic employs three phases:

Presolve:

In this phase the optimizer tries to reduce the size of the problem using preprocessing techniques.Moreover, it strengthens the continuous relaxation, if possible.

Heuristic:

Using heuristics the optimizer tries to guess a good feasible solution.

Optimization:

The optimal solution is located using a variant of the branch-and-cut method.

12.3.1 Presolve

In the preprocessing stage redundant variables and constraints are removed. The presolve stage canbe turned off using the MSK IPAR MIO PRESOLVE USE parameter.

12.3.2 Heuristic

Initially, the integer optimizer tries to guess a good feasible solution using a heuristic.

Page 168: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

150 CHAPTER 12. THE OPTIMIZERS FOR MIXED-INTEGER PROBLEMS

12.3.3 The optimization phase

This phase solves the problem using the branch and cut algorithm.

12.3.4 Caveats

The mixed-integer conic optimizer ignores the parameter

MSK IPAR MIO CONT SOL:

The user should fix all the integer variables at their optimal value and reoptimize instead ofrelying in this option.

12.4 The mixed-integer optimizer

The mixed-integer optimizer is employed by setting the parameter MSK IPAR OPTIMIZER to MSK OPTIMIZER MIXED INT.In the following it is briefly described how the optimizer works.

The process of solving an integer optimization problem can be split in three phases:

Presolve:

In this phase the optimizer tries to reduce the size of the problem using preprocessing techniques.Moreover, it strengthens the continuous relaxation, if possible.

Heuristic:

Using heuristics the optimizer tries to guess a good feasible solution.

Optimization:

The optimal solution is located using a variant of the branch-and-cut method.

12.4.1 Presolve

In the preprocessing stage redundant variables and constraints are removed. The presolve stage canbe turned off using the MSK IPAR MIO PRESOLVE USE parameter.

12.4.2 Heuristic

Initially, the integer optimizer tries to guess a good feasible solution using different heuristics:

• First a very simple rounding heuristic is employed.

• Next, if deemed worthwhile, the feasibility pump heuristic is used.

• Finally, if the two previous stages did not produce a good initial solution, more sophisticatedheuristics are used.

Page 169: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

12.5. TERMINATION CRITERION 151

The following parameters can be used to control the effort made by the integer optimizer to find aninitial feasible solution.

• MSK IPAR MIO HEURISTIC LEVEL: Controls how sophisticated and computationally expensive aheuristic to employ.

• MSK DPAR MIO HEURISTIC TIME: The minimum amount of time to spend in the heuristic search.

• MSK IPAR MIO FEASPUMP LEVEL: Controls how aggressively the feasibility pump heuristic is used.

12.4.3 The optimization phase

This phase solves the problem using the branch and cut algorithm.

12.5 Termination criterion

In general, it is time consuming to find an exact feasible and optimal solution to an integer optimizationproblem, though in many practical cases it may be possible to find a sufficiently good solution. There-fore, the mixed-integer optimizer employs a relaxed feasibility and optimality criterion to determinewhen a satisfactory solution is located.

A candidate solution that is feasible to the continuous relaxation is said to be an integer feasiblesolution if the criterion

min(|xj | − bxjc, dxje − |xj |) ≤ max(δ1, δ2|xj |) ∀j ∈ J

is satisfied.

Whenever the integer optimizer locates an integer feasible solution it will check if the criterion

z − z ≤ max(δ3, δ4max(1, |z| ))

is satisfied. If this is the case, the integer optimizer terminates and reports the integer feasible solutionas an optimal solution. Please note that z is a valid lower bound determined by the integer optimizerduring the solution process, i.e.

z ≤ z∗.

The lower bound z normally increases during the solution process.

12.5.1 Relaxed termination

If an optimal solution cannot be located within a reasonable time, it may be advantageous to employa relaxed termination criterion after some time. Whenever the integer optimizer locates an integer feasi-ble solution and has spent at least the number of seconds defined by the MSK DPAR MIO DISABLE TERM TIME

parameter on solving the problem, it will check whether the criterion

Page 170: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

152 CHAPTER 12. THE OPTIMIZERS FOR MIXED-INTEGER PROBLEMS

Tolerance Parameter nameδ1 MSK DPAR MIO TOL ABS RELAX INT

δ2 MSK DPAR MIO TOL REL RELAX INT

δ3 MSK DPAR MIO TOL ABS GAP

δ4 MSK DPAR MIO TOL REL GAP

δ5 MSK DPAR MIO NEAR TOL ABS GAP

δ6 MSK DPAR MIO NEAR TOL REL GAP

Table 12.2: Integer optimizer tolerances.

Parameter name Delayed ExplanationMSK IPAR MIO MAX NUM BRANCHES Yes Maximum number of branches allowed.MSK IPAR MIO MAX NUM RELAXS Yes Maximum number of realizations allowed.MSK IPAR MIO MAX NUM SOLUTIONS Yes Maximum number of feasible integer solutions allowed.

Table 12.3: Parameters affecting the termination of the integer optimizer.

z − z ≤ max(δ5, δ6max(1, |z| ))

is satisfied. If it is satisfied, the optimizer will report that the candidate solution is near optimal andthen terminate. Please note that since this criteria depends on timing, the optimizer will not be runto run deterministic.

12.5.2 Important parameters

All δ tolerances can be adjusted using suitable parameters — see Table 12.2. In Table 12.3 some otherparameters affecting the integer optimizer termination criterion are shown. Please note that if theeffect of a parameter is delayed, the associated termination criterion is applied only after some time,specified by the MSK DPAR MIO DISABLE TERM TIME parameter.

12.6 How to speed up the solution process

As mentioned previously, in many cases it is not possible to find an optimal solution to an integeroptimization problem in a reasonable amount of time. Some suggestions to reduce the solution timeare:

• Relax the termination criterion: In case the run time is not acceptable, the first thing to do isto relax the termination criterion — see Section 12.5 for details.

• Specify a good initial solution: In many cases a good feasible solution is either known or easilycomputed using problem specific knowledge. If a good feasible solution is known, it is usuallyworthwhile to use this as a starting point for the integer optimizer.

Page 171: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

12.7. UNDERSTANDING SOLUTION QUALITY 153

• Improve the formulation: A mixed-integer optimization problem may be impossible to solvein one form and quite easy in another form. However, it is beyond the scope of this manualto discuss good formulations for mixed-integer problems. For discussions on this topic see forexample [5].

12.7 Understanding solution quality

To determine the quality of the solution one should check the following:

• The solution status key returned by MOSEK.

• The optimality gap: A measure for how much the located solution can deviate from the optimalsolution to the problem.

• Feasibility. How much the solution violates the constraints of the problem.

The optimality gap is a measure for how close the solution is to the optimal solution. The optimalitygap is given by

ε = |(objective value of feasible solution)− (objective bound)|.

The objective value of the solution is guarantied to be within ε of the optimal solution.

The optimality gap can be retrieved through the solution item MSK DINF MIO OBJ ABS GAP. Often it ismore meaningful to look at the optimality gap normalized with the magnitude of the solution. Therelative optimality gap is available in MSK DINF MIO OBJ REL GAP.

Page 172: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

154 CHAPTER 12. THE OPTIMIZERS FOR MIXED-INTEGER PROBLEMS

Page 173: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

Chapter 13

The solution summary for mixedinteger problems

The solution summary for a mixed-integer problem may look like

Integer solution solution summary

Problem status : PRIMAL FEASIBLE

Solution status : INTEGER OPTIMAL

Primal. obj: 4.0593518000e+005 Viol. con: 4e-015 var: 3e-014 itg: 3e-014

The main diffrence compared to continous case covered previously is that no information about thedual solution is provided. Simply because there is no dual solution available for a mixed integerproblem. In this case it can be seen that the solution is higly feasible because the violations are small.Moreoever, the solution is denoted integer optimal. Observe itg: 3e-014 implies that all the integerconstrained variables are at most 3e− 014 from being an exact integer.

155

Page 174: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

156 CHAPTER 13. THE SOLUTION SUMMARY FOR MIXED INTEGER PROBLEMS

Page 175: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

Chapter 14

The analyzers

14.1 The problem analyzer

The problem analyzer prints a detailed survey of the

• linear constraints and objective

• quadratic constraints

• conic constraints

• variables

of the model.

In the initial stages of model formulation the problem analyzer may be used as a quick way of verifyingthat the model has been built or imported correctly. In later stages it can help revealing specialstructures within the model that may be used to tune the optimizer’s performance or to identify thecauses of numerical difficulties.

The problem analyzer is run using the mosekopt(’anapro’) command and produces something similarto the following (this is the problemanalyzer’s survey of the aflow30a problem from the MIPLIB 2003collection, see Appendix 26 for more examples):

Analyzing the problem

Constraints Bounds Variables

upper bd: 421 ranged : all cont: 421

fixed : 58 bin : 421

-------------------------------------------------------------------------------

Objective, min cx

range: min |c|: 0.00000 min |c|>0: 11.0000 max |c|: 500.000

distrib: |c| vars

0 421

157

Page 176: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

158 CHAPTER 14. THE ANALYZERS

[11, 100) 150

[100, 500] 271

-------------------------------------------------------------------------------

Constraint matrix A has

479 rows (constraints)

842 columns (variables)

2091 (0.518449%) nonzero entries (coefficients)

Row nonzeros, A i

range: min A i: 2 (0.23753%) max A i: 34 (4.038%)

distrib: A i rows rows% acc%

2 421 87.89 87.89

[8, 15] 20 4.18 92.07

[16, 31] 30 6.26 98.33

[32, 34] 8 1.67 100.00

Column nonzeros, A|j

range: min A|j: 2 (0.417537%) max A|j: 3 (0.626305%)

distrib: A|j cols cols% acc%

2 435 51.66 51.66

3 407 48.34 100.00

A nonzeros, A(ij)

range: min |A(ij)|: 1.00000 max |A(ij)|: 100.000

distrib: A(ij) coeffs

[1, 10) 1670

[10, 100] 421

-------------------------------------------------------------------------------

Constraint bounds, lb <= Ax <= ub

distrib: |b| lbs ubs

0 421

[1, 10] 58 58

Variable bounds, lb <= x <= ub

distrib: |b| lbs ubs

0 842

[1, 10) 421

[10, 100] 421

-------------------------------------------------------------------------------

The survey is divided into six different sections, each described below. To keep the presentation shortwith focus on key elements the analyzer generally attempts to display information on issues relevantfor the current model only: E.g., if the model does not have any conic constraints (this is the case inthe example above) or any integer variables, those parts of the analysis will not appear.

14.1.1 General characteristics

The first part of the survey consists of a brief summary of the model’s linear and quadratic constraints(indexed by i ) and variables (indexed by j ). The summary is divided into three subsections:

Page 177: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

14.1. THE PROBLEM ANALYZER 159

Constraints

upper bd:

The number of upper bounded constraints,∑n−1j=0 aijxj ≤ uci

lower bd:

The number of lower bounded constraints, lci ≤∑n−1j=0 aijxj

ranged :

The number of ranged constraints, lci ≤∑n−1j=0 aijxj ≤ uci

fixed :

The number of fixed constraints, lci =∑n−1j=0 aijxj = uci

free :

The number of free constraints

Bounds

upper bd:

The number of upper bounded variables, xj ≤ uxjlower bd:

The number of lower bounded variables, lxk ≤ xjranged :

The number of ranged variables, lxk ≤ xj ≤ uxjfixed :

The number of fixed variables, lxk = xj = uxj

free :

The number of free variables

Variables

cont:

The number of continuous variables, xj ∈ R

bin :

The number of binary variables, xj ∈ 0, 1

int :

The number of general integer variables, xj ∈ Z

Only constraints, bounds and domains actually in the model will be reported on, cf. appendix 26; ifall entities in a section turn out to be of the same kind, the number will be replaced by all for brevity.

Page 178: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

160 CHAPTER 14. THE ANALYZERS

14.1.2 Objective

The second part of the survey focuses on (the linear part of) the objective, summarizing the opti-mization sense and the coefficients’ absolute value range and distribution. The number of 0 (zero)coefficients is singled out (if any such variables are in the problem).

The range is displayed using three terms:

min |c|:

The minimum absolute value among all coeffecients

min |c|>0:

The minimum absolute value among the nonzero coefficients

max |c|:

The maximum absolute value among the coefficients

If some of these extrema turn out to be equal, the display is shortened accordingly:

• If min |c| is greater than zero, the min |c|?0 term is obsolete and will not be displayed

• If only one or two different coefficients occur this will be displayed using all and an explicitlisting of the coefficients

The absolute value distribution is displayed as a table summarizing the numbers by orders of magnitude(with a ratio of 10). Again, the number of variables with a coefficient of 0 (if any) is singled out. Eachline of the table is headed by an interval (half-open intervals including their lower bounds), and isfollowed by the number of variables with their objective coefficient in this interval. Intervals with noelements are skipped.

14.1.3 Linear constraints

The third part of the survey displays information on the nonzero coefficients of the linear constraintmatrix.

Following a brief summary of the matrix dimensions and the number of nonzero coefficients in total,three sections provide further details on how the nonzero coefficients are distributed by row-wise count(A i), by column-wise count (A|j), and by absolute value (|A(ij)|). Each section is headed bya brief display of the distribution’s range (min and max), and for the row/column-wise counts thecorresponding densities are displayed too (in parentheses).

The distribution tables single out three particularly interesting counts: zero, one, and two nonzerosper row/column; the remaining row/column nonzeros are displayed by orders of magnitude (ratio 2).For each interval the relative and accumulated relative counts are also displayed.

Note that constraints may have both linear and quadratic terms, but the empty rows and columnsreported in this part of the survey relate to the linear terms only. If empty rows and/or columns arefound in the linear constraint matrix, the problem is analyzed further in order to determine if the

Page 179: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

14.2. ANALYZING INFEASIBLE PROBLEMS 161

corresponding constraints have any quadratic terms or the corresponding variables are used in conicor quadratic constraints; cf. the last two examples of appendix 26.

The distribution of the absolute values, |A(ij)|, is displayed just as for the objective coefficientsdescribed above.

14.1.4 Constraint and variable bounds

The fourth part of the survey displays distributions for the absolute values of the finite lower and upperbounds for both constraints and variables. The number of bounds at 0 is singled out and, otherwise,displayed by orders of magnitude (with a ratio of 10).

14.1.5 Quadratic constraints

The fifth part of the survey displays distributions for the nonzero elements in the gradient of thequadratic constraints, i.e. the nonzero row counts for the column vectors Qx . The table is similar tothe tables for the linear constraints’ nonzero row and column counts described in the survey’s thirdpart.

Note: Quadratic constraints may also have a linear part, but that will be included in the linearconstraints survey; this means that if a problem has one or more pure quadratic constraints, part threeof the survey will report an equal number of linear constraint rows with 0 (zero) nonzeros, cf. the lastexample in appendix 26. Likewise, variables that appear in quadratic terms only will be reported asempty columns (0 nonzeros) in the linear constraint report.

14.1.6 Conic constraints

The last part of the survey summarizes the model’s conic constraints. For each of the two types ofcones, quadratic and rotated quadratic, the total number of cones are reported, and the distributionof the cones’ dimensions are displayed using intervals. Cone dimensions of 2, 3, and 4 are singled out.

14.2 Analyzing infeasible problems

When developing and implementing a new optimization model, the first attempts will often be eitherinfeasible, due to specification of inconsistent constraints, or unbounded, if important constraints havebeen left out.

In this chapter we will

• go over an example demonstrating how to locate infeasible constraints using the MOSEK infea-sibility report tool,

• discuss in more general terms which properties that may cause infeasibilities, and

• present the more formal theory of infeasible and unbounded problems.

Page 180: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

162 CHAPTER 14. THE ANALYZERS

Supply Demand

1

2

5

2

1

2

1

Plant 1

Plant 2

Plant 3Store 4

Store 3

Store 2

Store 1

1000

1000

200

500

500

2001100

Figure 14.1: Supply, demand and cost of transportation.

14.2.1 Example: Primal infeasibility

A problem is said to be primal infeasible if no solution exists that satisfy all the constraints of theproblem.

As an example of a primal infeasible problem consider the problem of minimizing the cost of trans-portation between a number of production plants and stores: Each plant produces a fixed number ofgoods, and each store has a fixed demand that must be met. Supply, demand and cost of transporta-tion per unit are given in figure 14.1. The problem represented in figure 14.1 is infeasible, since thetotal demand

2300 = 1100 + 200 + 500 + 500

exceeds the total supply

2200 = 200 + 1000 + 1000

If we denote the number of transported goods from plant i to store j by xij , the problem can beformulated as the LP:

Page 181: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

14.2. ANALYZING INFEASIBLE PROBLEMS 163

minimize x11 + 2x12 + 5x23 + 2x24 + x31 + 2x33 + x34

subject to x11 + x12 ≤ 200,x23 + x24 ≤ 1000,

x31 + x33 + x34 ≤ 1000,x11 + x31 = 1100,

x12 = 200,x23 + x33 = 500,

x24 + x34 = 500,xij ≥ 0.

(14.1)Solving the problem (14.1) using MOSEK will result in a solution, a solution status and a problemstatus. Among the log output from the execution of MOSEK on the above problem are the lines:

Basic solution

Problem status : PRIMAL INFEASIBLE

Solution status : PRIMAL INFEASIBLE CER

The first line indicates that the problem status is primal infeasible. The second line says that acertificate of the infeasibility was found. The certificate is returned in place of the solution to theproblem.

14.2.2 Locating the cause of primal infeasibility

Usually a primal infeasible problem status is caused by a mistake in formulating the problem andtherefore the question arises: ”What is the cause of the infeasible status?” When trying to answer thisquestion, it is often advantageous to follow these steps:

• Remove the objective function. This does not change the infeasible status but simplifies theproblem, eliminating any possibility of problems related to the objective function.

• Consider whether your problem has some necessary conditions for feasibility and examine if theseare satisfied, e.g. total supply should be greater than or equal to total demand.

• Verify that coefficients and bounds are reasonably sized in your problem.

If the problem is still primal infeasible, some of the constraints must be relaxed or removed completely.The MOSEK infeasibility report (Section 14.2.4) may assist you in finding the constraints causing theinfeasibility.

Possible ways of relaxing your problem include:

• Increasing (decreasing) upper (lower) bounds on variables and constraints.

• Removing suspected constraints from the problem.

Returning to the transportation example, we discover that removing the fifth constraint

x12 = 200

Page 182: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

164 CHAPTER 14. THE ANALYZERS

makes the problem feasible.

14.2.3 Locating the cause of dual infeasibility

A problem may also be dual infeasible. In this case the primal problem is often unbounded, meningthat feasbile solutions exists such that the objective tends towards infinity. An example of a dualinfeasible and primal unbounded problem is:

minimize x1

subject to x1 ≤ 5.

To resolve a dual infeasibility the primal problem must be made more restricted by

• Adding upper or lower bounds on variables or constraints.

• Removing variables.

• Changing the objective.

14.2.3.1 A cautious note

The problem

minimize 0subject to 0 ≤ x1,

xj ≤ xj+1, j = 1, . . . , n− 1,xn ≤ − 1

is clearly infeasible. Moreover, if any one of the constraints are dropped, then the problem becomesfeasible.

This illustrates the worst case scenario that all, or at least a significant portion, of the constraints areinvolved in the infeasibility. Hence, it may not always be easy or possible to pinpoint a few constraintswhich are causing the infeasibility.

14.2.4 The infeasibility report

MOSEK includes functionality for diagnosing the cause of a primal or a dual infeasibility. It can beturned on by setting the MSK IPAR INFEAS REPORT AUTO to MSK ON. This causes MOSEK to print areport on variables and constraints involved in the infeasibility.

The MSK IPAR INFEAS REPORT LEVEL parameter controls the amount of information presented in theinfeasibility report. The default value is 1 .

Page 183: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

14.2. ANALYZING INFEASIBLE PROBLEMS 165

14.2.4.1 Example: Primal infeasibility

We will reuse the example (14.1) located in infeas.lp:

\\ An example of an infeasible linear problem.

\minimize

obj: + 1 x11 + 2 x12 + 1 x13

+ 4 x21 + 2 x22 + 5 x23

+ 4 x31 + 1 x32 + 2 x33

st

s0: + x11 + x12 <= 200

s1: + x23 + x24 <= 1000

s2: + x31 +x33 + x34 <= 1000

d1: + x11 + x31 = 1100

d2: + x12 = 200

d3: + x23 + x33 = 500

d4: + x24 + x34 = 500

bounds

end

Using the command line (please remeber it accepts options following the C API format)

mosek -d MSK IPAR INFEAS REPORT AUTO MSK ON infeas.lp

MOSEK produces the following infeasibility report

MOSEK PRIMAL INFEASIBILITY REPORT.

Problem status: The problem is primal infeasible

The following constraints are involved in the primal infeasibility.

Index Name Lower bound Upper bound Dual lower Dual upper

0 s0 NONE 2.000000e+002 0.000000e+000 1.000000e+000

2 s2 NONE 1.000000e+003 0.000000e+000 1.000000e+000

3 d1 1.100000e+003 1.100000e+003 1.000000e+000 0.000000e+000

4 d2 2.000000e+002 2.000000e+002 1.000000e+000 0.000000e+000

The following bound constraints are involved in the infeasibility.

Index Name Lower bound Upper bound Dual lower Dual upper

8 x33 0.000000e+000 NONE 1.000000e+000 0.000000e+000

10 x34 0.000000e+000 NONE 1.000000e+000 0.000000e+000

The infeasibility report is divided into two sections where the first section shows which constraints thatare important for the infeasibility. In this case the important constraints are the ones named s0, s2, d1,and d2. The values in the columns ”Dual lower” and ”Dual upper” are also useful, since a non-zerodual lower value for a constraint implies that the lower bound on the constraint is important for theinfeasibility. Similarly, a non-zero dual upper value implies that the upper bound on the constraint isimportant for the infeasibility.

It is also possible to obtain the infeasible subproblem. The command line

mosek -d MSK IPAR INFEAS REPORT AUTO MSK ON infeas.lp -info rinfeas.lp

produces the files rinfeas.bas.inf.lp. In this case the content of the file rinfeas.bas.inf.lp is

minimize

Page 184: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

166 CHAPTER 14. THE ANALYZERS

Obj: + CFIXVAR

st

s0: + x11 + x12 <= 200

s2: + x31 + x33 + x34 <= 1e+003

d1: + x11 + x31 = 1.1e+003

d2: + x12 = 200

bounds

x11 free

x12 free

x13 free

x21 free

x22 free

x23 free

x31 free

x32 free

x24 free

CFIXVAR = 0e+000

end

which is an optimization problem. This problem is identical to (14.1), except that the objective andsome of the constraints and bounds have been removed. Executing the command

mosek -d MSK IPAR INFEAS REPORT AUTO MSK ON infeas.bas.inf.lp

demonstrates that the reduced problem is primal infeasible. Since the reduced problem is usuallysmaller than original problem, it should be easier to locate the cause of the infeasibility in this ratherthan in the original (14.1).

14.2.4.2 Example: Dual infeasibility

The example problem

maximize - 200 y1 - 1000 y2 - 1000 y3

- 1100 y4 - 200 y5 - 500 y6

- 500 y7

subject to

x11: y1+y4 < 1

x12: y1+y5 < 2

x23: y2+y6 < 5

x24: y2+y7 < 2

x31: y3+y4 < 1

x33: y3+y6 < 2

x44: y3+y7 < 1

bounds

y1 < 0

y2 < 0

y3 < 0

y4 free

y5 free

y6 free

y7 free

end

is dual infeasible. This can be verified by proving that

y1=-1, y2=-1, y3=0, y4=1, y5=1

is a certificate of dual infeasibility. In this example the following infeasibility report is produced

Page 185: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

14.2. ANALYZING INFEASIBLE PROBLEMS 167

(slightly edited):

The following constraints are involved in the infeasibility.

Index Name Activity Objective Lower bound Upper bound

0 x11 -1.000000e+00 NONE 1.000000e+00

4 x31 -1.000000e+00 NONE 1.000000e+00

The following variables are involved in the infeasibility.

Index Name Activity Objective Lower bound Upper bound

3 y4 -1.000000e+00 -1.100000e+03 NONE NONE

Interior-point solution

Problem status : DUAL INFEASIBLE

Solution status : DUAL INFEASIBLE CER

Primal - objective: 1.1000000000e+03 eq. infeas.: 0.00e+00 max bound infeas.: 0.00e+00 cone infeas.: 0.00e+00

Dual - objective: 0.0000000000e+00 eq. infeas.: 0.00e+00 max bound infeas.: 0.00e+00 cone infeas.: 0.00e+00

Let x∗ denote the reported primal solution. MOSEK states

• that the problem is dual infeasible,

• that the reported solution is a certificate of dual infeasibility, and

• that the infeasibility measure for x∗ is approximately zero.

Since it was an maximization problem, this implies that

ctx∗ > 0. (14.2)

For a minimization problem this inequality would have been reversed — see (14.5).

From the infeasibility report we see that the variable y4, and the constraints x11 and x33 are involvedin the infeasibility since these appear with non-zero values in the ”Activity” column.

One possible strategy to ”fix” the infeasibility is to modify the problem so that the certificate ofinfeasibility becomes invalid. In this case we may do one the following things:

• Put a lower bound in y3. This will directly invalidate the certificate of dual infeasibility.

• Increase the object coefficient of y3. Changing the coefficients sufficiently will invalidate theinequality (14.2) and thus the certificate.

• Put lower bounds on x11 or x31. This will directly invalidate the certificate of infeasibility.

Please note that modifying the problem to invalidate the reported certificate does not imply that theproblem becomes dual feasible — the infeasibility may simply ”move”, resulting in a new infeasibility.

More often, the reported certificate can be used to give a hint about errors or inconsistencies in themodel that produced the problem.

Page 186: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

168 CHAPTER 14. THE ANALYZERS

14.2.5 Theory concerning infeasible problems

This section discusses the theory of infeasibility certificates and how MOSEK uses a certificate toproduce an infeasibility report. In general, MOSEK solves the problem

minimize cTx+ cf

subject to lc ≤ Ax ≤ uc,lx ≤ x ≤ ux

(14.3)

where the corresponding dual problem is

maximize (lc)T scl − (uc)T scu+ (lx)T sxl − (ux)T sxu + cf

subject to AT y + sxl − sxu = c,− y + scl − scu = 0,

scl , scu, s

xl , s

xu ≥ 0.

(14.4)

We use the convension that for any bound that is not finite, the corresponding dual variable is fixedat zero (and thus will have no influence on the dual problem). For example

lxj = −∞ ⇒ (sxl )j = 0

14.2.6 The certificate of primal infeasibility

A certificate of primal infeasibility is any solution to the homogenized dual problem

maximize (lc)T scl − (uc)T scu+ (lx)T sxl − (ux)T sxu

subject to AT y + sxl − sxu = 0,− y + scl − scu = 0,

scl , scu, s

xl , s

xu ≥ 0.

with a positive objective value. That is, (sc∗l , sc∗u , s

x∗l , s

x∗u ) is a certificate of primal infeasibility if

(lc)T sc∗l − (uc)T sc∗u + (lx)T sx∗l − (ux)T sx∗u > 0

and

AT y + sx∗l − sx∗u = 0,− y + sc∗l − sc∗u = 0,sc∗l , s

c∗u , s

x∗l , s

x∗u ≥ 0.

The well-known Farkas Lemma tells us that (14.3) is infeasible if and only if a certificate of primalinfeasibility exists.

Let (sc∗l , sc∗u , s

x∗l , s

x∗u ) be a certificate of primal infeasibility then

Page 187: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

14.2. ANALYZING INFEASIBLE PROBLEMS 169

(sc∗l )i > 0((sc∗u )i > 0)

implies that the lower (upper) bound on the i th constraint is important for the infeasibility. Further-more,

(sx∗l )j > 0((sx∗u )i > 0)

implies that the lower (upper) bound on the j th variable is important for the infeasibility.

14.2.7 The certificate of dual infeasibility

A certificate of dual infeasibility is any solution to the problem

minimize cTxsubject to lc ≤ Ax ≤ uc,

lx ≤ x ≤ ux

with negative objective value, where we use the definitions

lci :=

0, lci > −∞,−∞, otherwise,

, uci :=

0, uci <∞,∞, otherwise,

and

lxi :=

0, lxi > −∞,−∞, otherwise,

and uxi :=

0, uxi <∞,∞, otherwise.

Stated differently, a certificate of dual infeasibility is any x∗ such that

cTx∗ < 0,lc ≤ Ax∗ ≤ uc,lx ≤ x∗ ≤ ux

(14.5)

The well-known Farkas Lemma tells us that (14.4) is infeasible if and only if a certificate of dualinfeasibility exists.

Note that if x∗ is a certificate of dual infeasibility then for any j such that

x∗j 6= 0,

variable j is involved in the dual infeasibility.

Page 188: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

170 CHAPTER 14. THE ANALYZERS

Page 189: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

Chapter 15

Primal feasibility repair

Section 14.2.2 discusses how MOSEK treats infeasible problems. In particular, it is discussed whichinformation MOSEK returns when a problem is infeasible and how this information can be used topinpoint the cause of the infeasibility.

In this section we discuss how to repair a primal infeasible problem by relaxing the constraints in acontrolled way. For the sake of simplicity we discuss the method in the context of linear optimization.

15.1 Manual repair

Subsequently we discuss an automatic method for repairing an infeasible optimization problem. How-ever, it should be observed that the best way to repair an infeasible problem usually depends on whatthe optimization problem models. For instance in many optimization problem it does not make senseto relax the constraints x ≥ 0 e.g. it is not possible to produce a negative quantity. Hence, whateverautomatic method MOSEK provides it will never be as good as a method that exploits knowledgeabout what is being modelled. This implies that it is usually better to remove the underlying cause ofinfeasibility at the modelling stage.

Indeed consider the example

minimizesubject to x1 + x2 = 1,

x3 + x4 = 1,− x1 − x3 = − 1 + ε

− x2 − x4 = − 1,x1, x2, x3, x4 ≥ 0

(15.1)

then if we add the equalties together we obtain the implied equality

0 = ε

171

Page 190: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

172 CHAPTER 15. PRIMAL FEASIBILITY REPAIR

which is infeasible for any ε 6= 0. Here the infeasibility is caused by a linear dependency in the constraintmatrix and that the right-hand side does not match if ε 6= 0. Observe even if the problem is feasiblethen just a tiny perturbation to the right-hand side will make the problem infeasible. Therefore, eventhough the problem can be repaired then a much more robust solution is to avoid problems with lineardependent constraints. Indeed if a problem contains linear dependencies then the problem is eitherinfeasible or contains redundant constraints. In the above case any of the equality constraints can beremoved while not changing the set of feasible solutions.

To summarize linear dependencies in the constraints can give rise to infeasible problems and thereforeit is better to avoid them. Note that most network flow models usually is formulated with one lineardependent constraint.

Next consider the problem

minimizesubject to x1 − 0.01x2 = 0

x2 − 0.01x3 = 0x3 − 0.01x4 = 0

x1 ≥ − 1.0e− 9x1 ≤ 1.0e− 9x4 ≤ − 1.0e− 4

(15.2)

Now the MOSEK presolve for the sake of efficiency fix variables (and constraints) that has tight boundswhere tightness is controlled by the parameter MSK DPAR PRESOLVE TOL X. Since, the bounds

−1.0e− 9 ≤ x1 ≤ 1.0e− 9

are tight then the MOSEK presolve will fix variable x1 at the mid point between the bounds i.e. at 0.It easy to see that this implies x4 = 0 too which leads to the incorrect conclusion that the problem isinfeasible. Observe tiny change of the size 1.0e-9 make the problem switch from feasible to infeasible.Such a problem is inherently unstable and is hard to solve. We normally call such a problem ill-posed.In general it is recommended to avoid ill-posed problems, but if that is not possible then one solutionto this issue is is to reduce the parameter to say MSK DPAR PRESOLVE TOL X to say 1.0e-10. This willat least make sure that the presolve does not make the wrong conclusion.

15.2 Automatic repair

In this section we will describe the idea behind a method that automatically can repair an infeasibleprobem. The main idea can be described as follows.

Consider the linear optimization problem with m constraints and n variables

minimize cTx+ cf

subject to lc ≤ Ax ≤ uc,lx ≤ x ≤ ux,

(15.3)

which is assumed to be infeasible.

Page 191: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

15.2. AUTOMATIC REPAIR 173

One way of making the problem feasible is to reduce the lower bounds and increase the upper bounds.If the change is sufficiently large the problem becomes feasible. Now an obvious idea is to computethe optimal relaxation by solving an optimization problem. The problem

minimize p(vcl , vcu, v

xl , v

xu)

subject to lc ≤ Ax+ vcl − vcu ≤ uc,lx ≤ x+ vxl − vxu ≤ ux,

vcl , vcu, v

xl , v

xu ≥ 0

(15.4)

does exactly that. The additional variables (vcl )i, (vcu)i, (vxl )j and (vcu)j are elasticity variables becausethey allow a constraint to be violated and hence add some elasticity to the problem. For instance,the elasticity variable (vcl )i controls how much the lower bound (lc)i should be relaxed to make theproblem feasible. Finally, the so-called penalty function

p(vcl , vcu, v

xl , v

xu)

is chosen so it penalize changes to bounds. Given the weights

• wcl ∈ Rm (associated with lc ),

• wcu ∈ Rm (associated with uc ),

• wxl ∈ Rn (associated with lx ),

• wxu ∈ Rn (associated with ux ),

then a natural choice is

p(vcl , vcu, v

xl , v

xu) = (wcl )

T vcl + (wcu)T vcu + (wxl )T vxl + (wxu)T vxu. (15.5)

Hence, the penalty function p() is a weighted sum of the relaxation and therefore the problem (15.4)keeps the amount of relaxation at a minimum. Please observe that

• the problem (15.6) is always feasible.

• a negative weight implies problem (15.6) is unbounded. For this reason if the value of a weightis negative MOSEK fixes the associated elasticity variable to zero. Clearly, if one or more of theweights are negative may imply that it is not possible repair the problem.

A simple choice of weights is to let them all to be 1, but of course that does not take into account thatconstraints may have different importance.

15.2.1 Caveats

Observe if the infeasible problem

Page 192: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

174 CHAPTER 15. PRIMAL FEASIBILITY REPAIR

minimize x+ zsubject to x = − 1,

x ≥ 0(15.6)

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

Another and more important caveat is that only a minimial repair is perfomed i.e. the repair that justmake the problem feasible. Hence, the repaired problem is barely feasible and that sometimes makethe repaired problem hard to solve.

15.3 Feasibility repair in MOSEK

MOSEK includes a function that repair an infeasible problem using the idea described in the previoussection simply by passing a set of weights to MOSEK. This can be used for linear and conic optimizationproblems, possibly having integer constrained variables.

15.3.1 An example using feasibility repair

Consider the example linear optimization

minimize − 10x1 − 9x2,subject to 7/10x1 + 1x2 ≤ 630,

1/2x1 + 5/6x2 ≤ 600,1x1 + 2/3x2 ≤ 708,

1/10x1 + 1/4x2 ≤ 135,x1, x2 ≥ 0,

x2 ≥ 650

(15.7)

which is infeasible. Now suppose we wish to use MOSEK to suggest a modification to the bounds thatmakes the problem feasible.

The following example

[r,res]=mosekopt(’read(feasrepair.lp)’);

res.prob.primalrepair = [];

res.prob.primalrepair.wux = [1,1];

res.prob.primalrepair.wlx = [1,1];

res.prob.primalrepair.wuc = [1,1,1,1];

res.prob.primalrepair.wlc = [1,1,1,1];

param.MSK IPAR LOG FEAS REPAIR = 3;

[r,res]=mosekopt(’minimize primalrepair’,res.prob,param);

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.If the fields wlx, wux, wlc or wuc are not specified, they are all assumed to be 1-vectors of appropriatedimensions.

Page 193: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

15.3. FEASIBILITY REPAIR IN MOSEK 175

The output from running the commands above is:

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

Open file ’feasrepair.lp’

Read summary

Type : LO (linear optimization problem)

Objective sense : min

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

Page 194: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

176 CHAPTER 15. PRIMAL FEASIBILITY REPAIR

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

0 0.00

Dual basis identification phase terminated. Time: 0.00

Basis identification terminated. Time: 0.00

Interior-point optimizer terminated. Time: 0.00.

Optimizer terminated. Time: 0.03

Basic solution summary

Problem status : PRIMAL AND DUAL FEASIBLE

Solution status : OPTIMAL

Primal. obj: 4.2500000000e+001 Viol. con: 1e-013 var: 0e+000

Dual. obj: 4.2500000000e+001 Viol. con: 0e+000 var: 5e-013

Optimal objective value of the penalty problem: 4.250000000000e+001

Repairing bounds.

Increasing the upper bound -2.25e+001 on constraint ’c4’ (3) with 1.35e+002.

Decreasing the lower bound 6.50e+002 on variable ’x2’ (4) with 2.00e+001.

Primal feasibility repair terminated.

Optimizer started.

Interior-point optimizer started.

Presolve started.

Presolve terminated. Time: 0.00

Interior-point optimizer terminated. Time: 0.00.

Optimizer terminated. Time: 0.00

Interior-point solution summary

Problem status : PRIMAL AND DUAL FEASIBLE

Solution status : OPTIMAL

Primal. obj: -5.6700000000e+003 Viol. con: 0e+000 var: 0e+000

Dual. obj: -5.6700000000e+003 Viol. con: 0e+000 var: 0e+000

Basic solution summary

Problem status : PRIMAL AND DUAL FEASIBLE

Solution status : OPTIMAL

Primal. obj: -5.6700000000e+003 Viol. con: 0e+000 var: 0e+000

Dual. obj: -5.6700000000e+003 Viol. con: 0e+000 var: 0e+000

Optimizer summary

Optimizer - time: 0.00

Interior-point - iterations : 0 time: 0.00

Basis identification - time: 0.00

Primal - iterations : 0 time: 0.00

Dual - iterations : 0 time: 0.00

Clean primal - iterations : 0 time: 0.00

Clean dual - iterations : 0 time: 0.00

Clean primal-dual - iterations : 0 time: 0.00

Simplex - time: 0.00

Primal simplex - iterations : 0 time: 0.00

Dual simplex - iterations : 0 time: 0.00

Page 195: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

15.3. FEASIBILITY REPAIR IN MOSEK 177

Primal-dual simplex - iterations : 0 time: 0.00

Mixed integer - relaxations: 0 time: 0.00

reports the optimal repair. In this case it is to increase the upper bound on constraint c4 by 1.35e2and decrease the lower bound on variable x2 by 20.

Page 196: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

178 CHAPTER 15. PRIMAL FEASIBILITY REPAIR

Page 197: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

Chapter 16

Sensitivity analysis

16.1 Introduction

Given an optimization problem it is often useful to obtain information about how the optimal objectivevalue changes when the problem parameters are perturbed. E.g, assume that a bound represents acapacity of a machine. Now, it may be possible to expand the capacity for a certain cost and hence itis worthwhile knowing what the value of additional capacity is. This is precisely the type of questionsthe sensitivity analysis deals with.

Analyzing how the optimal objective value changes when the problem data is changed is called sensi-tivity analysis.

16.2 Restrictions

Currently, sensitivity analysis is only available for continuous linear optimization problems. Moreover,MOSEK can only deal with perturbations in bounds and objective coefficients.

16.3 References

The book [1] discusses the classical sensitivity analysis in Chapter 10 whereas the book [18] presentsa modern introduction to sensitivity analysis. Finally, it is recommended to read the short paper [19]to avoid some of the pitfalls associated with sensitivity analysis.

179

Page 198: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

180 CHAPTER 16. SENSITIVITY ANALYSIS

f( )β

0 ββ β1 2

f( )β

0 βββ 21

Figure 16.1: The optimal value function flci (β). Left: β = 0 is in the interior of linearity interval.Right: β = 0 is a breakpoint.

16.4 Sensitivity analysis for linear problems

16.4.1 The optimal objective value function

Assume that we are given the problem

z(lc, uc, lx, ux, c) = minimize cTxsubject to lc ≤ Ax ≤ uc,

lx ≤ x ≤ ux,(16.1)

and we want to know how the optimal objective value changes as lci is perturbed. To answer thisquestion we define the perturbed problem for lci as follows

flci (β) = minimize cTxsubject to lc + βei ≤ Ax ≤ uc,

lx ≤ x ≤ ux,where ei is the i th column of the identity matrix. The function

flci (β) (16.2)

shows the optimal objective value as a function of β. Please note that a change in β corresponds to aperturbation in lci and hence (16.2) shows the optimal objective value as a function of lci .

It is possible to prove that the function (16.2) is a piecewise linear and convex function, i.e. the functionmay look like the illustration in Figure 16.1. Clearly, if the function flci (β) does not change much whenβ is changed, then we can conclude that the optimal objective value is insensitive to changes in lci .Therefore, we are interested in the rate of change in flci (β) for small changes in β — specificly thegradient

f ′lci (0),

which is called the shadow pricerelated to lci . The shadow price specifies how the objective valuechanges for small changes in β around zero. Moreover, we are interested in the linearity interval

Page 199: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

16.4. SENSITIVITY ANALYSIS FOR LINEAR PROBLEMS 181

β ∈ [β1, β2]

for which

f ′lci (β) = f ′lci (0).

Since flci is not a smooth function f ′lcimay not be defined at 0, as illustrated by the right example in

figure 16.1. In this case we can define a left and a right shadow price and a left and a right linearityinterval.

The function flci considered only changes in lci . We can define similar functions for the remainingparameters of the z defined in (16.1) as well:

fuci (β) = z(lc, uc + βei, lx, ux, c), i = 1, . . . ,m,

flxj (β) = z(lc, uc, lx + βej , ux, c), j = 1, . . . , n,

fuxj (β) = z(lc, uc, lx, ux + βej , c), j = 1, . . . , n,

fcj (β) = z(lc, uc, lx, ux, c+ βej), j = 1, . . . , n.

Given these definitions it should be clear how linearity intervals and shadow prices are defined for theparameters uci etc.

16.4.1.1 Equality constraints

In MOSEK a constraint can be specified as either an equality constraint or a ranged constraint. Ifconstraint i is an equality constraint, we define the optimal value function for this as

feci (β) = z(lc + βei, uc + βei, l

x, ux, c)

Thus for an equality constraint the upper and the lower bounds (which are equal) are perturbedsimultaneously. Therefore, MOSEK will handle sensitivity analysis differently for a ranged constraintwith lci = uci and for an equality constraint.

16.4.2 The basis type sensitivity analysis

The classical sensitivity analysis discussed in most textbooks about linear optimization, e.g. [1], isbased on an optimal basic solution or, equivalently, on an optimal basis. This method may producemisleading results [18] but is computationally cheap. Therefore, and for historical reasons thismethod is available in MOSEK We will now briefly discuss the basis type sensitivity analysis. Givenan optimal basic solution which provides a partition of variables into basic and non-basic variables, thebasis type sensitivity analysis computes the linearity interval [β1, β2] so that the basis remains optimalfor the perturbed problem. A shadow price associated with the linearity interval is also computed.However, it is well-known that an optimal basic solution may not be unique and therefore the resultdepends on the optimal basic solution employed in the sensitivity analysis. This implies that thecomputed interval is only a subset of the largest interval for which the shadow price is constant.Furthermore, the optimal objective value function might have a breakpoint for β = 0. In this case thebasis type sensitivity method will only provide a subset of either the left or the right linearity interval.

Page 200: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

182 CHAPTER 16. SENSITIVITY ANALYSIS

In summary, the basis type sensitivity analysis is computationally cheap but does not provide completeinformation. Hence, the results of the basis type sensitivity analysis should be used with care.

16.4.3 The optimal partition type sensitivity analysis

Another method for computing the complete linearity interval is called the optimal partition typesensitivity analysis. The main drawback of the optimal partition type sensitivity analysis is that itis computationally expensive compared to the basis type analysts. This type of sensitivity analysis iscurrently provided as an experimental feature in MOSEK.

Given the optimal primal and dual solutions to (16.1), i.e. x∗ and ((scl )∗, (scu)∗, (sxl )∗, (sxu)∗) the optimal

objective value is given by

z∗ := cTx∗.

The left and right shadow prices σ1 and σ2 for lci are given by this pair of optimization problems:

σ1 = minimize eTi scl

subject to AT (scl − scu) + sxl − sxu = c,

(lc)T (scl )− (uc)

T (scu) + (lx)T (sxl )− (ux)T (sxu) = z∗,scl , s

cu, s

cl , s

xu ≥ 0

and

σ2 = maximize eTi scl

subject to AT (scl − scu) + sxl − sxu = c,

(lc)T (scl )− (uc)

T (scu) + (lx)T (sxl )− (ux)T (sxu) = z∗,scl , s

cu, s

cl , s

xu ≥ 0.

These two optimization problems make it easy to interpret the shadow price. Indeed, if ((scl )∗, (scu)∗, (sxl )∗, (sxu)∗)

is an arbitrary optimal solution then

(scl )∗i ∈ [σ1, σ2].

Next, the linearity interval [β1, β2] for lci is computed by solving the two optimization problems

β1 = minimize βsubject to lc + βei ≤ Ax ≤ uc,

cTx− σ1β = z∗,lx ≤ x ≤ ux,

and

β2 = maximize βsubject to lc + βei ≤ Ax ≤ uc,

cTx− σ2β = z∗,lx ≤ x ≤ ux.

Page 201: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

16.4. SENSITIVITY ANALYSIS FOR LINEAR PROBLEMS 183

The linearity intervals and shadow prices for uci , lxj , and uxj are computed similarly to lci .

The left and right shadow prices for cj denoted σ1 and σ2 respectively are computed as follows:

σ1 = minimize eTj xsubject to lc + βei ≤ Ax ≤ uc,

cTx = z∗,lx ≤ x ≤ ux

and

σ2 = maximize eTj xsubject to lc + βei ≤ Ax ≤ uc,

cTx = z∗,lx ≤ x ≤ ux.

Once again the above two optimization problems make it easy to interpret the shadow prices. Indeed,if x∗ is an arbitrary primal optimal solution, then

x∗j ∈ [σ1, σ2].

The linearity interval [β1, β2] for a cj is computed as follows:

β1 = minimize β

subject to AT (scl − scu) + sxl − sxu = c+ βej ,

(lc)T (scl )− (uc)

T (scu) + (lx)T (sxl )− (ux)T (sxu)− σ1β ≤ z∗,scl , s

cu, s

cl , s

xu ≥ 0

and

β2 = maximize β

subject to AT (scl − scu) + sxl − sxu = c+ βej ,

(lc)T (scl )− (uc)

T (scu) + (lx)T (sxl )− (ux)T (sxu)− σ2β ≤ z∗,scl , s

cu, s

cl , s

xu ≥ 0.

16.4.4 Example: Sensitivity analysis

As an example we will use the following transportation problem. Consider the problem of minimizingthe transportation cost between a number of production plants and stores. Each plant supplies anumber of goods and each store has a given demand that must be met. Supply, demand and cost oftransportation per unit are shown in Figure 16.2. If we denote the number of transported goods fromlocation i to location j by xij , problem can be formulated as the linear optimization problem minimize

1x11 + 2x12 + 5x23 + 2x24 + 1x31 + 2x33 + 1x34

subject to

Page 202: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

184 CHAPTER 16. SENSITIVITY ANALYSIS

Supply Demand

1

2

5

2

1

2

1

Plant 1

Plant 2

Plant 3Store 4

Store 3

Store 2

Store 1

1000

500

500

800

100

400

1200

Figure 16.2: Supply, demand and cost of transportation.

Page 203: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

16.4. SENSITIVITY ANALYSIS FOR LINEAR PROBLEMS 185

Basis type Optimal partition typeCon. β1 β2 σ1 σ2

1 −300.00 0.00 3.00 3.002 −700.00 +∞ 0.00 0.003 −500.00 0.00 3.00 3.004 −0.00 500.00 4.00 4.005 −0.00 300.00 5.00 5.006 −0.00 700.00 5.00 5.007 −500.00 700.00 2.00 2.00Var. β1 β2 σ1 σ2

x11 −∞ 300.00 0.00 0.00x12 −∞ 100.00 0.00 0.00x23 −∞ 0.00 0.00 0.00x24 −∞ 500.00 0.00 0.00x31 −∞ 500.00 0.00 0.00x33 −∞ 500.00 0.00 0.00x34 −0.000000 500.00 2.00 2.00

Con. β1 β2 σ1 σ2

1 −300.00 500.00 3.00 1.002 −700.00 +∞ −0.00 −0.003 −500.00 500.00 3.00 1.004 −500.00 500.00 2.00 4.005 −100.00 300.00 3.00 5.006 −500.00 700.00 3.00 5.007 −500.00 700.00 2.00 2.00Var. β1 β2 σ1 σ2

x11 −∞ 300.00 0.00 0.00x12 −∞ 100.00 0.00 0.00x23 −∞ 500.00 0.00 2.00x24 −∞ 500.00 0.00 0.00x31 −∞ 500.00 0.00 0.00x33 −∞ 500.00 0.00 0.00x34 −∞ 500.00 0.00 2.00

Table 16.1: Ranges and shadow prices related to bounds on constraints and variables. Left: Resultsfor the basis type sensitivity analysis. Right: Results for the optimal partition type sensitivity analysis.

x11 + x12 ≤ 400,x23 + x24 ≤ 1200,

x31 + x33 + x34 ≤ 1000,x11 + x31 = 800,

x12 = 100,x23 + x33 = 500,

x24 + x34 = 500,x11, x12, x23, x24, x31, x33, x34 ≥ 0.

(16.3)

The basis type and the optimal partition type sensitivity results for the transportation problem areshown in Table 16.1 and 16.2 respectively. Examining the results from the optimal partition typesensitivity analysis we see that for constraint number 1 we have σ1 6= σ2 and β1 6= β2. Therefore, wehave a left linearity interval of [−300, 0] and a right interval of [0, 500]. The corresponding left andright shadow prices are 3 and 1 respectively. This implies that if the upper bound on constraint 1increases by

β ∈ [0, β1] = [0, 500]

then the optimal objective value will decrease by the value

σ2β = 1β.

Correspondingly, if the upper bound on constraint 1 is decreased by

Page 204: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

186 CHAPTER 16. SENSITIVITY ANALYSIS

Basis type Optimal partition typeVar. β1 β2 σ1 σ2

c1 −∞ 3.00 300.00 300.00c2 −∞ ∞ 100.00 100.00c3 −2.00 ∞ 0.00 0.00c4 −∞ 2.00 500.00 500.00c5 −3.00 ∞ 500.00 500.00c6 −∞ 2.00 500.00 500.00c7 −2.00 ∞ 0.00 0.00

Var. β1 β2 σ1 σ2

c1 −∞ 3.00 300.00 300.00c2 −∞ ∞ 100.00 100.00c3 −2.00 ∞ 0.00 0.00c4 −∞ 2.00 500.00 500.00c5 −3.00 ∞ 500.00 500.00c6 −∞ 2.00 500.00 500.00c7 −2.00 ∞ 0.00 0.00

Table 16.2: Ranges and shadow prices related to the objective coefficients. Left: Results for the basistype sensitivity analysis. Right: Results for the optimal partition type sensitivity analysis.

β ∈ [0, 300]

then the optimal objective value will increase by the value

σ1β = 3β.

16.5 Sensitivity analysis in the MATLAB toolbox

The following describe sensitivity analysis from the MATLAB toolbox.

16.5.1 On bounds

The index of bounds/variables to analyzed for sensitivity are specified in the following subfields of thematlab structure prob:

.prisen.cons.subu

Indexes of constraints, where upper bounds are analyzed for sensitivity.

.prisen.cons.subl

Indexes of constraints, where lower bounds are analyzed for sensitivity.

.prisen.vars.subu

Indexes of variables, where upper bounds are analyzed for sensitivity.

.prisen.vars.subl

Indexes of variables, where lower bounds are analyzed for sensitivity.

.duasen.sub

Index of variables where coefficients are analyzed for sensitivity.

Page 205: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

16.5. SENSITIVITY ANALYSIS IN THE MATLAB TOOLBOX 187

For an equality constraint, the index can be specified in either subu or subl. After calling

[r,res] = mosekopt(’minimize’,prob)

the results are returned in the subfields prisen and duasen of res.

16.5.1.1 prisen

The field prisen is structured as follows:

.cons

MATLAB structure with subfields:

.lr bl

Left value β1 in the linearity interval for a lower bound.

.rr bl

Right value β2 in the linearity interval for a lower bound.

.ls bl

Left shadow price sl for a lower bound.

.rs bl

Right shadow price sr for a lower bound.

.lr bu

Left value β1 in the linearity interval for an upper bound.

.rr bu

Right value β2 in the linearity interval for an upper bound.

.ls bu

Left shadow price sl for an upper bound.

.rs bu

Right shadow price sr for an upper bound.

.var

MATLAB structure with subfields:

.lr bl

Left value β1 in the linearity interval for a lower bound on a varable.

.rr bl

Right value β2 in the linearity interval for a lower bound on a varable.

.ls bl

Left shadow price sl for a lower bound on a varable.

.rs bl

Right shadow price sr for lower bound on a varable.

Page 206: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

188 CHAPTER 16. SENSITIVITY ANALYSIS

.lr bu

Left value β1 in the linearity interval for an upper bound on a varable.

.rr bu

Right value β2 in the linearity interval for an upper bound on a varable.

.ls bu

Left shadow price sl for an upper bound on a varables.

.rs bu

Right shadow price sr for an upper bound on a varables.

16.5.1.2 duasen

The field duasen is structured as follows:

.lr c

Left value β1 of linearity interval for an objective coefficient.

.rr c

Right value β2 of linearity interval for an objective coefficient.

.ls c

Left shadow price sl for an objective coefficients .

.rs c

Right shadow price sr for an objective coefficients.

16.5.2 Selecting analysis type

The type (basis or optimal partition) of analysis to be performed can be selected by setting theparameter

MSK IPAR SENSITIVITY TYPE

to one of the values:

MSK SENSITIVITY TYPE BASIS = 0

MSK SENSITIVITY TYPE OPTIMAL PARTITION = 1

as seen in the following example.

16.5.3 An example

Consider the problem defined in (16.3). Suppose we wish to perform sensitivity analysis on all boundsand coefficients. The following example demonstrates this as well as the method for changing betweenbasic and full sensitivity analysis.

% sensitivity.m

Page 207: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

16.5. SENSITIVITY ANALYSIS IN THE MATLAB TOOLBOX 189

% Obtain all symbolic constants

% defined by MOSEK.

[r,res] = mosekopt(’symbcon’);

sc = res.symbcon;

[r,res] = mosekopt(’read(../../tools/examples/data/transport.lp)’);

prob = res.prob;

% analyse upper bound 1:7

prob.prisen.cons.subl = [];

prob.prisen.cons.subu = [1:7];

% analyse lower bound on variables 1:7

prob.prisen.vars.subl = [1:7];

prob.prisen.vars.subu = [];

% analyse coeficient 1:7

prob.duasen.sub = [1:7];

%Select basis sensitivity analysis and optimize.

param.MSK IPAR SENSITIVITY TYPE=sc.MSK SENSITIVITY TYPE BASIS;

[r,res] = mosekopt(’minimize echo(0)’,prob,param);

results(1) = res;

% Select optimal partition sensitivity analysis and optimize.

param.MSK IPAR SENSITIVITY TYPE=sc.MSK SENSITIVITY TYPE OPTIMAL PARTITION;

[r,res] = mosekopt(’minimize echo(0)’,prob,param);

results(2) = res;

%Print results

for m = [1:2]

if m == 1

fprintf(’\nBasis sensitivity results:\n’)else

fprintf(’\nOptimal partition sensitivity results:\n’)end

fprintf(’\nSensitivity for bounds on constraints:\n’)for i = 1:length(prob.prisen.cons.subl)

fprintf (...

’con = %d, beta 1 = %.1f, beta 2 = %.1f, delta 1 = %.1f,delta 2 = %.1f\n’, ...

prob.prisen.cons.subu(i),results(m).prisen.cons.lr bu(i), ...

results(m).prisen.cons.rr bu(i),...

results(m).prisen.cons.ls bu(i),...

results(m).prisen.cons.rs bu(i));

end

for i = 1:length(prob.prisen.cons.subu)

fprintf (...

’con = %d, beta 1 = %.1f, beta 2 = %.1f, delta 1 = %.1f,delta 2 = %.1f\n’, ...

prob.prisen.cons.subu(i),results(m).prisen.cons.lr bu(i), ...

results(m).prisen.cons.rr bu(i),...

results(m).prisen.cons.ls bu(i),...

results(m).prisen.cons.rs bu(i));

end

fprintf(’Sensitivity for bounds on variables:\n’)for i = 1:length(prob.prisen.vars.subl)

fprintf (...

’var = %d, beta 1 = %.1f, beta 2 = %.1f, delta 1 = %.1f,delta 2 = %.1f\n’, ...

prob.prisen.vars.subl(i),results(m).prisen.vars.lr bl(i), ...

results(m).prisen.vars.rr bl(i),...

results(m).prisen.vars.ls bl(i),...

results(m).prisen.vars.rs bl(i));

end

Page 208: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

190 CHAPTER 16. SENSITIVITY ANALYSIS

for i = 1:length(prob.prisen.vars.subu)

fprintf (...

’var = %d, beta 1 = %.1f, beta 2 = %.1f, delta 1 = %.1f,delta 2 = %.1f\n’, ...

prob.prisen.vars.subu(i),results(m).prisen.vars.lr bu(i), ...

results(m).prisen.vars.rr bu(i),...

results(m).prisen.vars.ls bu(i),...

results(m).prisen.vars.rs bu(i));

end

fprintf(’Sensitivity for coefficients in objective:\n’)for i = 1:length(prob.duasen.sub)

fprintf (...

’var = %d, beta 1 = %.1f, beta 2 = %.1f, delta 1 = %.1f,delta 2 = %.1f\n’, ...

prob.duasen.sub(i),results(m).duasen.lr c(i), ...

results(m).duasen.rr c(i),...

results(m).duasen.ls c(i),...

results(m).duasen.rs c(i));

end

end

The output from running the example sensitivity.m is shown below.

Basis sensitivity results:

Sensitivity for bounds on constraints:

con = 1, beta 1 = -300.0, beta 2 = 0.0, delta 1 = 3.0,delta 2 = 3.0

con = 2, beta 1 = -700.0, beta 2 = Inf, delta 1 = 0.0,delta 2 = 0.0

con = 3, beta 1 = -500.0, beta 2 = 0.0, delta 1 = 3.0,delta 2 = 3.0

con = 4, beta 1 = -0.0, beta 2 = 500.0, delta 1 = 4.0,delta 2 = 4.0

con = 5, beta 1 = -0.0, beta 2 = 300.0, delta 1 = 5.0,delta 2 = 5.0

con = 6, beta 1 = -0.0, beta 2 = 700.0, delta 1 = 5.0,delta 2 = 5.0

con = 7, beta 1 = -500.0, beta 2 = 700.0, delta 1 = 2.0,delta 2 = 2.0

Sensitivity for bounds on variables:

var = 1, beta 1 = Inf, beta 2 = 300.0, delta 1 = 0.0,delta 2 = 0.0

var = 2, beta 1 = Inf, beta 2 = 100.0, delta 1 = 0.0,delta 2 = 0.0

var = 3, beta 1 = Inf, beta 2 = 0.0, delta 1 = 0.0,delta 2 = 0.0

var = 4, beta 1 = Inf, beta 2 = 500.0, delta 1 = 0.0,delta 2 = 0.0

var = 5, beta 1 = Inf, beta 2 = 500.0, delta 1 = 0.0,delta 2 = 0.0

var = 6, beta 1 = Inf, beta 2 = 500.0, delta 1 = 0.0,delta 2 = 0.0

var = 7, beta 1 = -0.0, beta 2 = 500.0, delta 1 = 2.0,delta 2 = 2.0

Sensitivity for coefficients in objective:

var = 1, beta 1 = Inf, beta 2 = 3.0, delta 1 = 300.0,delta 2 = 300.0

var = 2, beta 1 = Inf, beta 2 = Inf, delta 1 = 100.0,delta 2 = 100.0

var = 3, beta 1 = -2.0, beta 2 = Inf, delta 1 = 0.0,delta 2 = 0.0

var = 4, beta 1 = Inf, beta 2 = 2.0, delta 1 = 500.0,delta 2 = 500.0

var = 5, beta 1 = -3.0, beta 2 = Inf, delta 1 = 500.0,delta 2 = 500.0

var = 6, beta 1 = Inf, beta 2 = 2.0, delta 1 = 500.0,delta 2 = 500.0

var = 7, beta 1 = -2.0, beta 2 = Inf, delta 1 = 0.0,delta 2 = 0.0

Optimal partition sensitivity results:

Sensitivity for bounds on constraints:

con = 1, beta 1 = -300.0, beta 2 = 500.0, delta 1 = 3.0,delta 2 = 1.0

con = 2, beta 1 = -700.0, beta 2 = Inf, delta 1 = -0.0,delta 2 = -0.0

con = 3, beta 1 = -500.0, beta 2 = 500.0, delta 1 = 3.0,delta 2 = 1.0

con = 4, beta 1 = -500.0, beta 2 = 500.0, delta 1 = 2.0,delta 2 = 4.0

con = 5, beta 1 = -100.0, beta 2 = 300.0, delta 1 = 3.0,delta 2 = 5.0

con = 6, beta 1 = -500.0, beta 2 = 700.0, delta 1 = 3.0,delta 2 = 5.0

con = 7, beta 1 = -500.0, beta 2 = 700.0, delta 1 = 2.0,delta 2 = 2.0

Page 209: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

16.5. SENSITIVITY ANALYSIS IN THE MATLAB TOOLBOX 191

Sensitivity for bounds on variables:

var = 1, beta 1 = Inf, beta 2 = 300.0, delta 1 = 0.0,delta 2 = 0.0

var = 2, beta 1 = Inf, beta 2 = 100.0, delta 1 = 0.0,delta 2 = 0.0

var = 3, beta 1 = Inf, beta 2 = 500.0, delta 1 = 0.0,delta 2 = 2.0

var = 4, beta 1 = Inf, beta 2 = 500.0, delta 1 = 0.0,delta 2 = 0.0

var = 5, beta 1 = Inf, beta 2 = 500.0, delta 1 = 0.0,delta 2 = 0.0

var = 6, beta 1 = Inf, beta 2 = 500.0, delta 1 = 0.0,delta 2 = 0.0

var = 7, beta 1 = Inf, beta 2 = 500.0, delta 1 = 0.0,delta 2 = 2.0

Sensitivity for coefficients in objective:

var = 1, beta 1 = Inf, beta 2 = 3.0, delta 1 = 300.0,delta 2 = 300.0

var = 2, beta 1 = Inf, beta 2 = Inf, delta 1 = 100.0,delta 2 = 100.0

var = 3, beta 1 = -2.0, beta 2 = Inf, delta 1 = 0.0,delta 2 = 0.0

var = 4, beta 1 = Inf, beta 2 = 2.0, delta 1 = 500.0,delta 2 = 500.0

var = 5, beta 1 = -3.0, beta 2 = Inf, delta 1 = 500.0,delta 2 = 500.0

var = 6, beta 1 = Inf, beta 2 = 2.0, delta 1 = 500.0,delta 2 = 500.0

var = 7, beta 1 = -2.0, beta 2 = Inf, delta 1 = 0.0,delta 2 = 0.0

Page 210: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

192 CHAPTER 16. SENSITIVITY ANALYSIS

Page 211: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

Chapter 17

Problem formulation and solutions

In this chapter we will discuss the following issues:

• The formal definitions of the problem types that MOSEK can solve.

• The solution information produced by MOSEK.

• The information produced by MOSEK if the problem is infeasible.

17.1 Linear optimization

A linear optimization problem can be written as

minimize cTx+ cf

subject to lc ≤ Ax ≤ uc,lx ≤ x ≤ ux,

(17.1)

where

• m is the number of constraints.

• n is the number of decision variables.

• x ∈ Rn is a vector of decision variables.

• c ∈ Rn is the linear part of the objective function.

• A ∈ Rm×n is the constraint matrix.

• lc ∈ Rm is the lower limit on the activity for the constraints.

• uc ∈ Rm is the upper limit on the activity for the constraints.

193

Page 212: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

194 CHAPTER 17. PROBLEM FORMULATION AND SOLUTIONS

• lx ∈ Rn is the lower limit on the activity for the variables.

• ux ∈ Rn is the upper limit on the activity for the variables.

A primal solution (x) is (primal) feasible if it satisfies all constraints in (17.1). If (17.1) has at leastone primal feasible solution, then (17.1) is said to be (primal) feasible.

In case (17.1) does not have a feasible solution, the problem is said to be (primal) infeasible .

17.1.1 Duality for linear optimization

Corresponding to the primal problem (17.1), there is a dual problem

maximize (lc)T scl − (uc)T scu + (lx)T sxl − (ux)T sxu + cf

subject to AT y + sxl − sxu = c,− y + scl − scu = 0,scl , s

cu, s

xl , s

xu ≥ 0.

(17.2)

If a bound in the primal problem is plus or minus infinity, the corresponding dual variable is fixed at0, and we use the convention that the product of the bound value and the corresponding dual variableis 0. E.g.

lxj = −∞ ⇒ (sxl )j = 0 and lxj · (sxl )j = 0.

This is equivalent to removing variable (sxl )j from the dual problem.

A solution

(y, scl , scu, s

xl , s

xu)

to the dual problem is feasible if it satisfies all the constraints in (17.2). If (17.2) has at least onefeasible solution, then (17.2) is (dual) feasible, otherwise the problem is (dual) infeasible.

17.1.1.1 A primal-dual feasible solution

A solution

(x, y, scl , scu, s

xl , s

xu)

is denoted a primal-dual feasible solution, if (x) is a solution to the primal problem (17.1) and(y, scl , s

cu, s

xl , s

xu) is a solution to the corresponding dual problem (17.2).

17.1.1.2 The duality gap

Let

(x∗, y∗, (scl )∗, (scu)∗, (sxl )∗, (sxu)∗)

Page 213: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

17.1. LINEAR OPTIMIZATION 195

be a primal-dual feasible solution, and let

(xc)∗ := Ax∗.

For a primal-dual feasible solution we define the duality gap as the difference between the primal andthe dual objective value,

cTx∗ + cf −((lc)T (scl )

∗ − (uc)T (scu)∗ + (lx)T (sxl )∗ − (ux)T (sxu)∗ + cf)

=

m−1∑i=0

[(scl )∗i ((x

ci )∗ − lci ) + (scu)∗i (u

ci − (xci )

∗)] +

n−1∑j=0

[(sxl )∗j (xj − lxj ) + (sxu)∗j (u

xj − x∗j )

]≥ 0

(17.3)

where the first relation can be obtained by transposing and multiplying the dual constraints (17.2)by x∗ and (xc)∗ respectively, and the second relation comes from the fact that each term in each sumis nonnegative. It follows that the primal objective will always be greater than or equal to the dualobjective.

17.1.1.3 When the objective is to be maximized

When the objective sense of problem (17.1) is maximization, i.e.

maximize cTx+ cf

subject to lc ≤ Ax ≤ uc,lx ≤ x ≤ ux,

the objective sense of the dual problem changes to minimization, and the domain of all dual variableschanges sign in comparison to (17.2). The dual problem thus takes the form

minimize (lc)T scl − (uc)T scu + (lx)T sxl − (ux)T sxu + cf

subject to AT y + sxl − sxu = c,− y + scl − scu = 0,scl , s

cu, s

xl , s

xu ≤ 0.

This means that the duality gap, defined in (17.3) as the primal minus the dual objective value,becomes nonpositive. It follows that the dual objective will always be greater than or equal to theprimal objective.

17.1.1.4 An optimal solution

It is well-known that a linear optimization problem has an optimal solution if and only if there existfeasible primal and dual solutions so that the duality gap is zero, or, equivalently, that the comple-mentarity conditions

Page 214: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

196 CHAPTER 17. PROBLEM FORMULATION AND SOLUTIONS

(scl )∗i ((x

ci )∗ − lci ) = 0, i = 0, . . . ,m− 1,

(scu)∗i (uci − (xci )

∗) = 0, i = 0, . . . ,m− 1,(sxl )∗j (x

∗j − lxj ) = 0, j = 0, . . . , n− 1,

(sxu)∗j (uxj − x∗j ) = 0, j = 0, . . . , n− 1,

are satisfied.

If (17.1) has an optimal solution and MOSEK solves the problem successfully, both the primal anddual solution are reported, including a status indicating the exact state of the solution.

17.1.2 Infeasibility for linear optimization

17.1.2.1 Primal infeasible problems

If the problem (17.1) is infeasible (has no feasible solution), MOSEK will report a certificate of primalinfeasibility: The dual solution reported is the certificate of infeasibility, and the primal solution isundefined.

A certificate of primal infeasibility is a feasible solution to the modified dual problem

maximize (lc)T scl − (uc)T scu + (lx)T sxl − (ux)T sxusubject to AT y + sxl − sxu = 0,

− y + scl − scu = 0,scl , s

cu, s

xl , s

xu ≥ 0,

(17.4)

such that the objective value is strictly positive, i.e. a solution

(y∗, (scl )∗, (scu)∗, (sxl )∗, (sxu)∗)

to (17.4) so that

(lc)T (scl )∗ − (uc)T (scu)∗ + (lx)T (sxl )∗ − (ux)T (sxu)∗ > 0.

Such a solution implies that (17.4) is unbounded, and that its dual is infeasible. As the constraints tothe dual of (17.4) is identical to the constraints of problem (17.1), we thus have that problem (17.1) isalso infeasible.

17.1.2.2 Dual infeasible problems

If the problem (17.2) is infeasible (has no feasible solution), MOSEK will report a certificate of dualinfeasibility: The primal solution reported is the certificate of infeasibility, and the dual solution isundefined.

A certificate of dual infeasibility is a feasible solution to the modified primal problem

minimize cTx

subject to lc ≤ Ax ≤ uc,

lx ≤ x ≤ ux,

(17.5)

Page 215: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

17.2. CONIC QUADRATIC OPTIMIZATION 197

where

lci =

0 if lci > −∞,−∞ otherwise,

and uci :=

0 if uci <∞,∞ otherwise,

and

lxj =

0 if lxj > −∞,−∞ otherwise,

and uxj :=

0 if uxj <∞,∞ otherwise,

such that the objective value cTx is strictly negative.

Such a solution implies that (17.5) is unbounded, and that its dual is infeasible. As the constraints tothe dual of (17.5) is identical to the constraints of problem (17.2), we thus have that problem (17.2) isalso infeasible.

17.1.2.3 Primal and dual infeasible case

In case that both the primal problem (17.1) and the dual problem (17.2) are infeasible, MOSEK willreport only one of the two possible certificates — which one is not defined (MOSEK returns the firstcertificate found).

17.2 Conic quadratic optimization

Conic quadratic optimization is an extensions of linear optimization (see Section 17.1) allowing conicdomains to be specified for subsets of the problem variables. A conic quadratic optimization problemcan be written as

minimize cTx+ cf

subject to lc ≤ Ax ≤ uc,lx ≤ x ≤ ux,

x ∈ C,

(17.6)

where set C is a Cartesian product of convex cones, namely C = C1× · · ·×Cp. Having the domainrestriction, x ∈ C, is thus equivalent to

xt ∈ Ct ⊆ Rnt ,

where x = (x1, . . . , xp) is a partition of the problem variables. Please note that the n-dimensionalEuclidean space Rn is a cone itself, so simple linear variables are still allowed.

MOSEK supports only a limited number of cones, specifically:

• The Rn set.

Page 216: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

198 CHAPTER 17. PROBLEM FORMULATION AND SOLUTIONS

• The quadratic cone:

Qn =

x ∈ Rn : x1 ≥

√√√√ n∑j=2

x2j

.

• The rotated quadratic cone:

Qrn =

x ∈ Rn : 2x1x2 ≥n∑j=3

x2j , x1 ≥ 0, x2 ≥ 0

.

Although these cones may seem to provide only limited expressive power they can be used to model awide range of problems as demonstrated in [20].

17.2.1 Duality for conic quadratic optimization

The dual problem corresponding to the conic quadratic optimization problem (17.6) is given by

maximize (lc)T scl − (uc)T scu + (lx)T sxl − (ux)T sxu + cf

subject to AT y + sxl − sxu + sxn = c,− y + scl − scu = 0,scl , s

cu, s

xl , s

xu ≥ 0,

sxn ∈ C∗,

(17.7)

where the dual cone C∗ is a Cartesian product of the cones

C∗ = C∗1× · · ·×C∗p ,where each C∗t is the dual cone of Ct. For the cone types MOSEK can handle, the relation between theprimal and dual cone is given as follows:

• The Rn set:

Ct = Rnt ⇔ C∗t = s ∈ Rnt : s = 0 .

• The quadratic cone:

Ct = Qnt ⇔ C∗t = Qnt =

s ∈ Rnt : s1 ≥

√√√√ nt∑j=2

s2j

.

• The rotated quadratic cone:

Ct = Qrnt ⇔ C∗t = Qrnt =

s ∈ Rnt : 2s1s2 ≥nt∑j=3

s2j , s1 ≥ 0, s2 ≥ 0

.

Page 217: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

17.2. CONIC QUADRATIC OPTIMIZATION 199

Please note that the dual problem of the dual problem is identical to the original primal problem.

17.2.2 Infeasibility for conic quadratic optimization

In case MOSEK finds a problem to be infeasible it reports a certificate of the infeasibility. This worksexactly as for linear problems (see Section 17.1.2).

17.2.2.1 Primal infeasible problems

If the problem (17.6) is infeasible, MOSEK will report a certificate of primal infeasibility: The dualsolution reported is the certificate of infeasibility, and the primal solution is undefined.

A certificate of primal infeasibility is a feasible solution to the problem

maximize (lc)T scl − (uc)T scu + (lx)T sxl − (ux)T sxusubject to AT y + sxl − sxu + sxn = 0,

− y + scl − scu = 0,scl , s

cu, s

xl , s

xu ≥ 0,

sxn ∈ C∗,

(17.8)

such that the objective value is strictly positive.

17.2.2.2 Dual infeasible problems

If the problem (17.7) is infeasible, MOSEK will report a certificate of dual infeasibility: The primalsolution reported is the certificate of infeasibility, and the dual solution is undefined.

A certificate of dual infeasibility is a feasible solution to the problem

minimize cTx

subject to lc ≤ Ax ≤ uc,

lx ≤ x ≤ ux,x ∈ C,

(17.9)

where

lci =

0 if lci > −∞,−∞ otherwise,

and uci :=

0 if uci <∞,∞ otherwise,

and

lxj =

0 if lxj > −∞,−∞ otherwise,

and uxj :=

0 if uxj <∞,∞ otherwise,

such that the objective value is strictly negative.

Page 218: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

200 CHAPTER 17. PROBLEM FORMULATION AND SOLUTIONS

17.3 Semidefinite optimization

Semidefinite optimization is an extension of conic quadratic optimization (see Section 17.2) allowingpositive semidefinite matrix variables to be used in addition to the usual scalar variables. A semidefiniteoptimization problem can be written as

minimize

n−1∑j=0

cjxj +

p−1∑j=0

⟨Cj , Xj

⟩+ cf

subject to lci ≤n−1∑j=0

aijxj +

p−1∑j=0

⟨Aij , Xj

⟩≤ uci , i = 0, . . . ,m− 1

lxj ≤ xj ≤ uxj , j = 0, . . . , n− 1

x ∈ C, Xj ∈ S+rj , j = 0, . . . , p− 1

(17.10)

where the problem has p symmetric positive semidefinite variables Xj ∈ S+rj of dimension rj with

symmetric coefficient matrices Cj ∈ Srj and Ai,j ∈ Srj . We use standard notation for the matrix innerproduct, i.e., for U, V ∈ Rm×n we have

〈U, V 〉 :=

m−1∑i=0

n−1∑j=0

UijVij .

With semidefinite optimization we can model a wide range of problems as demonstrated in [20].

17.3.1 Duality for semidefinite optimization

The dual problem corresponding to the semidefinite optimization problem (17.10) is given by

maximize (lc)T scl − (uc)T scu + (lx)T sxl − (ux)T sxu + cf

subject toc−AT y + sxu − sxl = sxn,

Cj −m∑i=0

yiAij = Sj , j = 0, . . . , p− 1

scl − scu = y,scl , s

cu, s

xl , s

xu ≥ 0,

sxn ∈ C∗, Sj ∈ S+rj , j = 0, . . . , p− 1

(17.11)

where A ∈ Rm×n, Aij = aij , which is similar to the dual problem for conic quadratic optimization (seeSection 17.7), except for the addition of dual constraints

(Cj −m∑i=0

yiAij) ∈ S+rj .

Note that the dual of the dual problem is identical to the original primal problem.

Page 219: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

17.3. SEMIDEFINITE OPTIMIZATION 201

17.3.2 Infeasibility for semidefinite optimization

In case MOSEK finds a problem to be infeasible it reports a certificate of the infeasibility. This worksexactly as for linear problems (see Section 17.1.2).

17.3.2.1 Primal infeasible problems

If the problem (17.10) is infeasible, MOSEK will report a certificate of primal infeasibility: The dualsolution reported is a certificate of infeasibility, and the primal solution is undefined.

A certificate of primal infeasibility is a feasible solution to the problem

maximize (lc)T scl − (uc)T scu + (lx)T sxl − (ux)T sxu

subject toAT y + sxl − sxu + sxn = 0,

m−1∑i=0

yiAij + Sj = 0, j = 0, . . . , p− 1

− y + scl − scu = 0,scl , s

cu, s

xl , s

xu ≥ 0,

sxn ∈ C∗, Sj ∈ S+rj , j = 0, . . . , p− 1

(17.12)

such that the objective value is strictly positive.

17.3.2.2 Dual infeasible problems

If the problem (17.11) is infeasible, MOSEK will report a certificate of dual infeasibility: The primalsolution reported is the certificate of infeasibility, and the dual solution is undefined.

A certificate of dual infeasibility is a feasible solution to the problem

minimize

n−1∑j=0

cjxj +

p−1∑j=0

⟨Cj , Xj

⟩subject to lci ≤

∑j=1

aijxj +

p−1∑j=0

⟨Aij , Xj

⟩≤ uci , i = 0, . . . ,m− 1

lx ≤ x ≤ ux,x ∈ C, Xj ∈ S+

rj , j = 0, . . . , p− 1

(17.13)

where

lci =

0 if lci > −∞,−∞ otherwise,

and uci :=

0 if uci <∞,∞ otherwise,

and

lxj =

0 if lxj > −∞,−∞ otherwise,

and uxj :=

0 if uxj <∞,∞ otherwise,

Page 220: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

202 CHAPTER 17. PROBLEM FORMULATION AND SOLUTIONS

such that the objective value is strictly negative.

17.4 Quadratic and quadratically constrained optimization

A convex quadratic and quadratically constrained optimization problem is an optimization problem ofthe form

minimize1

2xTQox+ cTx+ cf

subject to lck ≤ 1

2xTQkx+

n−1∑j=0

akjxj ≤ uck, k = 0, . . . ,m− 1,

lxj ≤ xj ≤ uxj , j = 0, . . . , n− 1,

(17.14)

whereQo and allQk are symmetric matrices. Moreover for convexity, Qo must be a positive semidefinitematrix and Qk must satisfy

−∞ < lck ⇒ Qk is negative semidefinite,

uck <∞ ⇒ Qk is positive semidefinite,

−∞ < lck ≤ uck <∞ ⇒ Qk = 0.

The convexity requirement is very important and it is strongly recommended that MOSEK is appliedto convex problems only.

Note that any convex quadratic and quadratically constrained optimization problem can be reformu-lated as a conic optimization problem. It is our experience that for the majority of practical applicationsit is better to cast them as conic problems because

• the resulting problem is convex by construction, and

• the conic optimizer is more efficient than the optimizer for general quadratic problems.

See [20] for further details.

17.4.1 Duality for quadratic and quadratically constrained optimization

The dual problem corresponding to the quadratic and quadratically constrained optimization problem(17.14) is given by

maximize (lc)T scl − (uc)T scu + (lx)T sxl − (ux)T sxu +1

2xT

(m−1∑k=0

ykQk −Qo

)x+ cf

subject to AT y + sxl − sxu +

(m−1∑k=0

ykQk −Qo

)x = c,

− y + scl − scu = 0,scl , s

cu, s

xl , s

xu ≥ 0.

(17.15)

Page 221: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

17.5. GENERAL CONVEX OPTIMIZATION 203

The dual problem is related to the dual problem for linear optimization (see Section 17.2), but dependon variable x which in general can not be eliminated. In the solutions reported by MOSEK, the valueof x is the same for the primal problem (17.14) and the dual problem (17.15).

17.4.2 Infeasibility for quadratic and quadratically constrained optimiza-tion

In case MOSEK finds a problem to be infeasible it reports a certificate of the infeasibility. This worksexactly as for linear problems (see Section 17.1.2).

17.4.2.1 Primal infeasible problems

If the problem (17.14) with all Qk = 0 is infeasible, MOSEK will report a certificate of primal infeasi-bility. As the constraints is the same as for a linear problem, the certificate of infeasibility is the sameas for linear optimization (see Section 17.1.2.1).

17.4.2.2 Dual infeasible problems

If the problem (17.15) with all Qk = 0 is infeasible, MOSEK will report a certificate of dual infeasibility:The primal solution reported is the certificate of infeasibility, and the dual solution is undefined.

A certificate of dual infeasibility is a feasible solution to the problem

minimize cTx

subject to lc ≤ Ax ≤ uc,0 ≤ Qox ≤ 0,

lx ≤ x ≤ ux,

(17.16)

where

lci =

0 if lci > −∞,−∞ otherwise,

and uci :=

0 if uci <∞,∞ otherwise,

and

lxj =

0 if lxj > −∞,−∞ otherwise,

and uxj :=

0 if uxj <∞,∞ otherwise,

such that the objective value is strictly negative.

17.5 General convex optimization

MOSEK is capable of solving smooth (twice differentiable) convex nonlinear optimization problems ofthe form

Page 222: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

204 CHAPTER 17. PROBLEM FORMULATION AND SOLUTIONS

minimize f(x) + cTx+ cf

subject to lc ≤ g(x) +Ax ≤ uc,lx ≤ x ≤ ux,

(17.17)

where

• m is the number of constraints.

• n is the number of decision variables.

• x ∈ Rn is a vector of decision variables.

• c ∈ Rn is the linear part objective function.

• A ∈ Rm×n is the constraint matrix.

• lc ∈ Rm is the lower limit on the activity for the constraints.

• uc ∈ Rm is the upper limit on the activity for the constraints.

• lx ∈ Rn is the lower limit on the activity for the variables.

• ux ∈ Rn is the upper limit on the activity for the variables.

• f : Rn → R is a nonlinear function.

• g : Rn → Rm is a nonlinear vector function.

This means that the ith constraint has the form

lci ≤ gi(x) +

n∑j=1

aijxj ≤ uci .

The linear term Ax is not included in g(x) since it can be handled much more efficiently as a separateentity when optimizing.

The nonlinear functions f and g must be smooth in all x ∈ [lx;ux]. Moreover, f(x) must be a convexfunction and gi(x) must satisfy

−∞ < lci ⇒ gi(x) is concave,uci <∞ ⇒ gi(x) is convex,

−∞ < lci ≤ uci <∞ ⇒ gi(x) = 0.

17.5.1 Duality for general convex optimization

Similar to the linear case, MOSEK reports dual information in the general nonlinear case. Indeed inthis case the Lagrange function is defined by

Page 223: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

17.5. GENERAL CONVEX OPTIMIZATION 205

L(x, scl , scu, s

xl , s

xu) := f(x) + cTx+ cf

− (scl )T (g(x) +Ax− lc)− (scu)T (uc − g(x)−Ax)

− (sxl )T (x− lx)− (sxu)T (ux − x),

and the dual problem is given by

maximize L(x, scl , scu, s

xl , s

xu)

subject to ∇xL(x, scl , scu, s

xl , s

xu)T = 0,

scl , scu, s

xl , s

xu ≥ 0,

which is equivalent to

maximize (lc)T scl − (uc)T scu + (lx)T sxl − (ux)T sxu + cf

+ f(x)− g(x)T y − (∇f(x)T −∇g(x)T y)Tx

subject to AT y + sxl − sxu − (∇f(x)T −∇g(x)T y) = c,− y + scl − scu = 0,

scl , scu, s

xl , s

xu ≥ 0.

(17.18)

In this context we use the following definition for scalar functions

∇f(x) =

[∂f(x)

∂x1, ...,

∂f(x)

∂xn

],

and accordingly for vector functions

∇g(x) =

∇g1(x):

∇gm(x)

.

Page 224: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

206 CHAPTER 17. PROBLEM FORMULATION AND SOLUTIONS

Page 225: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

Chapter 18

The MPS file format

MOSEK supports the standard MPS format with some extensions. For a detailed description of theMPS format see the book by Nazareth [2].

18.1 MPS file structure

The version of the MPS format supported by MOSEK allows specification of an optimization problemon the form

lc ≤ Ax+ q(x) ≤ uc,lx ≤ x ≤ ux,

x ∈ C,xJ integer,

(18.1)

where

• x ∈ Rn is the vector of decision variables.

• A ∈ Rm×n is the constraint matrix.

• lc ∈ Rm is the lower limit on the activity for the constraints.

• uc ∈ Rm is the upper limit on the activity for the constraints.

• lx ∈ Rn is the lower limit on the activity for the variables.

• ux ∈ Rn is the upper limit on the activity for the variables.

• q : Rn → R is a vector of quadratic functions. Hence,

qi(x) = 1/2xTQix

where it is assumed that

207

Page 226: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

208 CHAPTER 18. THE MPS FILE FORMAT

Qi = (Qi)T .

Please note the explicit 1/2 in the quadratic term and that Qi is required to be symmetric.

• C is a convex cone.

• J ⊆ 1, 2, . . . , n is an index set of the integer-constrained variables.

An MPS file with one row and one column can be illustrated like this:

* 1 2 3 4 5 6

*23456789012345678901234567890123456789012345678901234567890

NAME [name]

OBJSENSE

[objsense]

OBJNAME

[objname]

ROWS

? [cname1]

COLUMNS

[vname1] [cname1] [value1] [vname3] [value2]

RHS

[name] [cname1] [value1] [cname2] [value2]

RANGES

[name] [cname1] [value1] [cname2] [value2]

QSECTION [cname1]

[vname1] [vname2] [value1] [vname3] [value2]

BOUNDS

?? [name] [vname1] [value1]

CSECTION [kname1] [value1] [ktype]

[vname1]

ENDATA

Here the names in capitals are keywords of the MPS format and names in brackets are custom definednames or values. A couple of notes on the structure:

Fields:

All items surrounded by brackets appear in fields. The fields named ”valueN” are numericalvalues. Hence, they must have the format

[+|-]XXXXXXX.XXXXXX[[e|E][+|-]XXX]

where

X = [0|1|2|3|4|5|6|7|8|9].

Sections:

The MPS file consists of several sections where the names in capitals indicate the beginning of anew section. For example, COLUMNS denotes the beginning of the columns section.

Comments:

Lines starting with an ”*” are comment lines and are ignored by MOSEK.

Keys:

The question marks represent keys to be specified later.

Page 227: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

18.1. MPS FILE STRUCTURE 209

Extensions:

The sections QSECTION and CSECTION are MOSEK specific extensions of the MPS format.

The standard MPS format is a fixed format, i.e. everything in the MPS file must be within certainfixed positions. MOSEK also supports a free format. See Section 18.5 for details.

18.1.1 Linear example lo1.mps

A concrete example of a MPS file is presented below:

* File: lo1.mps

NAME lo1

OBJSENSE

MAX

ROWS

N obj

E c1

G c2

L c3

COLUMNS

x1 obj 3

x1 c1 3

x1 c2 2

x2 obj 1

x2 c1 1

x2 c2 1

x2 c3 2

x3 obj 5

x3 c1 2

x3 c2 3

x4 obj 1

x4 c2 1

x4 c3 3

RHS

rhs c1 30

rhs c2 15

rhs c3 25

RANGES

BOUNDS

UP bound x2 10

ENDATA

Subsequently each individual section in the MPS format is discussed.

18.1.2 NAME

In this section a name ([name]) is assigned to the problem.

18.1.3 OBJSENSE (optional)

This is an optional section that can be used to specify the sense of the objective function. The OBJSENSEsection contains one line at most which can be one of the following

Page 228: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

210 CHAPTER 18. THE MPS FILE FORMAT

MIN

MINIMIZE

MAX

MAXIMIZE

It should be obvious what the implication is of each of these four lines.

18.1.4 OBJNAME (optional)

This is an optional section that can be used to specify the name of the row that is used as objectivefunction. The OBJNAME section contains one line at most which has the form

objname

objname should be a valid row name.

18.1.5 ROWS

A record in the ROWS section has the form

? [cname1]

where the requirements for the fields are as follows:

Field Starting Maximum Re- Descriptionposition width quired

? 2 1 Yes Constraint key[cname1] 5 8 Yes Constraint name

Hence, in this section each constraint is assigned an unique name denoted by [cname1]. Please notethat [cname1] starts in position 5 and the field can be at most 8 characters wide. An initial key (?)must be present to specify the type of the constraint. The key can have the values E, G, L, or N withthe following interpretation:

Constraint lci ucitypeE finite lciG finite ∞L −∞ finiteN −∞ ∞

In the MPS format an objective vector is not specified explicitly, but one of the constraints having thekey N will be used as the objective vector c . In general, if multiple N type constraints are specified,then the first will be used as the objective vector c .

18.1.6 COLUMNS

In this section the elements of A are specified using one or more records having the form

Page 229: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

18.1. MPS FILE STRUCTURE 211

[vname1] [cname1] [value1] [cname2] [value2]

where the requirements for each field are as follows:

Field Starting Maximum Re- Descriptionposition width quired

[vname1] 5 8 Yes Variable name[cname1] 15 8 Yes Constraint name[value1] 25 12 Yes Numerical value[cname2] 40 8 No Constraint name[value2] 50 12 No Numerical value

Hence, a record specifies one or two elements aij of A using the principle that [vname1] and [cname1]

determines j and i respectively. Please note that [cname1] must be a constraint name specified inthe ROWS section. Finally, [value1] denotes the numerical value of aij . Another optional elementis specified by [cname2], and [value2] for the variable specified by [vname1]. Some importantcomments are:

• All elements belonging to one variable must be grouped together.

• Zero elements of A should not be specified.

• At least one element for each variable should be specified.

18.1.7 RHS (optional)

A record in this section has the format

[name] [cname1] [value1] [cname2] [value2]

where the requirements for each field are as follows:

Field Starting Maximum Re- Descriptionposition width quired

[name] 5 8 Yes Name of the RHS vector[cname1] 15 8 Yes Constraint name[value1] 25 12 Yes Numerical value[cname2] 40 8 No Constraint name[value2] 50 12 No Numerical value

The interpretation of a record is that [name] is the name of the RHS vector to be specified. In general,several vectors can be specified. [cname1] denotes a constraint name previously specified in the ROWS

section. Now, assume that this name has been assigned to the i th constraint and v1 denotes the valuespecified by [value1], then the interpretation of v1 is:

Page 230: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

212 CHAPTER 18. THE MPS FILE FORMAT

Constraint lci ucitypeE v1 v1

G v1

L v1

N

An optional second element is specified by [cname2] and [value2] and is interpreted in the same way.Please note that it is not necessary to specify zero elements, because elements are assumed to be zero.

18.1.8 RANGES (optional)

A record in this section has the form

[name] [cname1] [value1] [cname2] [value2]

where the requirements for each fields are as follows:

Field Starting Maximum Re- Descriptionposition width quired

[name] 5 8 Yes Name of the RANGE vector[cname1] 15 8 Yes Constraint name[value1] 25 12 Yes Numerical value[cname2] 40 8 No Constraint name[value2] 50 12 No Numerical value

The records in this section are used to modify the bound vectors for the constraints, i.e. the valuesin lc and uc . A record has the following interpretation: [name] is the name of the RANGE vector and[cname1] is a valid constraint name. Assume that [cname1] is assigned to the i th constraint and letv1 be the value specified by [value1], then a record has the interpretation:

Constraint Sign of v1 lci ucitypeE - uci + v1

E + lci + v1

G - or + lci + |v1|L - or + uci − |v1|N

18.1.9 QSECTION (optional)

Within the QSECTION the label [cname1] must be a constraint name previously specified in the ROWS

section. The label [cname1] denotes the constraint to which the quadratic term belongs. A record inthe QSECTION has the form

[vname1] [vname2] [value1] [vname3] [value2]

where the requirements for each field are:

Page 231: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

18.1. MPS FILE STRUCTURE 213

Field Starting Maximum Re- Descriptionposition width quired

[vname1] 5 8 Yes Variable name[vname2] 15 8 Yes Variable name[value1] 25 12 Yes Numerical value[vname3] 40 8 No Variable name[value2] 50 12 No Numerical value

A record specifies one or two elements in the lower triangular part of the Qi matrix where [cname1]

specifies the i . Hence, if the names [vname1] and [vname2] have been assigned to the k th and j thvariable, then Qikj is assigned the value given by [value1] An optional second element is specified inthe same way by the fields [vname1], [vname3], and [value2].

The example

minimize − x2 + 0.5(2x21 − 2x1x3 + 0.2x2

2 + 2x23)

subject to x1 + x2 + x3 ≥ 1,x ≥ 0

has the following MPS file representation

* File: qo1.mps

NAME qo1

ROWS

N obj

G c1

COLUMNS

x1 c1 1.0

x2 obj -1.0

x2 c1 1.0

x3 c1 1.0

RHS

rhs c1 1.0

QSECTION obj

x1 x1 2.0

x1 x3 -1.0

x2 x2 0.2

x3 x3 2.0

ENDATA

Regarding the QSECTIONs please note that:

• Only one QSECTION is allowed for each constraint.

• The QSECTIONs can appear in an arbitrary order after the COLUMNS section.

• All variable names occurring in the QSECTION must already be specified in the COLUMNS section.

• All entries specified in a QSECTION are assumed to belong to the lower triangular part of thequadratic term of Q .

Page 232: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

214 CHAPTER 18. THE MPS FILE FORMAT

18.1.10 BOUNDS (optional)

In the BOUNDS section changes to the default bounds vectors lx and ux are specified. The defaultbounds vectors are lx = 0 and ux = ∞ . Moreover, it is possible to specify several sets of boundvectors. A record in this section has the form

?? [name] [vname1] [value1]

where the requirements for each field are:

Field Starting Maximum Re- Descriptionposition width quired

?? 2 2 Yes Bound key[name] 5 8 Yes Name of the BOUNDS vector[vname1] 15 8 Yes Variable name[value1] 25 12 No Numerical value

Hence, a record in the BOUNDS section has the following interpretation: [name] is the name of thebound vector and [vname1] is the name of the variable which bounds are modified by the record. ??

and [value1] are used to modify the bound vectors according to the following table:

?? lxj uxj Made integer(added to J )

FR −∞ ∞ NoFX v1 v1 NoLO v1 unchanged NoMI −∞ unchanged NoPL unchanged ∞ NoUP unchanged v1 NoBV 0 1 YesLI dv1e unchanged YesUI unchanged bv1c Yes

v1 is the value specified by [value1].

18.1.11 CSECTION (optional)

The purpose of the CSECTION is to specify the constraint

x ∈ C.in (18.1).

It is assumed that C satisfies the following requirements. Let

xt ∈ Rnt

, t = 1, . . . , k

be vectors comprised of parts of the decision variables x so that each decision variable is a member ofexactly one vector xt , for example

Page 233: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

18.1. MPS FILE STRUCTURE 215

x1 =

x1

x4

x7

and x2 =

x6

x5

x3

x2

.Next define

C :=x ∈ Rn : xt ∈ Ct, t = 1, . . . , k

where Ct must have one of the following forms

• R set:

Ct = x ∈ Rnt

.

• Quadratic cone:

Ct =

x ∈ Rnt

: x1 ≥

√√√√ nt∑j=2

x2j

. (18.2)

• Rotated quadratic cone:

Ct =

x ∈ Rnt

: 2x1x2 ≥nt∑j=3

x2j , x1, x2 ≥ 0

. (18.3)

In general, only quadratic and rotated quadratic cones are specified in the MPS file whereas membershipof the R set is not. If a variable is not a member of any other cone then it is assumed to be a memberof an R cone.

Next, let us study an example. Assume that the quadratic cone

x4 ≥√x2

5 + x28 (18.4)

and the rotated quadratic cone

2x3x7 ≥ x21 + x2

0, x3, x7 ≥ 0, (18.5)

should be specified in the MPS file. One CSECTION is required for each cone and they are specified asfollows:

* 1 2 3 4 5 6

*23456789012345678901234567890123456789012345678901234567890

CSECTION konea 0.0 QUAD

x4

x5

x8

Page 234: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

216 CHAPTER 18. THE MPS FILE FORMAT

CSECTION koneb 0.0 RQUAD

x7

x3

x1

x0

This first CSECTION specifies the cone (18.4) which is given the name konea. This is a quadratic conewhich is specified by the keyword QUAD in the CSECTION header. The 0.0 value in the CSECTION headeris not used by the QUAD cone.

The second CSECTION specifies the rotated quadratic cone (18.5). Please note the keyword RQUAD inthe CSECTION which is used to specify that the cone is a rotated quadratic cone instead of a quadraticcone. The 0.0 value in the CSECTION header is not used by the RQUAD cone.

In general, a CSECTION header has the format

CSECTION [kname1] [value1] [ktype]

where the requirement for each field are as follows:

Field Starting Maximum Re- Descriptionposition width quired

[kname1] 5 8 Yes Name of the cone[value1] 15 12 No Cone parameter[ktype] 25 Yes Type of the cone.

The possible cone type keys are:

Cone type key Members Interpretation.QUAD ≥ 1 Quadratic cone i.e. (18.2).RQUAD ≥ 2 Rotated quadratic cone i.e. (18.3).

Please note that a quadratic cone must have at least one member whereas a rotated quadratic conemust have at least two members. A record in the CSECTION has the format

[vname1]

where the requirements for each field are

Field Starting Maximum Re- Descriptionposition width quired

[vname1] 2 8 Yes A valid variable name

The most important restriction with respect to the CSECTION is that a variable must occur in only oneCSECTION.

18.1.12 ENDATA

This keyword denotes the end of the MPS file.

Page 235: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

18.2. INTEGER VARIABLES 217

18.2 Integer variables

Using special bound keys in the BOUNDS section it is possible to specify that some or all of the variablesshould be integer-constrained i.e. be members of J . However, an alternative method is available.

This method is available only for backward compatibility and we recommend that it is not used. Thismethod requires that markers are placed in the COLUMNS section as in the example:

COLUMNS

x1 obj -10.0 c1 0.7

x1 c2 0.5 c3 1.0

x1 c4 0.1

* Start of integer-constrained variables.

MARK000 ’MARKER’ ’INTORG’

x2 obj -9.0 c1 1.0

x2 c2 0.8333333333 c3 0.66666667

x2 c4 0.25

x3 obj 1.0 c6 2.0

MARK001 ’MARKER’ ’INTEND’

* End of integer-constrained variables.

Please note that special marker lines are used to indicate the start and the end of the integer variables.Furthermore be aware of the following

• IMPORTANT: All variables between the markers are assigned a default lower bound of 0 anda default upper bound of 1. This may not be what is intended. If it is not intended, thecorrect bounds should be defined in the BOUNDS section of the MPS formatted file.

• MOSEK ignores field 1, i.e. MARK0001 and MARK001, however, other optimization systems requirethem.

• Field 2, i.e. ’MARKER’, must be specified including the single quotes. This implies that no rowcan be assigned the name ’MARKER’.

• Field 3 is ignored and should be left blank.

• Field 4, i.e. ’INTORG’ and ’INTEND’, must be specified.

• It is possible to specify several such integer marker sections within the COLUMNS section.

18.3 General limitations

• An MPS file should be an ASCII file.

18.4 Interpretation of the MPS format

Several issues related to the MPS format are not well-defined by the industry standard. However,MOSEK uses the following interpretation:

Page 236: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

218 CHAPTER 18. THE MPS FILE FORMAT

• If a matrix element in the COLUMNS section is specified multiple times, then the multiple entriesare added together.

• If a matrix element in a QSECTION section is specified multiple times, then the multiple entriesare added together.

18.5 The free MPS format

MOSEK supports a free format variation of the MPS format. The free format is similar to the MPS fileformat but less restrictive, e.g. it allows longer names. However, it also presents two main limitations:

• By default a line in the MPS file must not contain more than 1024 characters. However, by mod-ifying the parameter MSK IPAR READ MPS WIDTH an arbitrary large line width will be accepted.

• A name must not contain any blanks.

To use the free MPS format instead of the default MPS format the MOSEK parameter MSK IPAR READ MPS FORMAT

should be changed.

Page 237: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

Chapter 19

The LP file format

MOSEK supports the LP file format with some extensions i.e. MOSEK can read and write LPformatted files.

Please note that the LP format is not a completely well-defined standard and hence different optimiza-tion packages may interpret the same LP file in slightly different ways. MOSEK tries to emulate asclosely as possible CPLEX’s behavior, but tries to stay backward compatible.

The LP file format can specify problems on the form

minimize/maximize cTx+1

2qo(x)

subject to lc ≤ Ax+1

2q(x) ≤ uc,

lx ≤ x ≤ ux,xJ integer,

where

• x ∈ Rn is the vector of decision variables.

• c ∈ Rn is the linear term in the objective.

• qo :∈ Rn → R is the quadratic term in the objective where

qo(x) = xTQox

and it is assumed that

Qo = (Qo)T .

• A ∈ Rm×n is the constraint matrix.

• lc ∈ Rm is the lower limit on the activity for the constraints.

219

Page 238: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

220 CHAPTER 19. THE LP FILE FORMAT

• uc ∈ Rm is the upper limit on the activity for the constraints.

• lx ∈ Rn is the lower limit on the activity for the variables.

• ux ∈ Rn is the upper limit on the activity for the variables.

• q : Rn → R is a vector of quadratic functions. Hence,

qi(x) = xTQix

where it is assumed that

Qi = (Qi)T .

• J ⊆ 1, 2, . . . , n is an index set of the integer constrained variables.

19.1 The sections

An LP formatted file contains a number of sections specifying the objective, constraints, variablebounds, and variable types. The section keywords may be any mix of upper and lower case letters.

19.1.1 The objective

The first section beginning with one of the keywords

max

maximum

maximize

min

minimum

minimize

defines the objective sense and the objective function, i.e.

cTx+1

2xTQox.

The objective may be given a name by writing

myname:

before the expressions. If no name is given, then the objective is named obj.

The objective function contains linear and quadratic terms. The linear terms are written as

4 x1 + x2 - 0.1 x3

and so forth. The quadratic terms are written in square brackets ([]) and are either squared ormultiplied as in the examples

x1^2

and

Page 239: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

19.1. THE SECTIONS 221

x1 * x2

There may be zero or more pairs of brackets containing quadratic expressions.

An example of an objective section is:

minimize

myobj: 4 x1 + x2 - 0.1 x3 + [ x1^2 + 2.1 x1 * x2 ]/2

Please note that the quadratic expressions are multiplied with 12 , so that the above expression means

minimize 4x1 + x2 − 0.1 · x3 +1

2(x2

1 + 2.1 · x1 · x2)

If the same variable occurs more than once in the linear part, the coefficients are added, so that 4 x1

+ 2 x1 is equivalent to 6 x1. In the quadratic expressions x1 * x2 is equivalent to x2 * x1 and asin the linear part , if the same variables multiplied or squared occur several times their coefficients areadded.

19.1.2 The constraints

The second section beginning with one of the keywords

subj to

subject to

s.t.

st

defines the linear constraint matrix (A ) and the quadratic matrices (Qi ).

A constraint contains a name (optional), expressions adhering to the same rules as in the objectiveand a bound:

subject to

con1: x1 + x2 + [ x3^2 ]/2 <= 5.1

The bound type (here <=) may be any of <, <=, =, >, >= (< and <= mean the same), and the boundmay be any number.

In the standard LP format it is not possible to define more than one bound, but MOSEK supportsdefining ranged constraints by using double-colon (’’::’’) instead of a single-colon (”:”) after theconstraint name, i.e.

− 5 ≤ x1 + x2 ≤ 5 (19.1)

may be written as

con:: -5 < x 1 + x 2 < 5

By default MOSEK writes ranged constraints this way.

If the files must adhere to the LP standard, ranged constraints must either be split into upper boundedand lower bounded constraints or be written as en equality with a slack variable. For example theexpression (19.1) may be written as

x1 + x2 − sl1 = 0,−5 ≤ sl1 ≤ 5.

Page 240: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

222 CHAPTER 19. THE LP FILE FORMAT

19.1.3 Bounds

Bounds on the variables can be specified in the bound section beginning with one of the keywords

bound

bounds

The bounds section is optional but should, if present, follow the subject to section. All variableslisted in the bounds section must occur in either the objective or a constraint.

The default lower and upper bounds are 0 and +∞ . A variable may be declared free with the keywordfree, which means that the lower bound is −∞ and the upper bound is +∞ . Furthermore it may beassigned a finite lower and upper bound. The bound definitions for a given variable may be written inone or two lines, and bounds can be any number or ±∞ (written as +inf/-inf/+infinity/-infinity)as in the example

bounds

x1 free

x2 <= 5

0.1 <= x2

x3 = 42

2 <= x4 < +inf

19.1.4 Variable types

The final two sections are optional and must begin with one of the keywords

bin

binaries

binary

and

gen

general

Under general all integer variables are listed, and under binary all binary (integer variables withbounds 0 and 1) are listed:

general

x1 x2

binary

x3 x4

Again, all variables listed in the binary or general sections must occur in either the objective or aconstraint.

19.1.5 Terminating section

Finally, an LP formatted file must be terminated with the keyword

end

Page 241: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

19.2. LP FORMAT PECULIARITIES 223

19.1.6 Linear example lo1.lp

A simple example of an LP file is:

\ File: lo1.lp

maximize

obj: 3 x1 + x2 + 5 x3 + x4

subject to

c1: 3 x1 + x2 + 2 x3 = 30

c2: 2 x1 + x2 + 3 x3 + x4 >= 15

c3: 2 x2 + 3 x4 <= 25

bounds

0 <= x1 <= +infinity

0 <= x2 <= 10

0 <= x3 <= +infinity

0 <= x4 <= +infinity

end

19.1.7 Mixed integer example milo1.lp

maximize

obj: x1 + 6.4e-01 x2

subject to

c1: 5e+01 x1 + 3.1e+01 x2 <= 2.5e+02

c2: 3e+00 x1 - 2e+00 x2 >= -4e+00

bounds

0 <= x1 <= +infinity

0 <= x2 <= +infinity

general

x1 x2

end

19.2 LP format peculiarities

19.2.1 Comments

Anything on a line after a ”\” is ignored and is treated as a comment.

19.2.2 Names

A name for an objective, a constraint or a variable may contain the letters a-z, A-Z, the digits 0-9 andthe characters

!"#$%&()/,.;?@ ’‘|~

The first character in a name must not be a number, a period or the letter ’e’ or ’E’. Keywords mustnot be used as names.

MOSEK accepts any character as valid for names, except ‘\0’. When writing a name that is notallowed in LP files, it is changed and a warning is issued.

Page 242: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

224 CHAPTER 19. THE LP FILE FORMAT

The algorithm for making names LP valid works as follows: The name is interpreted as an utf-8

string. For a unicode character c:

• If c==‘ ’ (underscore), the output is ‘ ’ (two underscores).

• If c is a valid LP name character, the output is just c.

• If c is another character in the ASCII range, the output is XX, where XX is the hexadecimal codefor the character.

• If c is a character in the range 127—65535, the output is uXXXX, where XXXX is the hexadecimalcode for the character.

• If c is a character above 65535, the output is UXXXXXXXX, where XXXXXXXX is the hexadecimalcode for the character.

Invalid utf-8 substrings are escaped as ‘ XX’, and if a name starts with a period, ‘e’ or ‘E’, thatcharacter is escaped as ‘ XX’.

19.2.3 Variable bounds

Specifying several upper or lower bounds on one variable is possible but MOSEK uses only the tightestbounds. If a variable is fixed (with =), then it is considered the tightest bound.

19.2.4 MOSEK specific extensions to the LP format

Some optimization software packages employ a more strict definition of the LP format that the oneused by MOSEK. The limitations imposed by the strict LP format are the following:

• Quadratic terms in the constraints are not allowed.

• Names can be only 16 characters long.

• Lines must not exceed 255 characters in length.

If an LP formatted file created by MOSEK should satisfies the strict definition, then the parameter

MSK IPAR WRITE LP STRICT FORMAT

should be set; note, however, that some problems cannot be written correctly as a strict LP formattedfile. For instance, all names are truncated to 16 characters and hence they may loose their uniquenessand change the problem.

To get around some of the inconveniences converting from other problem formats, MOSEK allows linesto contain 1024 characters and names may have any length (shorter than the 1024 characters).

Internally in MOSEK names may contain any (printable) character, many of which cannot be used inLP names. Setting the parameters

Page 243: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

19.3. THE STRICT LP FORMAT 225

MSK IPAR READ LP QUOTED NAMES

and

MSK IPAR WRITE LP QUOTED NAMES

allows MOSEK to use quoted names. The first parameter tells MOSEK to remove quotes from quotednames e.g, "x1", when reading LP formatted files. The second parameter tells MOSEK to put quotesaround any semi-illegal name (names beginning with a number or a period) and fully illegal name(containing illegal characters). As double quote is a legal character in the LP format, quoting semi-illegal names makes them legal in the pure LP format as long as they are still shorter than 16 characters.Fully illegal names are still illegal in a pure LP file.

19.3 The strict LP format

The LP format is not a formal standard and different vendors have slightly different interpretations ofthe LP format. To make MOSEK’s definition of the LP format more compatible with the definitionsof other vendors, use the parameter setting

MSK IPAR WRITE LP STRICT FORMAT = MSK ON

This setting may lead to truncation of some names and hence to an invalid LP file. The simple solutionto this problem is to use the parameter setting

MSK IPAR WRITE GENERIC NAMES = MSK ON

which will cause all names to be renamed systematically in the output file.

19.4 Formatting of an LP file

A few parameters control the visual formatting of LP files written by MOSEK in order to make iteasier to read the files. These parameters are

MSK IPAR WRITE LP LINE WIDTH

MSK IPAR WRITE LP TERMS PER LINE

The first parameter sets the maximum number of characters on a single line. The default value is 80corresponding roughly to the width of a standard text document.

The second parameter sets the maximum number of terms per line; a term means a sign, a coefficient,and a name (for example ”+ 42 elephants”). The default value is 0, meaning that there is nomaximum.

Page 244: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

226 CHAPTER 19. THE LP FILE FORMAT

19.4.1 Speeding up file reading

If the input file should be read as fast as possible using the least amount of memory, then it is importantto tell MOSEK how many non-zeros, variables and constraints the problem contains. These values canbe set using the parameters

MSK IPAR READ CON

MSK IPAR READ VAR

MSK IPAR READ ANZ

MSK IPAR READ QNZ

19.4.2 Unnamed constraints

Reading and writing an LP file with MOSEK may change it superficially. If an LP file containsunnamed constraints or objective these are given their generic names when the file is read (howeverunnamed constraints in MOSEK are written without names).

Page 245: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

Chapter 20

The OPF format

The Optimization Problem Format (OPF) is an alternative to LP and MPS files for specifying opti-mization problems. It is row-oriented, inspired by the CPLEX LP format.

Apart from containing objective, constraints, bounds etc. it may contain complete or partial solutions,comments and extra information relevant for solving the problem. It is designed to be easily read andmodified by hand and to be forward compatible with possible future extensions.

20.1 Intended use

The OPF file format is meant to replace several other files:

• The LP file format. Any problem that can be written as an LP file can be written as an OPF fileto; furthermore it naturally accommodates ranged constraints and variables as well as arbitrarycharacters in names, fixed expressions in the objective, empty constraints, and conic constraints.

• Parameter files. It is possible to specify integer, double and string parameters along with theproblem (or in a separate OPF file).

• Solution files. It is possible to store a full or a partial solution in an OPF file and later reload it.

20.2 The file format

The format uses tags to structure data. A simple example with the basic sections may look like this:

[comment]

This is a comment. You may write almost anything here...

[/comment]

# This is a single-line comment.

[objective min ’myobj’]

227

Page 246: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

228 CHAPTER 20. THE OPF FORMAT

x + 3 y + x^2 + 3 y^2 + z + 1

[/objective]

[constraints]

[con ’con01’] 4 <= x + y [/con]

[/constraints]

[bounds]

[b] -10 <= x,y <= 10 [/b]

[cone quad] x,y,z [/cone]

[/bounds]

A scope is opened by a tag of the form [tag] and closed by a tag of the form [/tag]. An opening tagmay accept a list of unnamed and named arguments, for examples

[tag value] tag with one unnamed argument [/tag]

[tag arg=value] tag with one named argument in quotes [/tag]

Unnamed arguments are identified by their order, while named arguments may appear in any order,but never before an unnamed argument. The value can be a quoted, single-quoted or double-quotedtext string, i.e.

[tag ’value’] single-quoted value [/tag]

[tag arg=’value’] single-quoted value [/tag]

[tag "value"] double-quoted value [/tag]

[tag arg="value"] double-quoted value [/tag]

20.2.1 Sections

The recognized tags are

• [comment] A comment section. This can contain almost any text: Between single quotes (’) ordouble quotes (") any text may appear. Outside quotes the markup characters ([ and ]) mustbe prefixed by backslashes. Both single and double quotes may appear alone or inside a pair ofquotes if it is prefixed by a backslash.

• [objective] The objective function: This accepts one or two parameters, where the first one(in the above example ‘min’) is either min or max (regardless of case) and defines the objectivesense, and the second one (above ‘myobj’), if present, is the objective name. The section maycontain linear and quadratic expressions.

If several objectives are specified, all but the last are ignored.

• [constraints] This does not directly contain any data, but may contain the subsection ‘con’defining a linear constraint.

[con] defines a single constraint; if an argument is present ([con NAME]) this is used as the nameof the constraint, otherwise it is given a null-name. The section contains a constraint definitionwritten as linear and quadratic expressions with a lower bound, an upper bound, with both orwith an equality. Examples:

[constraints]

[con ’con1’] 0 <= x + y [/con]

[con ’con2’] 0 >= x + y [/con]

Page 247: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

20.2. THE FILE FORMAT 229

[con ’con3’] 0 <= x + y <= 10 [/con]

[con ’con4’] x + y = 10 [/con]

[/constraints]

Constraint names are unique. If a constraint is specified which has the same name as a previouslydefined constraint, the new constraint replaces the existing one.

• [bounds] This does not directly contain any data, but may contain the subsections ‘b’ (linearbounds on variables) and cone’ (quadratic cone).

– [b]. Bound definition on one or several variables separated by comma (‘,’). An upper orlower bound on a variable replaces any earlier defined bound on that variable. If only onebound (upper or lower) is given only this bound is replaced. This means that upper andlower bounds can be specified separately. So the OPF bound definition:[b] x,y >= -10 [/b]

[b] x,y <= 10 [/b]

results in the bound

−10 ≤ x, y ≤ 10.

– [cone]. Currently, the supported cones are the quadratic cone and the rotated quadraticcone A conic constraint is defined as a set of variables which belongs to a single unique cone.

A quadratic cone of n variables x1, . . . , xn defines a constraint of the form

x21 >

n∑i=2

x2i .

A rotated quadratic cone of n variables x1, . . . , xn defines a constraint of the form

x1x2 >

n∑i=3

x2i .

A [bounds]-section example:

[bounds]

[b] 0 <= x,y <= 10 [/b] # ranged bound

[b] 10 >= x,y >= 0 [/b] # ranged bound

[b] 0 <= x,y <= inf [/b] # using inf

[b] x,y free [/b] # free variables

# Let (x,y,z,w) belong to the cone K

[cone quad] x,y,z,w [/cone] # quadratic cone

[cone rquad] x,y,z,w [/cone] # rotated quadratic cone

[/bounds]

By default all variables are free.

• [variables] This defines an ordering of variables as they should appear in the problem. Thisis simply a space-separated list of variable names.

• [integer] This contains a space-separated list of variables and defines the constraint that thelisted variables must be integer values.

Page 248: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

230 CHAPTER 20. THE OPF FORMAT

• [hints] This may contain only non-essential data; for example estimates of the number ofvariables, constraints and non-zeros. Placed before all other sections containing data this mayreduce the time spent reading the file.

In the hints section, any subsection which is not recognized by MOSEK is simply ignored. Inthis section a hint in a subsection is defined as follows:

[hint ITEM] value [/hint]

where ITEM may be replaced by numvar (number of variables), numcon (number of linear/quadraticconstraints), numanz (number of linear non-zeros in constraints) and numqnz (number of quadraticnon-zeros in constraints).

• [solutions] This section can contain a set of full or partial solutions to a problem. Each solutionmust be specified using a [solution]-section, i.e.

[solutions]

[solution]...[/solution] #solution 1

[solution]...[/solution] #solution 2

#other solutions....

[solution]...[/solution] #solution n

[/solutions]

Note that a [solution]-section must be always specified inside a [solutions]-section. Thesyntax of a [solution]-section is the following:

[solution SOLTYPE status=STATUS]...[/solution]

where SOLTYPE is one of the strings

– ‘interior’, a non-basic solution,

– ‘basic’, a basic solution,

– ‘integer’, an integer solution,

and STATUS is one of the strings

– ‘UNKNOWN’,

– ‘OPTIMAL’,

– ‘INTEGER OPTIMAL’,

– ‘PRIM FEAS’,

– ‘DUAL FEAS’,

– ‘PRIM AND DUAL FEAS’,

– ‘NEAR OPTIMAL’,

– ‘NEAR PRIM FEAS’,

– ‘NEAR DUAL FEAS’,

– ‘NEAR PRIM AND DUAL FEAS’,

– ‘PRIM INFEAS CER’,

– ‘DUAL INFEAS CER’,

– ‘NEAR PRIM INFEAS CER’,

Page 249: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

20.2. THE FILE FORMAT 231

– ‘NEAR DUAL INFEAS CER’,

– ‘NEAR INTEGER OPTIMAL’.

Most of these values are irrelevant for input solutions; when constructing a solution for simplexhot-start or an initial solution for a mixed integer problem the safe setting is UNKNOWN.

A [solution]-section contains [con] and [var] sections. Each [con] and [var] section definessolution information for a single variable or constraint, specified as list of KEYWORD/value pairs,in any order, written as

KEYWORD=value

Allowed keywords are as follows:

– sk. The status of the item, where the value is one of the following strings:

∗ LOW, the item is on its lower bound.

∗ UPR, the item is on its upper bound.

∗ FIX, it is a fixed item.

∗ BAS, the item is in the basis.

∗ SUPBAS, the item is super basic.

∗ UNK, the status is unknown.

∗ INF, the item is outside its bounds (infeasible).

– lvl Defines the level of the item.

– sl Defines the level of the dual variable associated with its lower bound.

– su Defines the level of the dual variable associated with its upper bound.

– sn Defines the level of the variable associated with its cone.

– y Defines the level of the corresponding dual variable (for constraints only).

A [var] section should always contain the items sk, lvl, sl and su. Items sl and su are notrequired for integer solutions.

A [con] section should always contain sk, lvl, sl, su and y.

An example of a solution section

[solution basic status=UNKNOWN]

[var x0] sk=LOW lvl=5.0 [/var]

[var x1] sk=UPR lvl=10.0 [/var]

[var x2] sk=SUPBAS lvl=2.0 sl=1.5 su=0.0 [/var]

[con c0] sk=LOW lvl=3.0 y=0.0 [/con]

[con c0] sk=UPR lvl=0.0 y=5.0 [/con]

[/solution]

• [vendor] This contains solver/vendor specific data. It accepts one argument, which is a vendorID – for MOSEK the ID is simply mosek – and the section contains the subsection parameters

defining solver parameters. When reading a vendor section, any unknown vendor can be safelyignored. This is described later.

Comments using the ‘#’ may appear anywhere in the file. Between the ‘#’ and the following line-breakany text may be written, including markup characters.

Page 250: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

232 CHAPTER 20. THE OPF FORMAT

20.2.2 Numbers

Numbers, when used for parameter values or coefficients, are written in the usual way by the printf

function. That is, they may be prefixed by a sign (+ or -) and may contain an integer part, decimalpart and an exponent. The decimal point is always ‘.’ (a dot). Some examples are

1

1.0

.0

1.

1e10

1e+10

1e-10

Some invalid examples are

e10 # invalid, must contain either integer or decimal part

. # invalid

.e10 # invalid

More formally, the following standard regular expression describes numbers as used:

[+|-]?([0-9]+[.][0-9]*|[.][0-9]+)([eE][+|-]?[0-9]+)?

20.2.3 Names

Variable names, constraint names and objective name may contain arbitrary characters, which in somecases must be enclosed by quotes (single or double) that in turn must be preceded by a backslash.Unquoted names must begin with a letter (a-z or A-Z) and contain only the following characters: theletters a-z and A-Z, the digits 0-9, braces ( and ) and underscore ( ).

Some examples of legal names:

an unquoted name

another name123’single quoted name’

"double quoted name"

"name with \\"quote\\" in it"

"name with []s in it"

20.3 Parameters section

In the vendor section solver parameters are defined inside the parameters subsection. Each parameteris written as

[p PARAMETER NAME] value [/p]

where PARAMETER NAME is replaced by a MOSEK parameter name, usually of the form MSK IPAR ...,MSK DPAR ... or MSK SPAR ..., and the value is replaced by the value of that parameter; both integervalues and named values may be used. Some simple examples are:

[vendor mosek]

[parameters]

[p MSK IPAR OPF MAX TERMS PER LINE] 10 [/p]

Page 251: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

20.4. WRITING OPF FILES FROM MOSEK 233

[p MSK IPAR OPF WRITE PARAMETERS] MSK ON [/p]

[p MSK DPAR DATA TOL BOUND INF] 1.0e18 [/p]

[/parameters]

[/vendor]

20.4 Writing OPF files from MOSEK

To write an OPF file set the parameter MSK IPAR WRITE DATA FORMAT to MSK DATA FORMAT OP as thisensures that OPF format is used. Then modify the following parameters to define what the file shouldcontain:

• MSK IPAR OPF WRITE HEADER, include a small header with comments.

• MSK IPAR OPF WRITE HINTS, include hints about the size of the problem.

• MSK IPAR OPF WRITE PROBLEM, include the problem itself — objective, constraints and bounds.

• MSK IPAR OPF WRITE SOLUTIONS, include solutions if they are defined. If this is off, no solutionsare included.

• MSK IPAR OPF WRITE SOL BAS, include basic solution, if defined.

• MSK IPAR OPF WRITE SOL ITG, include integer solution, if defined.

• MSK IPAR OPF WRITE SOL ITR, include interior solution, if defined.

• MSK IPAR OPF WRITE PARAMETERS, include all parameter settings.

20.5 Examples

This section contains a set of small examples written in OPF and describing how to formulate linear,quadratic and conic problems.

20.5.1 Linear example lo1.opf

Consider the example:

maximize 3x0 + 1x1 + 5x2 + 1x3

subject to 3x0 + 1x1 + 2x2 = 30,2x0 + 1x1 + 3x2 + 1x3 ≥ 15,

2x1 + 3x3 ≤ 25,

having the bounds

Page 252: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

234 CHAPTER 20. THE OPF FORMAT

0 ≤ x0 ≤ ∞,0 ≤ x1 ≤ 10,0 ≤ x2 ≤ ∞,0 ≤ x3 ≤ ∞.

In the OPF format the example is displayed as shown below:

[comment]

The lo1 example in OPF format

[/comment]

[hints]

[hint NUMVAR] 4 [/hint]

[hint NUMCON] 3 [/hint]

[hint NUMANZ] 9 [/hint]

[/hints]

[variables disallow new variables]

x1 x2 x3 x4

[/variables]

[objective maximize ’obj’]

3 x1 + x2 + 5 x3 + x4

[/objective]

[constraints]

[con ’c1’] 3 x1 + x2 + 2 x3 = 30 [/con]

[con ’c2’] 2 x1 + x2 + 3 x3 + x4 >= 15 [/con]

[con ’c3’] 2 x2 + 3 x4 <= 25 [/con]

[/constraints]

[bounds]

[b] 0 <= * [/b]

[b] 0 <= x2 <= 10 [/b]

[/bounds]

20.5.2 Quadratic example qo1.opf

An example of a quadratic optimization problem is

minimize x21 + 0.1x2

2 + x23 − x1x3 − x2

subject to 1 ≤ x1 + x2 + x3,x ≥ 0.

This can be formulated in opf as shown below.

[comment]

The qo1 example in OPF format

[/comment]

[hints]

[hint NUMVAR] 3 [/hint]

[hint NUMCON] 1 [/hint]

[hint NUMANZ] 3 [/hint]

[hint NUMQNZ] 4 [/hint]

Page 253: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

20.5. EXAMPLES 235

[/hints]

[variables disallow new variables]

x1 x2 x3

[/variables]

[objective minimize ’obj’]

# The quadratic terms are often written with a factor of 1/2 as here,

# but this is not required.

- x2 + 0.5 ( 2.0 x1 ^ 2 - 2.0 x3 * x1 + 0.2 x2 ^ 2 + 2.0 x3 ^ 2 )

[/objective]

[constraints]

[con ’c1’] 1.0 <= x1 + x2 + x3 [/con]

[/constraints]

[bounds]

[b] 0 <= * [/b]

[/bounds]

20.5.3 Conic quadratic example cqo1.opf

Consider the example:

minimize x3 + x4 + x5

subject to x0 + x1 + 2x2 = 1,x0, x1, x2 ≥ 0,

x3 ≥√x2

0 + x21,

2x4x5 ≥ x22.

Please note that the type of the cones is defined by the parameter to [cone ...]; the content of thecone-section is the names of variables that belong to the cone.

[comment]

The cqo1 example in OPF format.

[/comment]

[hints]

[hint NUMVAR] 6 [/hint]

[hint NUMCON] 1 [/hint]

[hint NUMANZ] 3 [/hint]

[/hints]

[variables disallow new variables]

x1 x2 x3 x4 x5 x6

[/variables]

[objective minimize ’obj’]

x4 + x5 + x6

[/objective]

[constraints]

[con ’c1’] x1 + x2 + 2e+00 x3 = 1e+00 [/con]

Page 254: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

236 CHAPTER 20. THE OPF FORMAT

[/constraints]

[bounds]

# We let all variables default to the positive orthant

[b] 0 <= * [/b]

# ...and change those that differ from the default

[b] x4,x5,x6 free [/b]

# Define quadratic cone: x4 >= sqrt( x1^2 + x2^2 )

[cone quad ’k1’] x4, x1, x2 [/cone]

# Define rotated quadratic cone: 2 x5 x6 >= x3^2

[cone rquad ’k2’] x5, x6, x3 [/cone]

[/bounds]

20.5.4 Mixed integer example milo1.opf

Consider the mixed integer problem:

maximize x0 + 0.64x1

subject to 50x0 + 31x1 ≤ 250,3x0 − 2x1 ≥ − 4,x0, x1 ≥ 0 and integer

This can be implemented in OPF with:

[comment]

The milo1 example in OPF format

[/comment]

[hints]

[hint NUMVAR] 2 [/hint]

[hint NUMCON] 2 [/hint]

[hint NUMANZ] 4 [/hint]

[/hints]

[variables disallow new variables]

x1 x2

[/variables]

[objective maximize ’obj’]

x1 + 6.4e-1 x2

[/objective]

[constraints]

[con ’c1’] 5e+1 x1 + 3.1e+1 x2 <= 2.5e+2 [/con]

[con ’c2’] -4 <= 3 x1 - 2 x2 [/con]

[/constraints]

[bounds]

[b] 0 <= * [/b]

[/bounds]

[integer]

Page 255: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

20.5. EXAMPLES 237

x1 x2

[/integer]

Page 256: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

238 CHAPTER 20. THE OPF FORMAT

Page 257: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

Chapter 21

The Task format

The Task format is MOSEK’s native binary format. It contains a complete image of a MOSEK task,i.e.

• Problem data: Linear, conic quadratic, semidefinite and quadratic data

• Problem item names: Variable names, constraints names, cone names etc.

• Parameter settings

• Solutions

There are a few things to be aware of:

• The task format does not support General Convex problems since these are defined by arbitraryuser-defined functions.

• Status of a solution read from a file will always be unknown.

The format is based on the TAR (USTar) file format. This means that the individual pieces of datain a .task file can be examined by unpacking it as a TAR file. Please note that the inverse may notwork: Creating a file using TAR will most probably not create a valid MOSEK Task file since theorder of the entries is important.

239

Page 258: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

240 CHAPTER 21. THE TASK FORMAT

Page 259: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

Chapter 22

The XML (OSiL) format

MOSEK can write data in the standard OSiL xml format. For a definition of the OSiL format pleasesee http://www.optimizationservices.org/. Only linear constraints (possibly with integer variables) aresupported. By default output files with the extension .xml are written in the OSiL format.

The parameter MSK IPAR WRITE XML MODE controls if the linear coefficients in the A matrix are writtenin row or column order.

241

Page 260: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

242 CHAPTER 22. THE XML (OSIL) FORMAT

Page 261: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

Chapter 23

Parameters

Parameters grouped by functionality.

Analysis parameters.

Parameters controling the behaviour of the problem and solution analyzers.

• MSK DPAR ANA SOL INFEAS TOL. If a constraint violates its bound with an amount largerthan this value, the constraint name, index and violation will be printed by the solutionanalyzer.

Basis identification parameters.

• MSK IPAR BI CLEAN OPTIMIZER. Controls which simplex optimizer is used in the clean-upphase.

• MSK IPAR BI IGNORE MAX ITER. Turns on basis identification in case the interior-point op-timizer is terminated due to maximum number of iterations.

• MSK IPAR BI IGNORE NUM ERROR. Turns on basis identification in case the interior-point op-timizer is terminated due to a numerical problem.

• MSK IPAR BI MAX ITERATIONS. Maximum number of iterations after basis identification.

• MSK IPAR INTPNT BASIS. Controls whether basis identification is performed.

• MSK IPAR LOG BI. Controls the amount of output printed by the basis identification proce-dure. A higher level implies that more information is logged.

• MSK IPAR LOG BI FREQ. Controls the logging frequency.

• MSK DPAR SIM LU TOL REL PIV. Relative pivot tolerance employed when computing the LUfactorization of the basis matrix.

Behavior of the optimization task.

Parameters defining the behavior of an optimization task when loading data.

• MSK SPAR FEASREPAIR NAME PREFIX. Feasibility repair name prefix.

243

Page 262: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

244 CHAPTER 23. PARAMETERS

• MSK SPAR FEASREPAIR NAME SEPARATOR. Feasibility repair name separator.

• MSK SPAR FEASREPAIR NAME WSUMVIOL. Feasibility repair name violation name.

Conic interior-point method parameters.

Parameters defining the behavior of the interior-point method for conic problems.

• MSK DPAR INTPNT CO TOL DFEAS. Dual feasibility tolerance used by the conic interior-pointoptimizer.

• MSK DPAR INTPNT CO TOL INFEAS. Infeasibility tolerance for the conic solver.

• MSK DPAR INTPNT CO TOL MU RED. Optimality tolerance for the conic solver.

• MSK DPAR INTPNT CO TOL NEAR REL. Optimality tolerance for the conic solver.

• MSK DPAR INTPNT CO TOL PFEAS. Primal feasibility tolerance used by the conic interior-pointoptimizer.

• MSK DPAR INTPNT CO TOL REL GAP. Relative gap termination tolerance used by the conicinterior-point optimizer.

Data check parameters.

These parameters defines data checking settings and problem data tolerances, i.e. which valuesare rounded to 0 or infinity, and which values are large or small enough to produce a warning.

• MSK DPAR DATA TOL AIJ. Data tolerance threshold.

• MSK DPAR DATA TOL AIJ HUGE. Data tolerance threshold.

• MSK DPAR DATA TOL AIJ LARGE. Data tolerance threshold.

• MSK DPAR DATA TOL BOUND INF. Data tolerance threshold.

• MSK DPAR DATA TOL BOUND WRN. Data tolerance threshold.

• MSK DPAR DATA TOL C HUGE. Data tolerance threshold.

• MSK DPAR DATA TOL CJ LARGE. Data tolerance threshold.

• MSK DPAR DATA TOL QIJ. Data tolerance threshold.

• MSK DPAR DATA TOL X. Data tolerance threshold.

• MSK IPAR LOG CHECK CONVEXITY. Controls logging in convexity check on quadratic prob-lems. Set to a positive value to turn logging on.

If a quadratic coefficient matrix is found to violate the requirement of PSD (NSD) then alist of negative (positive) pivot elements is printed. The absolute value of the pivot elementsis also shown.

Data input/output parameters.

Parameters defining the behavior of data readers and writers.

• MSK SPAR BAS SOL FILE NAME. Name of the bas solution file.

• MSK SPAR DATA FILE NAME. Data are read and written to this file.

• MSK SPAR DEBUG FILE NAME. MOSEK debug file.

• MSK SPAR INT SOL FILE NAME. Name of the int solution file.

Page 263: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

245

• MSK SPAR ITR SOL FILE NAME. Name of the itr solution file.

• MSK IPAR LOG FILE. If turned on, then some log info is printed when a file is written orread.

• MSK SPAR MIO DEBUG STRING. For internal use only.

• MSK SPAR PARAM COMMENT SIGN. Solution file comment character.

• MSK SPAR PARAM READ FILE NAME. Modifications to the parameter database is read from thisfile.

• MSK SPAR PARAM WRITE FILE NAME. The parameter database is written to this file.

• MSK SPAR READ MPS BOU NAME. Name of the BOUNDS vector used. An empty name meansthat the first BOUNDS vector is used.

• MSK SPAR READ MPS OBJ NAME. Objective name in the MPS file.

• MSK SPAR READ MPS RAN NAME. Name of the RANGE vector used. An empty name meansthat the first RANGE vector is used.

• MSK SPAR READ MPS RHS NAME. Name of the RHS used. An empty name means that the firstRHS vector is used.

• MSK SPAR SOL FILTER XC LOW. Solution file filter.

• MSK SPAR SOL FILTER XC UPR. Solution file filter.

• MSK SPAR SOL FILTER XX LOW. Solution file filter.

• MSK SPAR SOL FILTER XX UPR. Solution file filter.

• MSK SPAR STAT FILE NAME. Statistics file name.

• MSK SPAR STAT KEY. Key used when writing the summary file.

• MSK SPAR STAT NAME. Name used when writing the statistics file.

• MSK SPAR WRITE LP GEN VAR NAME. Added variable names in the LP files.

Debugging parameters.

These parameters defines that can be used when debugging a problem.

• MSK IPAR AUTO SORT A BEFORE OPT. Controls whether the elements in each column of A aresorted before an optimization is performed.

Dual simplex optimizer parameters.

Parameters defining the behavior of the dual simplex optimizer for linear problems.

• MSK IPAR SIM DUAL CRASH. Controls whether crashing is performed in the dual simplex op-timizer.

• MSK IPAR SIM DUAL RESTRICT SELECTION. Controls how aggressively restricted selection isused.

• MSK IPAR SIM DUAL SELECTION. Controls the dual simplex strategy.

Feasibility repair parameters.

Page 264: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

246 CHAPTER 23. PARAMETERS

• MSK DPAR FEASREPAIR TOL. Tolerance for constraint enforcing upper bound on sum of weightedviolations in feasibility repair.

Infeasibility report parameters.

• MSK IPAR LOG INFEAS ANA. Controls log level for the infeasibility analyzer.

Interior-point method parameters.

Parameters defining the behavior of the interior-point method for linear, conic and convex prob-lems.

• MSK IPAR BI IGNORE MAX ITER. Turns on basis identification in case the interior-point op-timizer is terminated due to maximum number of iterations.

• MSK IPAR BI IGNORE NUM ERROR. Turns on basis identification in case the interior-point op-timizer is terminated due to a numerical problem.

• MSK DPAR CHECK CONVEXITY REL TOL. Convexity check tolerance.

• MSK IPAR INTPNT BASIS. Controls whether basis identification is performed.

• MSK DPAR INTPNT CO TOL DFEAS. Dual feasibility tolerance used by the conic interior-pointoptimizer.

• MSK DPAR INTPNT CO TOL INFEAS. Infeasibility tolerance for the conic solver.

• MSK DPAR INTPNT CO TOL MU RED. Optimality tolerance for the conic solver.

• MSK DPAR INTPNT CO TOL NEAR REL. Optimality tolerance for the conic solver.

• MSK DPAR INTPNT CO TOL PFEAS. Primal feasibility tolerance used by the conic interior-pointoptimizer.

• MSK DPAR INTPNT CO TOL REL GAP. Relative gap termination tolerance used by the conicinterior-point optimizer.

• MSK IPAR INTPNT DIFF STEP. Controls whether different step sizes are allowed in the primaland dual space.

• MSK IPAR INTPNT MAX ITERATIONS. Controls the maximum number of iterations allowed inthe interior-point optimizer.

• MSK IPAR INTPNT MAX NUM COR. Maximum number of correction steps.

• MSK IPAR INTPNT MAX NUM REFINEMENT STEPS. Maximum number of steps to be used bythe iterative search direction refinement.

• MSK DPAR INTPNT NL MERIT BAL. Controls if the complementarity and infeasibility is con-verging to zero at about equal rates.

• MSK DPAR INTPNT NL TOL DFEAS. Dual feasibility tolerance used when a nonlinear model issolved.

• MSK DPAR INTPNT NL TOL MU RED. Relative complementarity gap tolerance.

• MSK DPAR INTPNT NL TOL NEAR REL. Nonlinear solver optimality tolerance parameter.

• MSK DPAR INTPNT NL TOL PFEAS. Primal feasibility tolerance used when a nonlinear modelis solved.

Page 265: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

247

• MSK DPAR INTPNT NL TOL REL GAP. Relative gap termination tolerance for nonlinear prob-lems.

• MSK DPAR INTPNT NL TOL REL STEP. Relative step size to the boundary for general nonlinearoptimization problems.

• MSK IPAR INTPNT OFF COL TRH. Controls the aggressiveness of the offending column detec-tion.

• MSK IPAR INTPNT ORDER METHOD. Controls the ordering strategy.

• MSK IPAR INTPNT REGULARIZATION USE. Controls whether regularization is allowed.

• MSK IPAR INTPNT SCALING. Controls how the problem is scaled before the interior-pointoptimizer is used.

• MSK IPAR INTPNT SOLVE FORM. Controls whether the primal or the dual problem is solved.

• MSK IPAR INTPNT STARTING POINT. Starting point used by the interior-point optimizer.

• MSK DPAR INTPNT TOL DFEAS. Dual feasibility tolerance used for linear and quadratic opti-mization problems.

• MSK DPAR INTPNT TOL DSAFE. Controls the interior-point dual starting point.

• MSK DPAR INTPNT TOL INFEAS. Nonlinear solver infeasibility tolerance parameter.

• MSK DPAR INTPNT TOL MU RED. Relative complementarity gap tolerance.

• MSK DPAR INTPNT TOL PATH. interior-point centering aggressiveness.

• MSK DPAR INTPNT TOL PFEAS. Primal feasibility tolerance used for linear and quadratic op-timization problems.

• MSK DPAR INTPNT TOL PSAFE. Controls the interior-point primal starting point.

• MSK DPAR INTPNT TOL REL GAP. Relative gap termination tolerance.

• MSK DPAR INTPNT TOL REL STEP. Relative step size to the boundary for linear and quadraticoptimization problems.

• MSK DPAR INTPNT TOL STEP SIZE. If the step size falls below the value of this parameter,then the interior-point optimizer assumes that it is stalled. In other words the interior-pointoptimizer does not make any progress and therefore it is better stop.

• MSK IPAR LOG INTPNT. Controls the amount of log information from the interior-point op-timizers.

• MSK IPAR LOG PRESOLVE. Controls amount of output printed by the presolve procedure. Ahigher level implies that more information is logged.

• MSK DPAR QCQO REFORMULATE REL DROP TOL. This parameter determines when columns aredropped in incomplete cholesky factorization doing reformulation of quadratic problems.

License manager parameters.

• MSK IPAR LICENSE ALLOW OVERUSE. Controls if license overuse is allowed when caching li-censes

• MSK IPAR LICENSE DEBUG. Controls the license manager client debugging behavior.

• MSK IPAR LICENSE PAUSE TIME. Controls license manager client behavior.

Page 266: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

248 CHAPTER 23. PARAMETERS

• MSK IPAR LICENSE SUPPRESS EXPIRE WRNS. Controls license manager client behavior.

• MSK IPAR LICENSE WAIT. Controls if MOSEK should queue for a license if none is available.

Logging parameters.

• MSK IPAR LOG. Controls the amount of log information.

• MSK IPAR LOG BI. Controls the amount of output printed by the basis identification proce-dure. A higher level implies that more information is logged.

• MSK IPAR LOG BI FREQ. Controls the logging frequency.

• MSK IPAR LOG CONCURRENT. Controls amount of output printed by the concurrent optimizer.

• MSK IPAR LOG EXPAND. Controls the amount of logging when a data item such as the maxi-mum number constrains is expanded.

• MSK IPAR LOG FACTOR. If turned on, then the factor log lines are added to the log.

• MSK IPAR LOG FEAS REPAIR. Controls the amount of output printed when performing feasi-bility repair. A value higher than one means extensive logging.

• MSK IPAR LOG FILE. If turned on, then some log info is printed when a file is written orread.

• MSK IPAR LOG HEAD. If turned on, then a header line is added to the log.

• MSK IPAR LOG INFEAS ANA. Controls log level for the infeasibility analyzer.

• MSK IPAR LOG INTPNT. Controls the amount of log information from the interior-point op-timizers.

• MSK IPAR LOG MIO. Controls the amount of log information from the mixed-integer optimiz-ers.

• MSK IPAR LOG MIO FREQ. The mixed-integer solver logging frequency.

• MSK IPAR LOG NONCONVEX. Controls amount of output printed by the nonconvex optimizer.

• MSK IPAR LOG OPTIMIZER. Controls the amount of general optimizer information that islogged.

• MSK IPAR LOG ORDER. If turned on, then factor lines are added to the log.

• MSK IPAR LOG PARAM. Controls the amount of information printed out about parameterchanges.

• MSK IPAR LOG PRESOLVE. Controls amount of output printed by the presolve procedure. Ahigher level implies that more information is logged.

• MSK IPAR LOG RESPONSE. Controls amount of output printed when response codes are re-ported. A higher level implies that more information is logged.

• MSK IPAR LOG SIM. Controls the amount of log information from the simplex optimizers.

• MSK IPAR LOG SIM FREQ. Controls simplex logging frequency.

• MSK IPAR LOG SIM NETWORK FREQ. Controls the network simplex logging frequency.

• MSK IPAR LOG STORAGE. Controls the memory related log information.

Mixed-integer optimization parameters.

Page 267: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

249

• MSK IPAR LOG MIO. Controls the amount of log information from the mixed-integer optimiz-ers.

• MSK IPAR LOG MIO FREQ. The mixed-integer solver logging frequency.

• MSK IPAR MIO BRANCH DIR. Controls whether the mixed-integer optimizer is branching upor down by default.

• MSK IPAR MIO CONSTRUCT SOL. Controls if an initial mixed integer solution should be con-structed from the values of the integer variables.

• MSK IPAR MIO CONT SOL. Controls the meaning of interior-point and basic solutions in mixedinteger problems.

• MSK IPAR MIO CUT LEVEL ROOT. Controls the cut level employed by the mixed-integer opti-mizer at the root node.

• MSK IPAR MIO CUT LEVEL TREE. Controls the cut level employed by the mixed-integer opti-mizer in the tree.

• MSK DPAR MIO DISABLE TERM TIME. Certain termination criteria is disabled within the mixed-integer optimizer for period time specified by the parameter.

• MSK IPAR MIO FEASPUMP LEVEL. Controls the feasibility pump heuristic which is used toconstruct a good initial feasible solution.

• MSK IPAR MIO HEURISTIC LEVEL. Controls the heuristic employed by the mixed-integer op-timizer to locate an initial integer feasible solution.

• MSK DPAR MIO HEURISTIC TIME. Time limit for the mixed-integer heuristics.

• MSK IPAR MIO HOTSTART. Controls whether the integer optimizer is hot-started.

• MSK IPAR MIO KEEP BASIS. Controls whether the integer presolve keeps bases in memory.

• MSK IPAR MIO MAX NUM BRANCHES. Maximum number of branches allowed during the branchand bound search.

• MSK IPAR MIO MAX NUM RELAXS. Maximum number of relaxations in branch and bound search.

• MSK IPAR MIO MAX NUM SOLUTIONS. Controls how many feasible solutions the mixed-integeroptimizer investigates.

• MSK DPAR MIO MAX TIME. Time limit for the mixed-integer optimizer.

• MSK DPAR MIO MAX TIME APRX OPT. Time limit for the mixed-integer optimizer.

• MSK DPAR MIO NEAR TOL ABS GAP. Relaxed absolute optimality tolerance employed by themixed-integer optimizer.

• MSK DPAR MIO NEAR TOL REL GAP. The mixed-integer optimizer is terminated when this tol-erance is satisfied.

• MSK IPAR MIO NODE OPTIMIZER. Controls which optimizer is employed at the non-root nodesin the mixed-integer optimizer.

• MSK IPAR MIO NODE SELECTION. Controls the node selection strategy employed by the mixed-integer optimizer.

• MSK IPAR MIO OPTIMIZER MODE. An exprimental feature.

• MSK IPAR MIO PRESOLVE AGGREGATE. Controls whether problem aggregation is performed inthe mixed-integer presolve.

Page 268: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

250 CHAPTER 23. PARAMETERS

• MSK IPAR MIO PRESOLVE PROBING. Controls whether probing is employed by the mixed-integer presolve.

• MSK IPAR MIO PRESOLVE USE. Controls whether presolve is performed by the mixed-integeroptimizer.

• MSK DPAR MIO REL ADD CUT LIMITED. Controls cut generation for mixed-integer optimizer.

• MSK DPAR MIO REL GAP CONST. This value is used to compute the relative gap for the solutionto an integer optimization problem.

• MSK IPAR MIO ROOT OPTIMIZER. Controls which optimizer is employed at the root node inthe mixed-integer optimizer.

• MSK IPAR MIO STRONG BRANCH. The depth from the root in which strong branching is em-ployed.

• MSK DPAR MIO TOL ABS GAP. Absolute optimality tolerance employed by the mixed-integeroptimizer.

• MSK DPAR MIO TOL ABS RELAX INT. Integer constraint tolerance.

• MSK DPAR MIO TOL FEAS. Feasibility tolerance for mixed integer solver. Any solution withmaximum infeasibility below this value will be considered feasible.

• MSK DPAR MIO TOL REL DUAL BOUND IMPROVEMENT. Controls cut generation for mixed-integeroptimizer.

• MSK DPAR MIO TOL REL GAP. Relative optimality tolerance employed by the mixed-integeroptimizer.

• MSK DPAR MIO TOL REL RELAX INT. Integer constraint tolerance.

• MSK DPAR MIO TOL X. Absolute solution tolerance used in mixed-integer optimizer.

• MSK IPAR MIO USE MULTITHREADED OPTIMIZER. Controls wheter the new multithreaded op-timizer should be used for Mixed integer problems.

Network simplex optimizer parameters.

Parameters defining the behavior of the network simplex optimizer for linear problems.

• MSK IPAR LOG SIM NETWORK FREQ. Controls the network simplex logging frequency.

• MSK IPAR SIM REFACTOR FREQ. Controls the basis refactoring frequency.

Non-convex solver parameters.

• MSK IPAR LOG NONCONVEX. Controls amount of output printed by the nonconvex optimizer.

• MSK IPAR NONCONVEX MAX ITERATIONS. Maximum number of iterations that can be used bythe nonconvex optimizer.

• MSK DPAR NONCONVEX TOL FEAS. Feasibility tolerance used by the nonconvex optimizer.

• MSK DPAR NONCONVEX TOL OPT. Optimality tolerance used by the nonconvex optimizer.

Nonlinear convex method parameters.

Parameters defining the behavior of the interior-point method for nonlinear convex problems.

Page 269: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

251

• MSK DPAR INTPNT NL MERIT BAL. Controls if the complementarity and infeasibility is con-verging to zero at about equal rates.

• MSK DPAR INTPNT NL TOL DFEAS. Dual feasibility tolerance used when a nonlinear model issolved.

• MSK DPAR INTPNT NL TOL MU RED. Relative complementarity gap tolerance.

• MSK DPAR INTPNT NL TOL NEAR REL. Nonlinear solver optimality tolerance parameter.

• MSK DPAR INTPNT NL TOL PFEAS. Primal feasibility tolerance used when a nonlinear modelis solved.

• MSK DPAR INTPNT NL TOL REL GAP. Relative gap termination tolerance for nonlinear prob-lems.

• MSK DPAR INTPNT NL TOL REL STEP. Relative step size to the boundary for general nonlinearoptimization problems.

• MSK DPAR INTPNT TOL INFEAS. Nonlinear solver infeasibility tolerance parameter.

• MSK IPAR LOG CHECK CONVEXITY. Controls logging in convexity check on quadratic prob-lems. Set to a positive value to turn logging on.

If a quadratic coefficient matrix is found to violate the requirement of PSD (NSD) then alist of negative (positive) pivot elements is printed. The absolute value of the pivot elementsis also shown.

Optimization system parameters.

Parameters defining the overall solver system environment. This includes system and platformrelated information and behavior.

• MSK IPAR CACHE LICENSE. Control license caching.

• MSK IPAR LICENSE WAIT. Controls if MOSEK should queue for a license if none is available.

• MSK IPAR LOG STORAGE. Controls the memory related log information.

• MSK IPAR NUM THREADS. Controls the number of threads employed by the optimizer. If set to0 the number of threads used will be equal to the number of cores detected on the machine.

Output information parameters.

• MSK IPAR LICENSE SUPPRESS EXPIRE WRNS. Controls license manager client behavior.

• MSK IPAR LOG. Controls the amount of log information.

• MSK IPAR LOG BI. Controls the amount of output printed by the basis identification proce-dure. A higher level implies that more information is logged.

• MSK IPAR LOG BI FREQ. Controls the logging frequency.

• MSK IPAR LOG EXPAND. Controls the amount of logging when a data item such as the maxi-mum number constrains is expanded.

• MSK IPAR LOG FACTOR. If turned on, then the factor log lines are added to the log.

• MSK IPAR LOG FEAS REPAIR. Controls the amount of output printed when performing feasi-bility repair. A value higher than one means extensive logging.

Page 270: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

252 CHAPTER 23. PARAMETERS

• MSK IPAR LOG FILE. If turned on, then some log info is printed when a file is written orread.

• MSK IPAR LOG HEAD. If turned on, then a header line is added to the log.

• MSK IPAR LOG INFEAS ANA. Controls log level for the infeasibility analyzer.

• MSK IPAR LOG INTPNT. Controls the amount of log information from the interior-point op-timizers.

• MSK IPAR LOG MIO. Controls the amount of log information from the mixed-integer optimiz-ers.

• MSK IPAR LOG MIO FREQ. The mixed-integer solver logging frequency.

• MSK IPAR LOG NONCONVEX. Controls amount of output printed by the nonconvex optimizer.

• MSK IPAR LOG OPTIMIZER. Controls the amount of general optimizer information that islogged.

• MSK IPAR LOG ORDER. If turned on, then factor lines are added to the log.

• MSK IPAR LOG PARAM. Controls the amount of information printed out about parameterchanges.

• MSK IPAR LOG RESPONSE. Controls amount of output printed when response codes are re-ported. A higher level implies that more information is logged.

• MSK IPAR LOG SIM. Controls the amount of log information from the simplex optimizers.

• MSK IPAR LOG SIM FREQ. Controls simplex logging frequency.

• MSK IPAR LOG SIM MINOR. Currently not in use.

• MSK IPAR LOG SIM NETWORK FREQ. Controls the network simplex logging frequency.

• MSK IPAR LOG STORAGE. Controls the memory related log information.

• MSK IPAR MAX NUM WARNINGS. Waning level. A higher value results in more warnings.

• MSK IPAR WARNING LEVEL. Warning level.

Overall solver parameters.

• MSK IPAR BI CLEAN OPTIMIZER. Controls which simplex optimizer is used in the clean-upphase.

• MSK IPAR CONCURRENT NUM OPTIMIZERS. The maximum number of simultaneous optimiza-tions that will be started by the concurrent optimizer.

• MSK IPAR CONCURRENT PRIORITY DUAL SIMPLEX. Priority of the dual simplex algorithm whenselecting solvers for concurrent optimization.

• MSK IPAR CONCURRENT PRIORITY FREE SIMPLEX. Priority of the free simplex optimizer whenselecting solvers for concurrent optimization.

• MSK IPAR CONCURRENT PRIORITY INTPNT. Priority of the interior-point algorithm when se-lecting solvers for concurrent optimization.

• MSK IPAR CONCURRENT PRIORITY PRIMAL SIMPLEX. Priority of the primal simplex algorithmwhen selecting solvers for concurrent optimization.

Page 271: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

253

• MSK IPAR INFEAS PREFER PRIMAL. Controls which certificate is used if both primal- anddual- certificate of infeasibility is available.

• MSK IPAR LICENSE WAIT. Controls if MOSEK should queue for a license if none is available.

• MSK IPAR MIO CONT SOL. Controls the meaning of interior-point and basic solutions in mixedinteger problems.

• MSK IPAR MIO LOCAL BRANCH NUMBER. Controls the size of the local search space when doinglocal branching.

• MSK IPAR MIO MODE. Turns on/off the mixed-integer mode.

• MSK IPAR OPTIMIZER. Controls which optimizer is used to optimize the task.

• MSK IPAR PRESOLVE LEVEL. Currently not used.

• MSK IPAR PRESOLVE USE. Controls whether the presolve is applied to a problem before it isoptimized.

• MSK IPAR SOLUTION CALLBACK. Indicates whether solution call-backs will be performed dur-ing the optimization.

Presolve parameters.

• MSK IPAR PRESOLVE ELIM FILL. Maximum amount of fill-in in the elimination phase.

• MSK IPAR PRESOLVE ELIMINATOR MAX NUM TRIES. Control the maximum number of timesthe eliminator is tried.

• MSK IPAR PRESOLVE ELIMINATOR USE. Controls whether free or implied free variables areeliminated from the problem.

• MSK IPAR PRESOLVE LEVEL. Currently not used.

• MSK IPAR PRESOLVE LINDEP ABS WORK TRH. Controls linear dependency check in presolve.

• MSK IPAR PRESOLVE LINDEP REL WORK TRH. Controls linear dependency check in presolve.

• MSK IPAR PRESOLVE LINDEP USE. Controls whether the linear constraints are checked forlinear dependencies.

• MSK DPAR PRESOLVE TOL ABS LINDEP. Absolute tolerance employed by the linear depen-dency checker.

• MSK DPAR PRESOLVE TOL AIJ. Absolute zero tolerance employed for constraint coefficientsin the presolve.

• MSK DPAR PRESOLVE TOL REL LINDEP. Relative tolerance employed by the linear dependencychecker.

• MSK DPAR PRESOLVE TOL S. Absolute zero tolerance employed for slack variables in the pre-solve.

• MSK DPAR PRESOLVE TOL X. Absolute zero tolerance employed for variables in the presolve.

• MSK IPAR PRESOLVE USE. Controls whether the presolve is applied to a problem before it isoptimized.

Primal simplex optimizer parameters.

Parameters defining the behavior of the primal simplex optimizer for linear problems.

Page 272: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

254 CHAPTER 23. PARAMETERS

• MSK IPAR SIM PRIMAL CRASH. Controls the simplex crash.

• MSK IPAR SIM PRIMAL RESTRICT SELECTION. Controls how aggressively restricted selectionis used.

• MSK IPAR SIM PRIMAL SELECTION. Controls the primal simplex strategy.

Progress call-back parameters.

• MSK IPAR SOLUTION CALLBACK. Indicates whether solution call-backs will be performed dur-ing the optimization.

Simplex optimizer parameters.

Parameters defining the behavior of the simplex optimizer for linear problems.

• MSK DPAR BASIS REL TOL S. Maximum relative dual bound violation allowed in an optimalbasic solution.

• MSK DPAR BASIS TOL S. Maximum absolute dual bound violation in an optimal basic solu-tion.

• MSK DPAR BASIS TOL X. Maximum absolute primal bound violation allowed in an optimalbasic solution.

• MSK IPAR LOG SIM. Controls the amount of log information from the simplex optimizers.

• MSK IPAR LOG SIM FREQ. Controls simplex logging frequency.

• MSK IPAR LOG SIM MINOR. Currently not in use.

• MSK IPAR SIM BASIS FACTOR USE. Controls whether a (LU) factorization of the basis is usedin a hot-start. Forcing a refactorization sometimes improves the stability of the simplexoptimizers, but in most cases there is a performance penanlty.

• MSK IPAR SIM DEGEN. Controls how aggressively degeneration is handled.

• MSK IPAR SIM DUAL PHASEONE METHOD. An exprimental feature.

• MSK IPAR SIM EXPLOIT DUPVEC. Controls if the simplex optimizers are allowed to exploitduplicated columns.

• MSK IPAR SIM HOTSTART. Controls the type of hot-start that the simplex optimizer perform.

• MSK IPAR SIM INTEGER. An exprimental feature.

• MSK DPAR SIM LU TOL REL PIV. Relative pivot tolerance employed when computing the LUfactorization of the basis matrix.

• MSK IPAR SIM MAX ITERATIONS. Maximum number of iterations that can be used by a sim-plex optimizer.

• MSK IPAR SIM MAX NUM SETBACKS. Controls how many set-backs that are allowed within asimplex optimizer.

• MSK IPAR SIM NON SINGULAR. Controls if the simplex optimizer ensures a non-singular basis,if possible.

• MSK IPAR SIM PRIMAL PHASEONE METHOD. An exprimental feature.

• MSK IPAR SIM REFORMULATION. Controls if the simplex optimizers are allowed to reformulatethe problem.

Page 273: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

255

• MSK IPAR SIM SAVE LU. Controls if the LU factorization stored should be replaced with theLU factorization corresponding to the initial basis.

• MSK IPAR SIM SCALING. Controls how much effort is used in scaling the problem before asimplex optimizer is used.

• MSK IPAR SIM SCALING METHOD. Controls how the problem is scaled before a simplex opti-mizer is used.

• MSK IPAR SIM SOLVE FORM. Controls whether the primal or the dual problem is solved bythe primal-/dual- simplex optimizer.

• MSK IPAR SIM STABILITY PRIORITY. Controls how high priority the numerical stability shouldbe given.

• MSK IPAR SIM SWITCH OPTIMIZER. Controls the simplex behavior.

• MSK DPAR SIMPLEX ABS TOL PIV. Absolute pivot tolerance employed by the simplex opti-mizers.

Solution input/output parameters.

Parameters defining the behavior of solution reader and writer.

• MSK SPAR BAS SOL FILE NAME. Name of the bas solution file.

• MSK SPAR INT SOL FILE NAME. Name of the int solution file.

• MSK SPAR ITR SOL FILE NAME. Name of the itr solution file.

• MSK IPAR SOL FILTER KEEP BASIC. Controls the license manager client behavior.

• MSK SPAR SOL FILTER XC LOW. Solution file filter.

• MSK SPAR SOL FILTER XC UPR. Solution file filter.

• MSK SPAR SOL FILTER XX LOW. Solution file filter.

• MSK SPAR SOL FILTER XX UPR. Solution file filter.

Termination criterion parameters.

Parameters which define termination and optimality criteria and related information.

• MSK DPAR BASIS REL TOL S. Maximum relative dual bound violation allowed in an optimalbasic solution.

• MSK DPAR BASIS TOL S. Maximum absolute dual bound violation in an optimal basic solu-tion.

• MSK DPAR BASIS TOL X. Maximum absolute primal bound violation allowed in an optimalbasic solution.

• MSK IPAR BI MAX ITERATIONS. Maximum number of iterations after basis identification.

• MSK DPAR INTPNT CO TOL DFEAS. Dual feasibility tolerance used by the conic interior-pointoptimizer.

• MSK DPAR INTPNT CO TOL INFEAS. Infeasibility tolerance for the conic solver.

• MSK DPAR INTPNT CO TOL MU RED. Optimality tolerance for the conic solver.

• MSK DPAR INTPNT CO TOL NEAR REL. Optimality tolerance for the conic solver.

Page 274: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

256 CHAPTER 23. PARAMETERS

• MSK DPAR INTPNT CO TOL PFEAS. Primal feasibility tolerance used by the conic interior-pointoptimizer.

• MSK DPAR INTPNT CO TOL REL GAP. Relative gap termination tolerance used by the conicinterior-point optimizer.

• MSK IPAR INTPNT MAX ITERATIONS. Controls the maximum number of iterations allowed inthe interior-point optimizer.

• MSK DPAR INTPNT NL TOL DFEAS. Dual feasibility tolerance used when a nonlinear model issolved.

• MSK DPAR INTPNT NL TOL MU RED. Relative complementarity gap tolerance.

• MSK DPAR INTPNT NL TOL NEAR REL. Nonlinear solver optimality tolerance parameter.

• MSK DPAR INTPNT NL TOL PFEAS. Primal feasibility tolerance used when a nonlinear modelis solved.

• MSK DPAR INTPNT NL TOL REL GAP. Relative gap termination tolerance for nonlinear prob-lems.

• MSK DPAR INTPNT TOL DFEAS. Dual feasibility tolerance used for linear and quadratic opti-mization problems.

• MSK DPAR INTPNT TOL INFEAS. Nonlinear solver infeasibility tolerance parameter.

• MSK DPAR INTPNT TOL MU RED. Relative complementarity gap tolerance.

• MSK DPAR INTPNT TOL PFEAS. Primal feasibility tolerance used for linear and quadratic op-timization problems.

• MSK DPAR INTPNT TOL REL GAP. Relative gap termination tolerance.

• MSK DPAR LOWER OBJ CUT. Objective bound.

• MSK DPAR LOWER OBJ CUT FINITE TRH. Objective bound.

• MSK DPAR MIO DISABLE TERM TIME. Certain termination criteria is disabled within the mixed-integer optimizer for period time specified by the parameter.

• MSK IPAR MIO MAX NUM BRANCHES. Maximum number of branches allowed during the branchand bound search.

• MSK IPAR MIO MAX NUM SOLUTIONS. Controls how many feasible solutions the mixed-integeroptimizer investigates.

• MSK DPAR MIO MAX TIME. Time limit for the mixed-integer optimizer.

• MSK DPAR MIO NEAR TOL REL GAP. The mixed-integer optimizer is terminated when this tol-erance is satisfied.

• MSK DPAR MIO REL GAP CONST. This value is used to compute the relative gap for the solutionto an integer optimization problem.

• MSK DPAR MIO TOL REL GAP. Relative optimality tolerance employed by the mixed-integeroptimizer.

• MSK DPAR OPTIMIZER MAX TIME. Solver time limit.

• MSK IPAR SIM MAX ITERATIONS. Maximum number of iterations that can be used by a sim-plex optimizer.

Page 275: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

23.1. MSKDPARAME: DOUBLE PARAMETERS 257

• MSK DPAR UPPER OBJ CUT. Objective bound.

• MSK DPAR UPPER OBJ CUT FINITE TRH. Objective bound.

• Integer parameters

• Double parameters

• String parameters

23.1 MSKdparame: Double parameters

23.1.1 MSK DPAR ANA SOL INFEAS TOL

Corresponding constant:

MSK DPAR ANA SOL INFEAS TOL

Description:

If a constraint violates its bound with an amount larger than this value, the constraint name,index and violation will be printed by the solution analyzer.

Possible Values:

Any number between 0.0 and +inf.

Default value:

1e-6

23.1.2 MSK DPAR BASIS REL TOL S

Corresponding constant:

MSK DPAR BASIS REL TOL S

Description:

Maximum relative dual bound violation allowed in an optimal basic solution.

Possible Values:

Any number between 0.0 and +inf.

Default value:

1.0e-12

Page 276: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

258 CHAPTER 23. PARAMETERS

23.1.3 MSK DPAR BASIS TOL S

Corresponding constant:

MSK DPAR BASIS TOL S

Description:

Maximum absolute dual bound violation in an optimal basic solution.

Possible Values:

Any number between 1.0e-9 and +inf.

Default value:

1.0e-6

23.1.4 MSK DPAR BASIS TOL X

Corresponding constant:

MSK DPAR BASIS TOL X

Description:

Maximum absolute primal bound violation allowed in an optimal basic solution.

Possible Values:

Any number between 1.0e-9 and +inf.

Default value:

1.0e-6

23.1.5 MSK DPAR CHECK CONVEXITY REL TOL

Corresponding constant:

MSK DPAR CHECK CONVEXITY REL TOL

Description:

This parameter controls when the full convexity check declares a problem to be non-convex.Increasing this tolerance relaxes the criteria for declaring the problem non-convex.

A problem is declared non-convex if negative (positive) pivot elements are detected in the choleskyfactor of a matrix which is required to be PSD (NSD). This parameter controles how much thisnon-negativity requirement may be violated.

If di is the pivot element for column i, then the matrix Q is considered to not be PSD if:

di ≤ − |Qii| ∗ check convexity rel tol

Page 277: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

23.1. MSKDPARAME: DOUBLE PARAMETERS 259

Possible Values:

Any number between 0 and +inf.

Default value:

1e-10

23.1.6 MSK DPAR DATA TOL AIJ

Corresponding constant:

MSK DPAR DATA TOL AIJ

Description:

Absolute zero tolerance for elements in A. If any value Aij is smaller than this parameter inabsolute terms MOSEK will treat the values as zero and generate a warning.

Possible Values:

Any number between 1.0e-16 and 1.0e-6.

Default value:

1.0e-12

23.1.7 MSK DPAR DATA TOL AIJ HUGE

Corresponding constant:

MSK DPAR DATA TOL AIJ HUGE

Description:

An element in A which is larger than this value in absolute size causes an error.

Possible Values:

Any number between 0.0 and +inf.

Default value:

1.0e20

23.1.8 MSK DPAR DATA TOL AIJ LARGE

Corresponding constant:

MSK DPAR DATA TOL AIJ LARGE

Description:

An element in A which is larger than this value in absolute size causes a warning message to beprinted.

Page 278: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

260 CHAPTER 23. PARAMETERS

Possible Values:

Any number between 0.0 and +inf.

Default value:

1.0e10

23.1.9 MSK DPAR DATA TOL BOUND INF

Corresponding constant:

MSK DPAR DATA TOL BOUND INF

Description:

Any bound which in absolute value is greater than this parameter is considered infinite.

Possible Values:

Any number between 0.0 and +inf.

Default value:

1.0e16

23.1.10 MSK DPAR DATA TOL BOUND WRN

Corresponding constant:

MSK DPAR DATA TOL BOUND WRN

Description:

If a bound value is larger than this value in absolute size, then a warning message is issued.

Possible Values:

Any number between 0.0 and +inf.

Default value:

1.0e8

23.1.11 MSK DPAR DATA TOL C HUGE

Corresponding constant:

MSK DPAR DATA TOL C HUGE

Description:

An element in c which is larger than the value of this parameter in absolute terms is consideredto be huge and generates an error.

Page 279: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

23.1. MSKDPARAME: DOUBLE PARAMETERS 261

Possible Values:

Any number between 0.0 and +inf.

Default value:

1.0e16

23.1.12 MSK DPAR DATA TOL CJ LARGE

Corresponding constant:

MSK DPAR DATA TOL CJ LARGE

Description:

An element in c which is larger than this value in absolute terms causes a warning message tobe printed.

Possible Values:

Any number between 0.0 and +inf.

Default value:

1.0e8

23.1.13 MSK DPAR DATA TOL QIJ

Corresponding constant:

MSK DPAR DATA TOL QIJ

Description:

Absolute zero tolerance for elements in Q matrixes.

Possible Values:

Any number between 0.0 and +inf.

Default value:

1.0e-16

23.1.14 MSK DPAR DATA TOL X

Corresponding constant:

MSK DPAR DATA TOL X

Description:

Zero tolerance for constraints and variables i.e. if the distance between the lower and upperbound is less than this value, then the lower and lower bound is considered identical.

Page 280: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

262 CHAPTER 23. PARAMETERS

Possible Values:

Any number between 0.0 and +inf.

Default value:

1.0e-8

23.1.15 MSK DPAR FEASREPAIR TOL

Corresponding constant:

MSK DPAR FEASREPAIR TOL

Description:

Tolerance for constraint enforcing upper bound on sum of weighted violations in feasibility repair.

Possible Values:

Any number between 1.0e-16 and 1.0e+16.

Default value:

1.0e-10

23.1.16 MSK DPAR INTPNT CO TOL DFEAS

Corresponding constant:

MSK DPAR INTPNT CO TOL DFEAS

Description:

Dual feasibility tolerance used by the conic interior-point optimizer.

Possible Values:

Any number between 0.0 and 1.0.

Default value:

1.0e-8

See also:

• MSK DPAR INTPNT CO TOL NEAR REL Optimality tolerance for the conic solver.

Page 281: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

23.1. MSKDPARAME: DOUBLE PARAMETERS 263

23.1.17 MSK DPAR INTPNT CO TOL INFEAS

Corresponding constant:

MSK DPAR INTPNT CO TOL INFEAS

Description:

Controls when the conic interior-point optimizer declares the model primal or dual infeasible. Asmall number means the optimizer gets more conservative about declaring the model infeasible.

Possible Values:

Any number between 0.0 and 1.0.

Default value:

1.0e-10

23.1.18 MSK DPAR INTPNT CO TOL MU RED

Corresponding constant:

MSK DPAR INTPNT CO TOL MU RED

Description:

Relative complementarity gap tolerance feasibility tolerance used by the conic interior-pointoptimizer.

Possible Values:

Any number between 0.0 and 1.0.

Default value:

1.0e-8

23.1.19 MSK DPAR INTPNT CO TOL NEAR REL

Corresponding constant:

MSK DPAR INTPNT CO TOL NEAR REL

Description:

If MOSEK cannot compute a solution that has the prescribed accuracy, then it will multiply thetermination tolerances with value of this parameter. If the solution then satisfies the terminationcriteria, then the solution is denoted near optimal, near feasible and so forth.

Possible Values:

Any number between 1.0 and +inf.

Default value:

1000

Page 282: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

264 CHAPTER 23. PARAMETERS

23.1.20 MSK DPAR INTPNT CO TOL PFEAS

Corresponding constant:

MSK DPAR INTPNT CO TOL PFEAS

Description:

Primal feasibility tolerance used by the conic interior-point optimizer.

Possible Values:

Any number between 0.0 and 1.0.

Default value:

1.0e-8

See also:

• MSK DPAR INTPNT CO TOL NEAR REL Optimality tolerance for the conic solver.

23.1.21 MSK DPAR INTPNT CO TOL REL GAP

Corresponding constant:

MSK DPAR INTPNT CO TOL REL GAP

Description:

Relative gap termination tolerance used by the conic interior-point optimizer.

Possible Values:

Any number between 0.0 and 1.0.

Default value:

1.0e-7

See also:

• MSK DPAR INTPNT CO TOL NEAR REL Optimality tolerance for the conic solver.

23.1.22 MSK DPAR INTPNT NL MERIT BAL

Corresponding constant:

MSK DPAR INTPNT NL MERIT BAL

Description:

Controls if the complementarity and infeasibility is converging to zero at about equal rates.

Possible Values:

Any number between 0.0 and 0.99.

Page 283: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

23.1. MSKDPARAME: DOUBLE PARAMETERS 265

Default value:

1.0e-4

23.1.23 MSK DPAR INTPNT NL TOL DFEAS

Corresponding constant:

MSK DPAR INTPNT NL TOL DFEAS

Description:

Dual feasibility tolerance used when a nonlinear model is solved.

Possible Values:

Any number between 0.0 and 1.0.

Default value:

1.0e-8

23.1.24 MSK DPAR INTPNT NL TOL MU RED

Corresponding constant:

MSK DPAR INTPNT NL TOL MU RED

Description:

Relative complementarity gap tolerance.

Possible Values:

Any number between 0.0 and 1.0.

Default value:

1.0e-12

23.1.25 MSK DPAR INTPNT NL TOL NEAR REL

Corresponding constant:

MSK DPAR INTPNT NL TOL NEAR REL

Description:

If the MOSEK nonlinear interior-point optimizer cannot compute a solution that has the pre-scribed accuracy, then it will multiply the termination tolerances with value of this parameter.If the solution then satisfies the termination criteria, then the solution is denoted near optimal,near feasible and so forth.

Possible Values:

Any number between 1.0 and +inf.

Page 284: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

266 CHAPTER 23. PARAMETERS

Default value:

1000.0

23.1.26 MSK DPAR INTPNT NL TOL PFEAS

Corresponding constant:

MSK DPAR INTPNT NL TOL PFEAS

Description:

Primal feasibility tolerance used when a nonlinear model is solved.

Possible Values:

Any number between 0.0 and 1.0.

Default value:

1.0e-8

23.1.27 MSK DPAR INTPNT NL TOL REL GAP

Corresponding constant:

MSK DPAR INTPNT NL TOL REL GAP

Description:

Relative gap termination tolerance for nonlinear problems.

Possible Values:

Any number between 1.0e-14 and +inf.

Default value:

1.0e-6

23.1.28 MSK DPAR INTPNT NL TOL REL STEP

Corresponding constant:

MSK DPAR INTPNT NL TOL REL STEP

Description:

Relative step size to the boundary for general nonlinear optimization problems.

Possible Values:

Any number between 1.0e-4 and 0.9999999.

Default value:

0.995

Page 285: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

23.1. MSKDPARAME: DOUBLE PARAMETERS 267

23.1.29 MSK DPAR INTPNT TOL DFEAS

Corresponding constant:

MSK DPAR INTPNT TOL DFEAS

Description:

Dual feasibility tolerance used for linear and quadratic optimization problems.

Possible Values:

Any number between 0.0 and 1.0.

Default value:

1.0e-8

23.1.30 MSK DPAR INTPNT TOL DSAFE

Corresponding constant:

MSK DPAR INTPNT TOL DSAFE

Description:

Controls the initial dual starting point used by the interior-point optimizer. If the interior-pointoptimizer converges slowly.

Possible Values:

Any number between 1.0e-4 and +inf.

Default value:

1.0

23.1.31 MSK DPAR INTPNT TOL INFEAS

Corresponding constant:

MSK DPAR INTPNT TOL INFEAS

Description:

Controls when the optimizer declares the model primal or dual infeasible. A small number meansthe optimizer gets more conservative about declaring the model infeasible.

Possible Values:

Any number between 0.0 and 1.0.

Default value:

1.0e-10

Page 286: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

268 CHAPTER 23. PARAMETERS

23.1.32 MSK DPAR INTPNT TOL MU RED

Corresponding constant:

MSK DPAR INTPNT TOL MU RED

Description:

Relative complementarity gap tolerance.

Possible Values:

Any number between 0.0 and 1.0.

Default value:

1.0e-16

23.1.33 MSK DPAR INTPNT TOL PATH

Corresponding constant:

MSK DPAR INTPNT TOL PATH

Description:

Controls how close the interior-point optimizer follows the central path. A large value of thisparameter means the central is followed very closely. On numerical unstable problems it may beworthwhile to increase this parameter.

Possible Values:

Any number between 0.0 and 0.9999.

Default value:

1.0e-8

23.1.34 MSK DPAR INTPNT TOL PFEAS

Corresponding constant:

MSK DPAR INTPNT TOL PFEAS

Description:

Primal feasibility tolerance used for linear and quadratic optimization problems.

Possible Values:

Any number between 0.0 and 1.0.

Default value:

1.0e-8

Page 287: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

23.1. MSKDPARAME: DOUBLE PARAMETERS 269

23.1.35 MSK DPAR INTPNT TOL PSAFE

Corresponding constant:

MSK DPAR INTPNT TOL PSAFE

Description:

Controls the initial primal starting point used by the interior-point optimizer. If the interior-point optimizer converges slowly and/or the constraint or variable bounds are very large, then itmay be worthwhile to increase this value.

Possible Values:

Any number between 1.0e-4 and +inf.

Default value:

1.0

23.1.36 MSK DPAR INTPNT TOL REL GAP

Corresponding constant:

MSK DPAR INTPNT TOL REL GAP

Description:

Relative gap termination tolerance.

Possible Values:

Any number between 1.0e-14 and +inf.

Default value:

1.0e-8

23.1.37 MSK DPAR INTPNT TOL REL STEP

Corresponding constant:

MSK DPAR INTPNT TOL REL STEP

Description:

Relative step size to the boundary for linear and quadratic optimization problems.

Possible Values:

Any number between 1.0e-4 and 0.999999.

Default value:

0.9999

Page 288: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

270 CHAPTER 23. PARAMETERS

23.1.38 MSK DPAR INTPNT TOL STEP SIZE

Corresponding constant:

MSK DPAR INTPNT TOL STEP SIZE

Description:

If the step size falls below the value of this parameter, then the interior-point optimizer assumesthat it is stalled. In other words the interior-point optimizer does not make any progress andtherefore it is better stop.

Possible Values:

Any number between 0.0 and 1.0.

Default value:

1.0e-6

23.1.39 MSK DPAR LOWER OBJ CUT

Corresponding constant:

MSK DPAR LOWER OBJ CUT

Description:

If either a primal or dual feasible solution is found proving that the optimal objective valueis outside, the interval [MSK DPAR LOWER OBJ CUT, MSK DPAR UPPER OBJ CUT], then MOSEK isterminated.

Possible Values:

Any number between -inf and +inf.

Default value:

-1.0e30

See also:

• MSK DPAR LOWER OBJ CUT FINITE TRH Objective bound.

23.1.40 MSK DPAR LOWER OBJ CUT FINITE TRH

Corresponding constant:

MSK DPAR LOWER OBJ CUT FINITE TRH

Description:

If the lower objective cut is less than the value of this parameter value, then the lower objectivecut i.e. MSK DPAR LOWER OBJ CUT is treated as −∞.

Page 289: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

23.1. MSKDPARAME: DOUBLE PARAMETERS 271

Possible Values:

Any number between -inf and +inf.

Default value:

-0.5e30

23.1.41 MSK DPAR MIO DISABLE TERM TIME

Corresponding constant:

MSK DPAR MIO DISABLE TERM TIME

Description:

The termination criteria governed by

• MSK IPAR MIO MAX NUM RELAXS

• MSK IPAR MIO MAX NUM BRANCHES

• MSK DPAR MIO NEAR TOL ABS GAP

• MSK DPAR MIO NEAR TOL REL GAP

is disabled the first n seconds. This parameter specifies the number n. A negative value isidentical to infinity i.e. the termination criteria are never checked.

Possible Values:

Any number between -inf and +inf.

Default value:

-1.0

See also:

• MSK IPAR MIO MAX NUM RELAXS Maximum number of relaxations in branch and bound search.

• MSK IPAR MIO MAX NUM BRANCHES Maximum number of branches allowed during the branchand bound search.

• MSK DPAR MIO NEAR TOL ABS GAP Relaxed absolute optimality tolerance employed by themixed-integer optimizer.

• MSK DPAR MIO NEAR TOL REL GAP The mixed-integer optimizer is terminated when this tol-erance is satisfied.

23.1.42 MSK DPAR MIO HEURISTIC TIME

Corresponding constant:

MSK DPAR MIO HEURISTIC TIME

Page 290: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

272 CHAPTER 23. PARAMETERS

Description:

Minimum amount of time to be used in the heuristic search for a good feasible integer solution. Anegative values implies that the optimizer decides the amount of time to be spent in the heuristic.

Possible Values:

Any number between -inf and +inf.

Default value:

-1.0

23.1.43 MSK DPAR MIO MAX TIME

Corresponding constant:

MSK DPAR MIO MAX TIME

Description:

This parameter limits the maximum time spent by the mixed-integer optimizer. A negativenumber means infinity.

Possible Values:

Any number between -inf and +inf.

Default value:

-1.0

23.1.44 MSK DPAR MIO MAX TIME APRX OPT

Corresponding constant:

MSK DPAR MIO MAX TIME APRX OPT

Description:

Number of seconds spent by the mixed-integer optimizer before the MSK DPAR MIO TOL REL RELAX INT

is applied.

Possible Values:

Any number between 0.0 and +inf.

Default value:

60

Page 291: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

23.1. MSKDPARAME: DOUBLE PARAMETERS 273

23.1.45 MSK DPAR MIO NEAR TOL ABS GAP

Corresponding constant:

MSK DPAR MIO NEAR TOL ABS GAP

Description:

Relaxed absolute optimality tolerance employed by the mixed-integer optimizer. This termina-tion criteria is delayed. See MSK DPAR MIO DISABLE TERM TIME for details.

Possible Values:

Any number between 0.0 and +inf.

Default value:

0.0

See also:

• MSK DPAR MIO DISABLE TERM TIME Certain termination criteria is disabled within the mixed-integer optimizer for period time specified by the parameter.

23.1.46 MSK DPAR MIO NEAR TOL REL GAP

Corresponding constant:

MSK DPAR MIO NEAR TOL REL GAP

Description:

The mixed-integer optimizer is terminated when this tolerance is satisfied. This terminationcriteria is delayed. See MSK DPAR MIO DISABLE TERM TIME for details.

Possible Values:

Any number between 0.0 and +inf.

Default value:

1.0e-3

See also:

• MSK DPAR MIO DISABLE TERM TIME Certain termination criteria is disabled within the mixed-integer optimizer for period time specified by the parameter.

Page 292: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

274 CHAPTER 23. PARAMETERS

23.1.47 MSK DPAR MIO REL ADD CUT LIMITED

Corresponding constant:

MSK DPAR MIO REL ADD CUT LIMITED

Description:

Controls how many cuts the mixed-integer optimizer is allowed to add to the problem. Let αbe the value of this parameter and m the number constraints, then mixed-integer optimizer isallowed to αm cuts.

Possible Values:

Any number between 0.0 and 2.0.

Default value:

0.75

23.1.48 MSK DPAR MIO REL GAP CONST

Corresponding constant:

MSK DPAR MIO REL GAP CONST

Description:

This value is used to compute the relative gap for the solution to an integer optimization problem.

Possible Values:

Any number between 1.0e-15 and +inf.

Default value:

1.0e-10

23.1.49 MSK DPAR MIO TOL ABS GAP

Corresponding constant:

MSK DPAR MIO TOL ABS GAP

Description:

Absolute optimality tolerance employed by the mixed-integer optimizer.

Possible Values:

Any number between 0.0 and +inf.

Default value:

0.0

Page 293: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

23.1. MSKDPARAME: DOUBLE PARAMETERS 275

23.1.50 MSK DPAR MIO TOL ABS RELAX INT

Corresponding constant:

MSK DPAR MIO TOL ABS RELAX INT

Description:

Absolute relaxation tolerance of the integer constraints. I.e. min(|x| − bxc, dxe− |x|) is less thanthe tolerance then the integer restrictions assumed to be satisfied.

Possible Values:

Any number between 1e-9 and +inf.

Default value:

1.0e-5

23.1.51 MSK DPAR MIO TOL FEAS

Corresponding constant:

MSK DPAR MIO TOL FEAS

Description:

Feasibility tolerance for mixed integer solver. Any solution with maximum infeasibility belowthis value will be considered feasible.

Possible Values:

Any number between 0.0 and +inf.

Default value:

1.0e-7

23.1.52 MSK DPAR MIO TOL REL DUAL BOUND IMPROVEMENT

Corresponding constant:

MSK DPAR MIO TOL REL DUAL BOUND IMPROVEMENT

Description:

If the relative improvement of the dual bound is smaller than this value, the solver will terminatethe root cut generation. A value of 0.0 means that the value is selected automatically.

Possible Values:

Any number between 0.0 and 1.0.

Default value:

0.0

Page 294: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

276 CHAPTER 23. PARAMETERS

23.1.53 MSK DPAR MIO TOL REL GAP

Corresponding constant:

MSK DPAR MIO TOL REL GAP

Description:

Relative optimality tolerance employed by the mixed-integer optimizer.

Possible Values:

Any number between 0.0 and +inf.

Default value:

1.0e-4

23.1.54 MSK DPAR MIO TOL REL RELAX INT

Corresponding constant:

MSK DPAR MIO TOL REL RELAX INT

Description:

Relative relaxation tolerance of the integer constraints. I.e (min(|x|− bxc, dxe− |x|)) is less thanthe tolerance times |x| then the integer restrictions assumed to be satisfied.

Possible Values:

Any number between 0.0 and +inf.

Default value:

1.0e-6

23.1.55 MSK DPAR MIO TOL X

Corresponding constant:

MSK DPAR MIO TOL X

Description:

Absolute solution tolerance used in mixed-integer optimizer.

Possible Values:

Any number between 0.0 and +inf.

Default value:

1.0e-6

Page 295: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

23.1. MSKDPARAME: DOUBLE PARAMETERS 277

23.1.56 MSK DPAR NONCONVEX TOL FEAS

Corresponding constant:

MSK DPAR NONCONVEX TOL FEAS

Description:

Feasibility tolerance used by the nonconvex optimizer.

Possible Values:

Any number between 0.0 and +inf.

Default value:

1.0e-6

23.1.57 MSK DPAR NONCONVEX TOL OPT

Corresponding constant:

MSK DPAR NONCONVEX TOL OPT

Description:

Optimality tolerance used by the nonconvex optimizer.

Possible Values:

Any number between 0.0 and +inf.

Default value:

1.0e-7

23.1.58 MSK DPAR OPTIMIZER MAX TIME

Corresponding constant:

MSK DPAR OPTIMIZER MAX TIME

Description:

Maximum amount of time the optimizer is allowed to spent on the optimization. A negativenumber means infinity.

Possible Values:

Any number between -inf and +inf.

Default value:

-1.0

Page 296: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

278 CHAPTER 23. PARAMETERS

23.1.59 MSK DPAR PRESOLVE TOL ABS LINDEP

Corresponding constant:

MSK DPAR PRESOLVE TOL ABS LINDEP

Description:

Absolute tolerance employed by the linear dependency checker.

Possible Values:

Any number between 0.0 and +inf.

Default value:

1.0e-6

23.1.60 MSK DPAR PRESOLVE TOL AIJ

Corresponding constant:

MSK DPAR PRESOLVE TOL AIJ

Description:

Absolute zero tolerance employed for aij in the presolve.

Possible Values:

Any number between 1.0e-15 and +inf.

Default value:

1.0e-12

23.1.61 MSK DPAR PRESOLVE TOL REL LINDEP

Corresponding constant:

MSK DPAR PRESOLVE TOL REL LINDEP

Description:

Relative tolerance employed by the linear dependency checker.

Possible Values:

Any number between 0.0 and +inf.

Default value:

1.0e-10

Page 297: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

23.1. MSKDPARAME: DOUBLE PARAMETERS 279

23.1.62 MSK DPAR PRESOLVE TOL S

Corresponding constant:

MSK DPAR PRESOLVE TOL S

Description:

Absolute zero tolerance employed for si in the presolve.

Possible Values:

Any number between 0.0 and +inf.

Default value:

1.0e-8

23.1.63 MSK DPAR PRESOLVE TOL X

Corresponding constant:

MSK DPAR PRESOLVE TOL X

Description:

Absolute zero tolerance employed for xj in the presolve.

Possible Values:

Any number between 0.0 and +inf.

Default value:

1.0e-8

23.1.64 MSK DPAR QCQO REFORMULATE REL DROP TOL

Corresponding constant:

MSK DPAR QCQO REFORMULATE REL DROP TOL

Description:

This parameter determines when columns are dropped in incomplete cholesky factorization doingreformulation of quadratic problems.

Possible Values:

Any number between 0 and +inf.

Default value:

1e-15

Page 298: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

280 CHAPTER 23. PARAMETERS

23.1.65 MSK DPAR SIM LU TOL REL PIV

Corresponding constant:

MSK DPAR SIM LU TOL REL PIV

Description:

Relative pivot tolerance employed when computing the LU factorization of the basis in thesimplex optimizers and in the basis identification procedure.

A value closer to 1.0 generally improves numerical stability but typically also implies an increasein the computational work.

Possible Values:

Any number between 1.0e-6 and 0.999999.

Default value:

0.01

23.1.66 MSK DPAR SIMPLEX ABS TOL PIV

Corresponding constant:

MSK DPAR SIMPLEX ABS TOL PIV

Description:

Absolute pivot tolerance employed by the simplex optimizers.

Possible Values:

Any number between 1.0e-12 and +inf.

Default value:

1.0e-7

23.1.67 MSK DPAR UPPER OBJ CUT

Corresponding constant:

MSK DPAR UPPER OBJ CUT

Description:

If either a primal or dual feasible solution is found proving that the optimal objective value isoutside, [MSK DPAR LOWER OBJ CUT, MSK DPAR UPPER OBJ CUT], then MOSEK is terminated.

Possible Values:

Any number between -inf and +inf.

Page 299: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

23.2. MSKIPARAME: INTEGER PARAMETERS 281

Default value:

1.0e30

See also:

• MSK DPAR UPPER OBJ CUT FINITE TRH Objective bound.

23.1.68 MSK DPAR UPPER OBJ CUT FINITE TRH

Corresponding constant:

MSK DPAR UPPER OBJ CUT FINITE TRH

Description:

If the upper objective cut is greater than the value of this value parameter, then the the upperobjective cut MSK DPAR UPPER OBJ CUT is treated as ∞.

Possible Values:

Any number between -inf and +inf.

Default value:

0.5e30

23.2 MSKiparame: Integer parameters

23.2.1 MSK IPAR ALLOC ADD QNZ

Corresponding constant:

MSK IPAR ALLOC ADD QNZ

Description:

Additional number of Q non-zeros that are allocated space for when numanz exceeds maxnumqnzduring addition of new Q entries.

Possible Values:

Any number between 0 and +inf.

Default value:

5000

Page 300: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

282 CHAPTER 23. PARAMETERS

23.2.2 MSK IPAR ANA SOL BASIS

Corresponding constant:

MSK IPAR ANA SOL BASIS

Description:

Controls whether the basis matrix is analyzed in solaution analyzer.

Possible values:

• MSK OFF Switch the option off.

• MSK ON Switch the option on.

Default value:

MSK ON

23.2.3 MSK IPAR ANA SOL PRINT VIOLATED

Corresponding constant:

MSK IPAR ANA SOL PRINT VIOLATED

Description:

Controls whether a list of violated constraints is printed.

Possible values:

• MSK OFF Switch the option off.

• MSK ON Switch the option on.

Default value:

MSK OFF

23.2.4 MSK IPAR AUTO SORT A BEFORE OPT

Corresponding constant:

MSK IPAR AUTO SORT A BEFORE OPT

Description:

Controls whether the elements in each column of A are sorted before an optimization is performed.This is not required but makes the optimization more deterministic.

Possible values:

• MSK OFF Switch the option off.

• MSK ON Switch the option on.

Default value:

MSK OFF

Page 301: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

23.2. MSKIPARAME: INTEGER PARAMETERS 283

23.2.5 MSK IPAR AUTO UPDATE SOL INFO

Corresponding constant:

MSK IPAR AUTO UPDATE SOL INFO

Description:

Controls whether the solution information items are automatically updated after an optimizationis performed.

Possible values:

• MSK OFF Switch the option off.

• MSK ON Switch the option on.

Default value:

MSK OFF

23.2.6 MSK IPAR BASIS SOLVE USE PLUS ONE

Corresponding constant:

MSK IPAR BASIS SOLVE USE PLUS ONE

Description:

If a slack variable is in the basis, then the corresponding column in the basis is a unit vectorwith -1 in the right position. However, if this parameter is set to MSK ON, -1 is replaced by 1.

Possible values:

• MSK OFF Switch the option off.

• MSK ON Switch the option on.

Default value:

MSK OFF

23.2.7 MSK IPAR BI CLEAN OPTIMIZER

Corresponding constant:

MSK IPAR BI CLEAN OPTIMIZER

Description:

Controls which simplex optimizer is used in the clean-up phase.

Possible values:

• MSK OPTIMIZER CONCURRENT The optimizer for nonconvex nonlinear problems.

Page 302: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

284 CHAPTER 23. PARAMETERS

• MSK OPTIMIZER CONIC The optimizer for problems having conic constraints.

• MSK OPTIMIZER DUAL SIMPLEX The dual simplex optimizer is used.

• MSK OPTIMIZER FREE The optimizer is chosen automatically.

• MSK OPTIMIZER FREE SIMPLEX One of the simplex optimizers is used.

• MSK OPTIMIZER INTPNT The interior-point optimizer is used.

• MSK OPTIMIZER MIXED INT The mixed-integer optimizer.

• MSK OPTIMIZER MIXED INT CONIC The mixed-integer optimizer for conic and linear prob-lems.

• MSK OPTIMIZER NETWORK PRIMAL SIMPLEX The network primal simplex optimizer is used.It is only applicable to pute network problems.

• MSK OPTIMIZER NONCONVEX The optimizer for nonconvex nonlinear problems.

• MSK OPTIMIZER PRIMAL DUAL SIMPLEX The primal dual simplex optimizer is used.

• MSK OPTIMIZER PRIMAL SIMPLEX The primal simplex optimizer is used.

Default value:

MSK OPTIMIZER FREE

23.2.8 MSK IPAR BI IGNORE MAX ITER

Corresponding constant:

MSK IPAR BI IGNORE MAX ITER

Description:

If the parameter MSK IPAR INTPNT BASIS has the value MSK BI NO ERROR and the interior-pointoptimizer has terminated due to maximum number of iterations, then basis identification isperformed if this parameter has the value MSK ON.

Possible values:

• MSK OFF Switch the option off.

• MSK ON Switch the option on.

Default value:

MSK OFF

23.2.9 MSK IPAR BI IGNORE NUM ERROR

Corresponding constant:

MSK IPAR BI IGNORE NUM ERROR

Page 303: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

23.2. MSKIPARAME: INTEGER PARAMETERS 285

Description:

If the parameter MSK IPAR INTPNT BASIS has the value MSK BI NO ERROR and the interior-pointoptimizer has terminated due to a numerical problem, then basis identification is performed ifthis parameter has the value MSK ON.

Possible values:

• MSK OFF Switch the option off.

• MSK ON Switch the option on.

Default value:

MSK OFF

23.2.10 MSK IPAR BI MAX ITERATIONS

Corresponding constant:

MSK IPAR BI MAX ITERATIONS

Description:

Controls the maximum number of simplex iterations allowed to optimize a basis after the basisidentification.

Possible Values:

Any number between 0 and +inf.

Default value:

1000000

23.2.11 MSK IPAR CACHE LICENSE

Corresponding constant:

MSK IPAR CACHE LICENSE

Description:

Specifies if the license is kept checked out for the lifetime of the mosek environment (on) orreturned to the server immediately after the optimization (off).

Check-in and check-out of licenses have an overhead. Frequent communication with the licenseserver should be avoided.

Possible values:

• MSK OFF Switch the option off.

• MSK ON Switch the option on.

Default value:

MSK ON

Page 304: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

286 CHAPTER 23. PARAMETERS

23.2.12 MSK IPAR CHECK CONVEXITY

Corresponding constant:

MSK IPAR CHECK CONVEXITY

Description:

Specify the level of convexity check on quadratic problems

Possible values:

• MSK CHECK CONVEXITY FULL Perform a full convexity check.

• MSK CHECK CONVEXITY NONE No convexity check.

• MSK CHECK CONVEXITY SIMPLE Perform simple and fast convexity check.

Default value:

MSK CHECK CONVEXITY FULL

23.2.13 MSK IPAR COMPRESS STATFILE

Corresponding constant:

MSK IPAR COMPRESS STATFILE

Description:

Control compression of stat files.

Possible values:

• MSK OFF Switch the option off.

• MSK ON Switch the option on.

Default value:

MSK ON

23.2.14 MSK IPAR CONCURRENT NUM OPTIMIZERS

Corresponding constant:

MSK IPAR CONCURRENT NUM OPTIMIZERS

Description:

The maximum number of simultaneous optimizations that will be started by the concurrentoptimizer.

Possible Values:

Any number between 0 and +inf.

Default value:

2

Page 305: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

23.2. MSKIPARAME: INTEGER PARAMETERS 287

23.2.15 MSK IPAR CONCURRENT PRIORITY DUAL SIMPLEX

Corresponding constant:

MSK IPAR CONCURRENT PRIORITY DUAL SIMPLEX

Description:

Priority of the dual simplex algorithm when selecting solvers for concurrent optimization.

Possible Values:

Any number between 0 and +inf.

Default value:

2

23.2.16 MSK IPAR CONCURRENT PRIORITY FREE SIMPLEX

Corresponding constant:

MSK IPAR CONCURRENT PRIORITY FREE SIMPLEX

Description:

Priority of the free simplex optimizer when selecting solvers for concurrent optimization.

Possible Values:

Any number between 0 and +inf.

Default value:

3

23.2.17 MSK IPAR CONCURRENT PRIORITY INTPNT

Corresponding constant:

MSK IPAR CONCURRENT PRIORITY INTPNT

Description:

Priority of the interior-point algorithm when selecting solvers for concurrent optimization.

Possible Values:

Any number between 0 and +inf.

Default value:

4

Page 306: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

288 CHAPTER 23. PARAMETERS

23.2.18 MSK IPAR CONCURRENT PRIORITY PRIMAL SIMPLEX

Corresponding constant:

MSK IPAR CONCURRENT PRIORITY PRIMAL SIMPLEX

Description:

Priority of the primal simplex algorithm when selecting solvers for concurrent optimization.

Possible Values:

Any number between 0 and +inf.

Default value:

1

23.2.19 MSK IPAR FEASREPAIR OPTIMIZE

Corresponding constant:

MSK IPAR FEASREPAIR OPTIMIZE

Description:

Controls which type of feasibility analysis is to be performed.

Possible values:

• MSK FEASREPAIR OPTIMIZE COMBINED Minimize with original objective subject to minimalweighted violation of bounds.

• MSK FEASREPAIR OPTIMIZE NONE Do not optimize the feasibility repair problem.

• MSK FEASREPAIR OPTIMIZE PENALTY Minimize weighted sum of violations.

Default value:

MSK FEASREPAIR OPTIMIZE NONE

23.2.20 MSK IPAR INFEAS GENERIC NAMES

Corresponding constant:

MSK IPAR INFEAS GENERIC NAMES

Description:

Controls whether generic names are used when an infeasible subproblem is created.

Possible values:

• MSK OFF Switch the option off.

• MSK ON Switch the option on.

Default value:

MSK OFF

Page 307: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

23.2. MSKIPARAME: INTEGER PARAMETERS 289

23.2.21 MSK IPAR INFEAS PREFER PRIMAL

Corresponding constant:

MSK IPAR INFEAS PREFER PRIMAL

Description:

If both certificates of primal and dual infeasibility are supplied then only the primal is used whenthis option is turned on.

Possible values:

• MSK OFF Switch the option off.

• MSK ON Switch the option on.

Default value:

MSK ON

23.2.22 MSK IPAR INFEAS REPORT AUTO

Corresponding constant:

MSK IPAR INFEAS REPORT AUTO

Description:

Controls whether an infeasibility report is automatically produced after the optimization if theproblem is primal or dual infeasible.

Possible values:

• MSK OFF Switch the option off.

• MSK ON Switch the option on.

Default value:

MSK OFF

23.2.23 MSK IPAR INFEAS REPORT LEVEL

Corresponding constant:

MSK IPAR INFEAS REPORT LEVEL

Description:

Controls the amount of information presented in an infeasibility report. Higher values implymore information.

Possible Values:

Any number between 0 and +inf.

Page 308: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

290 CHAPTER 23. PARAMETERS

Default value:

1

23.2.24 MSK IPAR INTPNT BASIS

Corresponding constant:

MSK IPAR INTPNT BASIS

Description:

Controls whether the interior-point optimizer also computes an optimal basis.

Possible values:

• MSK BI ALWAYS Basis identification is always performed even if the interior-point optimizerterminates abnormally.

• MSK BI IF FEASIBLE Basis identification is not performed if the interior-point optimizerterminates with a problem status saying that the problem is primal or dual infeasible.

• MSK BI NEVER Never do basis identification.

• MSK BI NO ERROR Basis identification is performed if the interior-point optimizer terminateswithout an error.

• MSK BI RESERVERED Not currently in use.

Default value:

MSK BI ALWAYS

See also:

• MSK IPAR BI IGNORE MAX ITER Turns on basis identification in case the interior-point opti-mizer is terminated due to maximum number of iterations.

• MSK IPAR BI IGNORE NUM ERROR Turns on basis identification in case the interior-point op-timizer is terminated due to a numerical problem.

23.2.25 MSK IPAR INTPNT DIFF STEP

Corresponding constant:

MSK IPAR INTPNT DIFF STEP

Description:

Controls whether different step sizes are allowed in the primal and dual space.

Possible values:

• MSK OFF Switch the option off.

• MSK ON Switch the option on.

Default value:

MSK ON

Page 309: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

23.2. MSKIPARAME: INTEGER PARAMETERS 291

23.2.26 MSK IPAR INTPNT FACTOR DEBUG LVL

Corresponding constant:

MSK IPAR INTPNT FACTOR DEBUG LVL

Description:

Controls factorization debug level.

Possible Values:

Any number between 0 and +inf.

Default value:

0

23.2.27 MSK IPAR INTPNT FACTOR METHOD

Corresponding constant:

MSK IPAR INTPNT FACTOR METHOD

Description:

Controls the method used to factor the Newton equation system.

Possible Values:

Any number between 0 and +inf.

Default value:

0

23.2.28 MSK IPAR INTPNT HOTSTART

Corresponding constant:

MSK IPAR INTPNT HOTSTART

Description:

Currently not in use.

Possible values:

• MSK INTPNT HOTSTART DUAL The interior-point optimizer exploits the dual solution only.

• MSK INTPNT HOTSTART NONE The interior-point optimizer performs a coldstart.

• MSK INTPNT HOTSTART PRIMAL The interior-point optimizer exploits the primal solutiononly.

• MSK INTPNT HOTSTART PRIMAL DUAL The interior-point optimizer exploits both the primaland dual solution.

Page 310: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

292 CHAPTER 23. PARAMETERS

Default value:

MSK INTPNT HOTSTART NONE

23.2.29 MSK IPAR INTPNT MAX ITERATIONS

Corresponding constant:

MSK IPAR INTPNT MAX ITERATIONS

Description:

Controls the maximum number of iterations allowed in the interior-point optimizer.

Possible Values:

Any number between 0 and +inf.

Default value:

400

23.2.30 MSK IPAR INTPNT MAX NUM COR

Corresponding constant:

MSK IPAR INTPNT MAX NUM COR

Description:

Controls the maximum number of correctors allowed by the multiple corrector procedure. Anegative value means that MOSEK is making the choice.

Possible Values:

Any number between -1 and +inf.

Default value:

-1

23.2.31 MSK IPAR INTPNT MAX NUM REFINEMENT STEPS

Corresponding constant:

MSK IPAR INTPNT MAX NUM REFINEMENT STEPS

Description:

Maximum number of steps to be used by the iterative refinement of the search direction. Anegative value implies that the optimizer Chooses the maximum number of iterative refinementsteps.

Possible Values:

Any number between -inf and +inf.

Page 311: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

23.2. MSKIPARAME: INTEGER PARAMETERS 293

Default value:

-1

23.2.32 MSK IPAR INTPNT OFF COL TRH

Corresponding constant:

MSK IPAR INTPNT OFF COL TRH

Description:

Controls how many offending columns are detected in the Jacobian of the constraint matrix.

1 means aggressive detection, higher values mean less aggressive detection.

0 means no detection.

Possible Values:

Any number between 0 and +inf.

Default value:

40

23.2.33 MSK IPAR INTPNT ORDER METHOD

Corresponding constant:

MSK IPAR INTPNT ORDER METHOD

Description:

Controls the ordering strategy used by the interior-point optimizer when factorizing the Newtonequation system.

Possible values:

• MSK ORDER METHOD APPMINLOC Approximate minimum local fill-in ordering is employed.

• MSK ORDER METHOD EXPERIMENTAL This option should not be used.

• MSK ORDER METHOD FORCE GRAPHPAR Always use the graph partitioning based ordering evenif it is worse that the approximate minimum local fill ordering.

• MSK ORDER METHOD FREE The ordering method is chosen automatically.

• MSK ORDER METHOD NONE No ordering is used.

• MSK ORDER METHOD TRY GRAPHPAR Always try the the graph partitioning based ordering.

Default value:

MSK ORDER METHOD FREE

Page 312: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

294 CHAPTER 23. PARAMETERS

23.2.34 MSK IPAR INTPNT REGULARIZATION USE

Corresponding constant:

MSK IPAR INTPNT REGULARIZATION USE

Description:

Controls whether regularization is allowed.

Possible values:

• MSK OFF Switch the option off.

• MSK ON Switch the option on.

Default value:

MSK ON

23.2.35 MSK IPAR INTPNT SCALING

Corresponding constant:

MSK IPAR INTPNT SCALING

Description:

Controls how the problem is scaled before the interior-point optimizer is used.

Possible values:

• MSK SCALING AGGRESSIVE A very aggressive scaling is performed.

• MSK SCALING FREE The optimizer chooses the scaling heuristic.

• MSK SCALING MODERATE A conservative scaling is performed.

• MSK SCALING NONE No scaling is performed.

Default value:

MSK SCALING FREE

23.2.36 MSK IPAR INTPNT SOLVE FORM

Corresponding constant:

MSK IPAR INTPNT SOLVE FORM

Description:

Controls whether the primal or the dual problem is solved.

Possible values:

Page 313: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

23.2. MSKIPARAME: INTEGER PARAMETERS 295

• MSK SOLVE DUAL The optimizer should solve the dual problem.

• MSK SOLVE FREE The optimizer is free to solve either the primal or the dual problem.

• MSK SOLVE PRIMAL The optimizer should solve the primal problem.

Default value:

MSK SOLVE FREE

23.2.37 MSK IPAR INTPNT STARTING POINT

Corresponding constant:

MSK IPAR INTPNT STARTING POINT

Description:

Starting point used by the interior-point optimizer.

Possible values:

• MSK STARTING POINT CONSTANT The optimizer constructs a starting point by assigning aconstant value to all primal and dual variables. This starting point is normally robust.

• MSK STARTING POINT FREE The starting point is chosen automatically.

• MSK STARTING POINT GUESS The optimizer guesses a starting point.

• MSK STARTING POINT SATISFY BOUNDS The starting point is choosen to satisfy all the simplebounds on nonlinear variables. If this starting point is employed, then more care than usualshould employed when choosing the bounds on the nonlinear variables. In particular verytight bounds should be avoided.

Default value:

MSK STARTING POINT FREE

23.2.38 MSK IPAR LIC TRH EXPIRY WRN

Corresponding constant:

MSK IPAR LIC TRH EXPIRY WRN

Description:

If a license feature expires in a numbers days less than the value of this parameter then a warningwill be issued.

Possible Values:

Any number between 0 and +inf.

Default value:

7

Page 314: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

296 CHAPTER 23. PARAMETERS

23.2.39 MSK IPAR LICENSE ALLOW OVERUSE

Corresponding constant:

MSK IPAR LICENSE ALLOW OVERUSE

Description:

Controls if license overuse is allowed when caching licenses

Possible values:

• MSK OFF Switch the option off.

• MSK ON Switch the option on.

Default value:

MSK ON

23.2.40 MSK IPAR LICENSE DEBUG

Corresponding constant:

MSK IPAR LICENSE DEBUG

Description:

This option is used to turn on debugging of the incense manager.

Possible values:

• MSK OFF Switch the option off.

• MSK ON Switch the option on.

Default value:

MSK OFF

23.2.41 MSK IPAR LICENSE PAUSE TIME

Corresponding constant:

MSK IPAR LICENSE PAUSE TIME

Description:

If MSK IPAR LICENSE WAIT=MSK ON and no license is available, then MOSEK sleeps a number ofmilliseconds between each check of whether a license has become free.

Possible Values:

Any number between 0 and 1000000.

Default value:

100

Page 315: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

23.2. MSKIPARAME: INTEGER PARAMETERS 297

23.2.42 MSK IPAR LICENSE SUPPRESS EXPIRE WRNS

Corresponding constant:

MSK IPAR LICENSE SUPPRESS EXPIRE WRNS

Description:

Controls whether license features expire warnings are suppressed.

Possible values:

• MSK OFF Switch the option off.

• MSK ON Switch the option on.

Default value:

MSK OFF

23.2.43 MSK IPAR LICENSE WAIT

Corresponding constant:

MSK IPAR LICENSE WAIT

Description:

If all licenses are in use MOSEK returns with an error code. However, by turning on thisparameter MOSEK will wait for an available license.

Possible values:

• MSK OFF Switch the option off.

• MSK ON Switch the option on.

Default value:

MSK OFF

23.2.44 MSK IPAR LOG

Corresponding constant:

MSK IPAR LOG

Description:

Controls the amount of log information. The value 0 implies that all log information is suppressed.A higher level implies that more information is logged.

Please note that if a task is employed to solve a sequence of optimization problems the value ofthis parameter is reduced by the value of MSK IPAR LOG CUT SECOND OPT for the second and anysubsequent optimizations.

Page 316: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

298 CHAPTER 23. PARAMETERS

Possible Values:

Any number between 0 and +inf.

Default value:

10

See also:

• MSK IPAR LOG CUT SECOND OPT Controls the reduction in the log levels for the second andany subsequent optimizations.

23.2.45 MSK IPAR LOG BI

Corresponding constant:

MSK IPAR LOG BI

Description:

Controls the amount of output printed by the basis identification procedure. A higher levelimplies that more information is logged.

Possible Values:

Any number between 0 and +inf.

Default value:

4

23.2.46 MSK IPAR LOG BI FREQ

Corresponding constant:

MSK IPAR LOG BI FREQ

Description:

Controls how frequent the optimizer outputs information about the basis identification and howfrequent the user-defined call-back function is called.

Possible Values:

Any number between 0 and +inf.

Default value:

2500

Page 317: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

23.2. MSKIPARAME: INTEGER PARAMETERS 299

23.2.47 MSK IPAR LOG CHECK CONVEXITY

Corresponding constant:

MSK IPAR LOG CHECK CONVEXITY

Description:

Controls logging in convexity check on quadratic problems. Set to a positive value to turn loggingon.

If a quadratic coefficient matrix is found to violate the requirement of PSD (NSD) then a listof negative (positive) pivot elements is printed. The absolute value of the pivot elements is alsoshown.

Possible Values:

Any number between 0 and +inf.

Default value:

0

23.2.48 MSK IPAR LOG CONCURRENT

Corresponding constant:

MSK IPAR LOG CONCURRENT

Description:

Controls amount of output printed by the concurrent optimizer.

Possible Values:

Any number between 0 and +inf.

Default value:

1

23.2.49 MSK IPAR LOG CUT SECOND OPT

Corresponding constant:

MSK IPAR LOG CUT SECOND OPT

Description:

If a task is employed to solve a sequence of optimization problems, then the value of the loglevels is reduced by the value of this parameter. E.g MSK IPAR LOG and MSK IPAR LOG SIM arereduced by the value of this parameter for the second and any subsequent optimizations.

Possible Values:

Any number between 0 and +inf.

Page 318: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

300 CHAPTER 23. PARAMETERS

Default value:

1

See also:

• MSK IPAR LOG Controls the amount of log information.

• MSK IPAR LOG INTPNT Controls the amount of log information from the interior-point opti-mizers.

• MSK IPAR LOG MIO Controls the amount of log information from the mixed-integer optimiz-ers.

• MSK IPAR LOG SIM Controls the amount of log information from the simplex optimizers.

23.2.50 MSK IPAR LOG EXPAND

Corresponding constant:

MSK IPAR LOG EXPAND

Description:

Controls the amount of logging when a data item such as the maximum number constrains isexpanded.

Possible Values:

Any number between 0 and +inf.

Default value:

0

23.2.51 MSK IPAR LOG FACTOR

Corresponding constant:

MSK IPAR LOG FACTOR

Description:

If turned on, then the factor log lines are added to the log.

Possible Values:

Any number between 0 and +inf.

Default value:

1

Page 319: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

23.2. MSKIPARAME: INTEGER PARAMETERS 301

23.2.52 MSK IPAR LOG FEAS REPAIR

Corresponding constant:

MSK IPAR LOG FEAS REPAIR

Description:

Controls the amount of output printed when performing feasibility repair. A value higher thanone means extensive logging.

Possible Values:

Any number between 0 and +inf.

Default value:

1

23.2.53 MSK IPAR LOG FILE

Corresponding constant:

MSK IPAR LOG FILE

Description:

If turned on, then some log info is printed when a file is written or read.

Possible Values:

Any number between 0 and +inf.

Default value:

1

23.2.54 MSK IPAR LOG HEAD

Corresponding constant:

MSK IPAR LOG HEAD

Description:

If turned on, then a header line is added to the log.

Possible Values:

Any number between 0 and +inf.

Default value:

1

Page 320: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

302 CHAPTER 23. PARAMETERS

23.2.55 MSK IPAR LOG INFEAS ANA

Corresponding constant:

MSK IPAR LOG INFEAS ANA

Description:

Controls amount of output printed by the infeasibility analyzer procedures. A higher level impliesthat more information is logged.

Possible Values:

Any number between 0 and +inf.

Default value:

1

23.2.56 MSK IPAR LOG INTPNT

Corresponding constant:

MSK IPAR LOG INTPNT

Description:

Controls amount of output printed printed by the interior-point optimizer. A higher level impliesthat more information is logged.

Possible Values:

Any number between 0 and +inf.

Default value:

4

23.2.57 MSK IPAR LOG MIO

Corresponding constant:

MSK IPAR LOG MIO

Description:

Controls the log level for the mixed-integer optimizer. A higher level implies that more informa-tion is logged.

Possible Values:

Any number between 0 and +inf.

Default value:

4

Page 321: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

23.2. MSKIPARAME: INTEGER PARAMETERS 303

23.2.58 MSK IPAR LOG MIO FREQ

Corresponding constant:

MSK IPAR LOG MIO FREQ

Description:

Controls how frequent the mixed-integer optimizer prints the log line. It will print line everytime MSK IPAR LOG MIO FREQ relaxations have been solved.

Possible Values:

A integer value.

Default value:

1000

23.2.59 MSK IPAR LOG NONCONVEX

Corresponding constant:

MSK IPAR LOG NONCONVEX

Description:

Controls amount of output printed by the nonconvex optimizer.

Possible Values:

Any number between 0 and +inf.

Default value:

1

23.2.60 MSK IPAR LOG OPTIMIZER

Corresponding constant:

MSK IPAR LOG OPTIMIZER

Description:

Controls the amount of general optimizer information that is logged.

Possible Values:

Any number between 0 and +inf.

Default value:

1

Page 322: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

304 CHAPTER 23. PARAMETERS

23.2.61 MSK IPAR LOG ORDER

Corresponding constant:

MSK IPAR LOG ORDER

Description:

If turned on, then factor lines are added to the log.

Possible Values:

Any number between 0 and +inf.

Default value:

1

23.2.62 MSK IPAR LOG PARAM

Corresponding constant:

MSK IPAR LOG PARAM

Description:

Controls the amount of information printed out about parameter changes.

Possible Values:

Any number between 0 and +inf.

Default value:

0

23.2.63 MSK IPAR LOG PRESOLVE

Corresponding constant:

MSK IPAR LOG PRESOLVE

Description:

Controls amount of output printed by the presolve procedure. A higher level implies that moreinformation is logged.

Possible Values:

Any number between 0 and +inf.

Default value:

1

Page 323: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

23.2. MSKIPARAME: INTEGER PARAMETERS 305

23.2.64 MSK IPAR LOG RESPONSE

Corresponding constant:

MSK IPAR LOG RESPONSE

Description:

Controls amount of output printed when response codes are reported. A higher level implies thatmore information is logged.

Possible Values:

Any number between 0 and +inf.

Default value:

0

23.2.65 MSK IPAR LOG SENSITIVITY

Corresponding constant:

MSK IPAR LOG SENSITIVITY

Description:

Controls the amount of logging during the sensitivity analysis. 0: Means no logging informationis produced. 1: Timing information is printed. 2: Sensitivity results are printed.

Possible Values:

Any number between 0 and +inf.

Default value:

1

23.2.66 MSK IPAR LOG SENSITIVITY OPT

Corresponding constant:

MSK IPAR LOG SENSITIVITY OPT

Description:

Controls the amount of logging from the optimizers employed during the sensitivity analysis. 0means no logging information is produced.

Possible Values:

Any number between 0 and +inf.

Default value:

0

Page 324: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

306 CHAPTER 23. PARAMETERS

23.2.67 MSK IPAR LOG SIM

Corresponding constant:

MSK IPAR LOG SIM

Description:

Controls amount of output printed by the simplex optimizer. A higher level implies that moreinformation is logged.

Possible Values:

Any number between 0 and +inf.

Default value:

4

23.2.68 MSK IPAR LOG SIM FREQ

Corresponding constant:

MSK IPAR LOG SIM FREQ

Description:

Controls how frequent the simplex optimizer outputs information about the optimization andhow frequent the user-defined call-back function is called.

Possible Values:

Any number between 0 and +inf.

Default value:

1000

23.2.69 MSK IPAR LOG SIM MINOR

Corresponding constant:

MSK IPAR LOG SIM MINOR

Description:

Currently not in use.

Possible Values:

Any number between 0 and +inf.

Default value:

1

Page 325: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

23.2. MSKIPARAME: INTEGER PARAMETERS 307

23.2.70 MSK IPAR LOG SIM NETWORK FREQ

Corresponding constant:

MSK IPAR LOG SIM NETWORK FREQ

Description:

Controls how frequent the network simplex optimizer outputs information about the optimizationand how frequent the user-defined call-back function is called. The network optimizer will use alogging frequency equal to MSK IPAR LOG SIM FREQ times MSK IPAR LOG SIM NETWORK FREQ.

Possible Values:

Any number between 0 and +inf.

Default value:

1000

23.2.71 MSK IPAR LOG STORAGE

Corresponding constant:

MSK IPAR LOG STORAGE

Description:

When turned on, MOSEK prints messages regarding the storage usage and allocation.

Possible Values:

Any number between 0 and +inf.

Default value:

0

23.2.72 MSK IPAR MAX NUM WARNINGS

Corresponding constant:

MSK IPAR MAX NUM WARNINGS

Description:

Waning level. A higher value results in more warnings.

Possible Values:

Any number between 0 and +inf.

Default value:

10

Page 326: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

308 CHAPTER 23. PARAMETERS

23.2.73 MSK IPAR MIO BRANCH DIR

Corresponding constant:

MSK IPAR MIO BRANCH DIR

Description:

Controls whether the mixed-integer optimizer is branching up or down by default.

Possible values:

• MSK BRANCH DIR DOWN The mixed-integer optimizer always chooses the down branch first.

• MSK BRANCH DIR FREE The mixed-integer optimizer decides which branch to choose.

• MSK BRANCH DIR UP The mixed-integer optimizer always chooses the up branch first.

Default value:

MSK BRANCH DIR FREE

23.2.74 MSK IPAR MIO BRANCH PRIORITIES USE

Corresponding constant:

MSK IPAR MIO BRANCH PRIORITIES USE

Description:

Controls whether branching priorities are used by the mixed-integer optimizer.

Possible values:

• MSK OFF Switch the option off.

• MSK ON Switch the option on.

Default value:

MSK ON

23.2.75 MSK IPAR MIO CONSTRUCT SOL

Corresponding constant:

MSK IPAR MIO CONSTRUCT SOL

Description:

If set to MSK ON and all integer variables have been given a value for which a feasible mixedinteger solution exists, then MOSEK generates an initial solution to the mixed integer problemby fixing all integer values and solving the remaining problem.

Possible values:

Page 327: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

23.2. MSKIPARAME: INTEGER PARAMETERS 309

• MSK OFF Switch the option off.

• MSK ON Switch the option on.

Default value:

MSK OFF

23.2.76 MSK IPAR MIO CONT SOL

Corresponding constant:

MSK IPAR MIO CONT SOL

Description:

Controls the meaning of the interior-point and basic solutions in mixed integer problems.

Possible values:

• MSK MIO CONT SOL ITG The reported interior-point and basic solutions are a solution to theproblem with all integer variables fixed at the value they have in the integer solution. Asolution is only reported in case the problem has a primal feasible solution.

• MSK MIO CONT SOL ITG REL In case the problem is primal feasible then the reported interior-point and basic solutions are a solution to the problem with all integer variables fixed atthe value they have in the integer solution. If the problem is primal infeasible, then thesolution to the root node problem is reported.

• MSK MIO CONT SOL NONE No interior-point or basic solution are reported when the mixed-integer optimizer is used.

• MSK MIO CONT SOL ROOT The reported interior-point and basic solutions are a solution tothe root node problem when mixed-integer optimizer is used.

Default value:

MSK MIO CONT SOL NONE

23.2.77 MSK IPAR MIO CUT LEVEL ROOT

Corresponding constant:

MSK IPAR MIO CUT LEVEL ROOT

Description:

Controls the cut level employed by the mixed-integer optimizer at the root node. A negativevalue means a default value determined by the mixed-integer optimizer is used. By adding theappropriate values from the following table the employed cut types can be controlled.

Page 328: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

310 CHAPTER 23. PARAMETERS

GUB cover +2Flow cover +4Lifting +8Plant location +16Disaggregation +32Knapsack cover +64Lattice +128Gomory +256Coefficient reduction +512GCD +1024Obj. integrality +2048

Possible Values:

Any value.

Default value:

-1

23.2.78 MSK IPAR MIO CUT LEVEL TREE

Corresponding constant:

MSK IPAR MIO CUT LEVEL TREE

Description:

Controls the cut level employed by the mixed-integer optimizer at the tree. See MSK IPAR MIO CUT LEVEL ROOT

for an explanation of the parameter values.

Possible Values:

Any value.

Default value:

-1

23.2.79 MSK IPAR MIO FEASPUMP LEVEL

Corresponding constant:

MSK IPAR MIO FEASPUMP LEVEL

Description:

Feasibility pump is a heuristic designed to compute an initial feasible solution. A value of 0implies that the feasibility pump heuristic is not used. A value of -1 implies that the mixed-integer optimizer decides how the feasibility pump heuristic is used. A larger value than 1implies that the feasibility pump is employed more aggressively. Normally a value beyond 3 isnot worthwhile.

Page 329: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

23.2. MSKIPARAME: INTEGER PARAMETERS 311

Possible Values:

Any number between -inf and 3.

Default value:

-1

23.2.80 MSK IPAR MIO HEURISTIC LEVEL

Corresponding constant:

MSK IPAR MIO HEURISTIC LEVEL

Description:

Controls the heuristic employed by the mixed-integer optimizer to locate an initial good integerfeasible solution. A value of zero means the heuristic is not used at all. A larger value than0 means that a gradually more sophisticated heuristic is used which is computationally moreexpensive. A negative value implies that the optimizer chooses the heuristic. Normally a valuearound 3 to 5 should be optimal.

Possible Values:

Any value.

Default value:

-1

23.2.81 MSK IPAR MIO HOTSTART

Corresponding constant:

MSK IPAR MIO HOTSTART

Description:

Controls whether the integer optimizer is hot-started.

Possible values:

• MSK OFF Switch the option off.

• MSK ON Switch the option on.

Default value:

MSK ON

Page 330: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

312 CHAPTER 23. PARAMETERS

23.2.82 MSK IPAR MIO KEEP BASIS

Corresponding constant:

MSK IPAR MIO KEEP BASIS

Description:

Controls whether the integer presolve keeps bases in memory. This speeds on the solution processat cost of bigger memory consumption.

Possible values:

• MSK OFF Switch the option off.

• MSK ON Switch the option on.

Default value:

MSK ON

23.2.83 MSK IPAR MIO LOCAL BRANCH NUMBER

Corresponding constant:

MSK IPAR MIO LOCAL BRANCH NUMBER

Description:

Controls the size of the local search space when doing local branching.

Possible Values:

Any number between -inf and +inf.

Default value:

-1

23.2.84 MSK IPAR MIO MAX NUM BRANCHES

Corresponding constant:

MSK IPAR MIO MAX NUM BRANCHES

Description:

Maximum number of branches allowed during the branch and bound search. A negative valuemeans infinite.

Possible Values:

Any number between -inf and +inf.

Default value:

-1

Page 331: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

23.2. MSKIPARAME: INTEGER PARAMETERS 313

See also:

• MSK DPAR MIO DISABLE TERM TIME Certain termination criteria is disabled within the mixed-integer optimizer for period time specified by the parameter.

23.2.85 MSK IPAR MIO MAX NUM RELAXS

Corresponding constant:

MSK IPAR MIO MAX NUM RELAXS

Description:

Maximum number of relaxations allowed during the branch and bound search. A negative valuemeans infinite.

Possible Values:

Any number between -inf and +inf.

Default value:

-1

See also:

• MSK DPAR MIO DISABLE TERM TIME Certain termination criteria is disabled within the mixed-integer optimizer for period time specified by the parameter.

23.2.86 MSK IPAR MIO MAX NUM SOLUTIONS

Corresponding constant:

MSK IPAR MIO MAX NUM SOLUTIONS

Description:

The mixed-integer optimizer can be terminated after a certain number of different feasible so-lutions has been located. If this parameter has the value n and n is strictly positive, then themixed-integer optimizer will be terminated when n feasible solutions have been located.

Possible Values:

Any number between -inf and +inf.

Default value:

-1

See also:

• MSK DPAR MIO DISABLE TERM TIME Certain termination criteria is disabled within the mixed-integer optimizer for period time specified by the parameter.

Page 332: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

314 CHAPTER 23. PARAMETERS

23.2.87 MSK IPAR MIO MODE

Corresponding constant:

MSK IPAR MIO MODE

Description:

Controls whether the optimizer includes the integer restrictions when solving a (mixed) integeroptimization problem.

Possible values:

• MSK MIO MODE IGNORED The integer constraints are ignored and the problem is solved as acontinuous problem.

• MSK MIO MODE LAZY Integer restrictions should be satisfied if an optimizer is available forthe problem.

• MSK MIO MODE SATISFIED Integer restrictions should be satisfied.

Default value:

MSK MIO MODE SATISFIED

23.2.88 MSK IPAR MIO MT USER CB

Corresponding constant:

MSK IPAR MIO MT USER CB

Description:

It true user callbacks are called from each thread used by this optimizer. If false the user callbackis only called from a single thread.

Possible values:

• MSK OFF Switch the option off.

• MSK ON Switch the option on.

Default value:

MSK ON

23.2.89 MSK IPAR MIO NODE OPTIMIZER

Corresponding constant:

MSK IPAR MIO NODE OPTIMIZER

Description:

Controls which optimizer is employed at the non-root nodes in the mixed-integer optimizer.

Page 333: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

23.2. MSKIPARAME: INTEGER PARAMETERS 315

Possible values:

• MSK OPTIMIZER CONCURRENT The optimizer for nonconvex nonlinear problems.

• MSK OPTIMIZER CONIC The optimizer for problems having conic constraints.

• MSK OPTIMIZER DUAL SIMPLEX The dual simplex optimizer is used.

• MSK OPTIMIZER FREE The optimizer is chosen automatically.

• MSK OPTIMIZER FREE SIMPLEX One of the simplex optimizers is used.

• MSK OPTIMIZER INTPNT The interior-point optimizer is used.

• MSK OPTIMIZER MIXED INT The mixed-integer optimizer.

• MSK OPTIMIZER MIXED INT CONIC The mixed-integer optimizer for conic and linear prob-lems.

• MSK OPTIMIZER NETWORK PRIMAL SIMPLEX The network primal simplex optimizer is used.It is only applicable to pute network problems.

• MSK OPTIMIZER NONCONVEX The optimizer for nonconvex nonlinear problems.

• MSK OPTIMIZER PRIMAL DUAL SIMPLEX The primal dual simplex optimizer is used.

• MSK OPTIMIZER PRIMAL SIMPLEX The primal simplex optimizer is used.

Default value:

MSK OPTIMIZER FREE

23.2.90 MSK IPAR MIO NODE SELECTION

Corresponding constant:

MSK IPAR MIO NODE SELECTION

Description:

Controls the node selection strategy employed by the mixed-integer optimizer.

Possible values:

• MSK MIO NODE SELECTION BEST The optimizer employs a best bound node selection strategy.

• MSK MIO NODE SELECTION FIRST The optimizer employs a depth first node selection strat-egy.

• MSK MIO NODE SELECTION FREE The optimizer decides the node selection strategy.

• MSK MIO NODE SELECTION HYBRID The optimizer employs a hybrid strategy.

• MSK MIO NODE SELECTION PSEUDO The optimizer employs selects the node based on a pseudocost estimate.

• MSK MIO NODE SELECTION WORST The optimizer employs a worst bound node selection strat-egy.

Default value:

MSK MIO NODE SELECTION FREE

Page 334: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

316 CHAPTER 23. PARAMETERS

23.2.91 MSK IPAR MIO OPTIMIZER MODE

Corresponding constant:

MSK IPAR MIO OPTIMIZER MODE

Description:

An exprimental feature.

Possible Values:

Any number between 0 and 1.

Default value:

0

23.2.92 MSK IPAR MIO PRESOLVE AGGREGATE

Corresponding constant:

MSK IPAR MIO PRESOLVE AGGREGATE

Description:

Controls whether the presolve used by the mixed-integer optimizer tries to aggregate the con-straints.

Possible values:

• MSK OFF Switch the option off.

• MSK ON Switch the option on.

Default value:

MSK ON

23.2.93 MSK IPAR MIO PRESOLVE PROBING

Corresponding constant:

MSK IPAR MIO PRESOLVE PROBING

Description:

Controls whether the mixed-integer presolve performs probing. Probing can be very time con-suming.

Possible values:

• MSK OFF Switch the option off.

• MSK ON Switch the option on.

Default value:

MSK ON

Page 335: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

23.2. MSKIPARAME: INTEGER PARAMETERS 317

23.2.94 MSK IPAR MIO PRESOLVE USE

Corresponding constant:

MSK IPAR MIO PRESOLVE USE

Description:

Controls whether presolve is performed by the mixed-integer optimizer.

Possible values:

• MSK OFF Switch the option off.

• MSK ON Switch the option on.

Default value:

MSK ON

23.2.95 MSK IPAR MIO ROOT OPTIMIZER

Corresponding constant:

MSK IPAR MIO ROOT OPTIMIZER

Description:

Controls which optimizer is employed at the root node in the mixed-integer optimizer.

Possible values:

• MSK OPTIMIZER CONCURRENT The optimizer for nonconvex nonlinear problems.

• MSK OPTIMIZER CONIC The optimizer for problems having conic constraints.

• MSK OPTIMIZER DUAL SIMPLEX The dual simplex optimizer is used.

• MSK OPTIMIZER FREE The optimizer is chosen automatically.

• MSK OPTIMIZER FREE SIMPLEX One of the simplex optimizers is used.

• MSK OPTIMIZER INTPNT The interior-point optimizer is used.

• MSK OPTIMIZER MIXED INT The mixed-integer optimizer.

• MSK OPTIMIZER MIXED INT CONIC The mixed-integer optimizer for conic and linear prob-lems.

• MSK OPTIMIZER NETWORK PRIMAL SIMPLEX The network primal simplex optimizer is used.It is only applicable to pute network problems.

• MSK OPTIMIZER NONCONVEX The optimizer for nonconvex nonlinear problems.

• MSK OPTIMIZER PRIMAL DUAL SIMPLEX The primal dual simplex optimizer is used.

• MSK OPTIMIZER PRIMAL SIMPLEX The primal simplex optimizer is used.

Default value:

MSK OPTIMIZER FREE

Page 336: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

318 CHAPTER 23. PARAMETERS

23.2.96 MSK IPAR MIO STRONG BRANCH

Corresponding constant:

MSK IPAR MIO STRONG BRANCH

Description:

The value specifies the depth from the root in which strong branching is used. A negative valuemeans that the optimizer chooses a default value automatically.

Possible Values:

Any number between -inf and +inf.

Default value:

-1

23.2.97 MSK IPAR MIO USE MULTITHREADED OPTIMIZER

Corresponding constant:

MSK IPAR MIO USE MULTITHREADED OPTIMIZER

Description:

Controls wheter the new multithreaded optimizer should be used for Mixed integer problems.

Possible values:

• MSK OFF Switch the option off.

• MSK ON Switch the option on.

Default value:

MSK OFF

23.2.98 MSK IPAR MT SPINCOUNT

Corresponding constant:

MSK IPAR MT SPINCOUNT

Description:

Set the number of iterations to spin before sleeping.

Possible Values:

Any integer greater or equal to 0.

Default value:

0

Page 337: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

23.2. MSKIPARAME: INTEGER PARAMETERS 319

23.2.99 MSK IPAR NONCONVEX MAX ITERATIONS

Corresponding constant:

MSK IPAR NONCONVEX MAX ITERATIONS

Description:

Maximum number of iterations that can be used by the nonconvex optimizer.

Possible Values:

Any number between 0 and +inf.

Default value:

100000

23.2.100 MSK IPAR NUM THREADS

Corresponding constant:

MSK IPAR NUM THREADS

Description:

Controls the number of threads employed by the optimizer. If set to 0 the number of threadsused will be equal to the number of cores detected on the machine.

Possible Values:

Any integer greater or equal to 0.

Default value:

0

23.2.101 MSK IPAR OPF MAX TERMS PER LINE

Corresponding constant:

MSK IPAR OPF MAX TERMS PER LINE

Description:

The maximum number of terms (linear and quadratic) per line when an OPF file is written.

Possible Values:

Any number between 0 and +inf.

Default value:

5

Page 338: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

320 CHAPTER 23. PARAMETERS

23.2.102 MSK IPAR OPF WRITE HEADER

Corresponding constant:

MSK IPAR OPF WRITE HEADER

Description:

Write a text header with date and MOSEK version in an OPF file.

Possible values:

• MSK OFF Switch the option off.

• MSK ON Switch the option on.

Default value:

MSK ON

23.2.103 MSK IPAR OPF WRITE HINTS

Corresponding constant:

MSK IPAR OPF WRITE HINTS

Description:

Write a hint section with problem dimensions in the beginning of an OPF file.

Possible values:

• MSK OFF Switch the option off.

• MSK ON Switch the option on.

Default value:

MSK ON

23.2.104 MSK IPAR OPF WRITE PARAMETERS

Corresponding constant:

MSK IPAR OPF WRITE PARAMETERS

Description:

Write a parameter section in an OPF file.

Possible values:

• MSK OFF Switch the option off.

• MSK ON Switch the option on.

Default value:

MSK OFF

Page 339: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

23.2. MSKIPARAME: INTEGER PARAMETERS 321

23.2.105 MSK IPAR OPF WRITE PROBLEM

Corresponding constant:

MSK IPAR OPF WRITE PROBLEM

Description:

Write objective, constraints, bounds etc. to an OPF file.

Possible values:

• MSK OFF Switch the option off.

• MSK ON Switch the option on.

Default value:

MSK ON

23.2.106 MSK IPAR OPF WRITE SOL BAS

Corresponding constant:

MSK IPAR OPF WRITE SOL BAS

Description:

If MSK IPAR OPF WRITE SOLUTIONS is MSK ON and a basic solution is defined, include the basicsolution in OPF files.

Possible values:

• MSK OFF Switch the option off.

• MSK ON Switch the option on.

Default value:

MSK ON

23.2.107 MSK IPAR OPF WRITE SOL ITG

Corresponding constant:

MSK IPAR OPF WRITE SOL ITG

Description:

If MSK IPAR OPF WRITE SOLUTIONS is MSK ON and an integer solution is defined, write the integersolution in OPF files.

Possible values:

• MSK OFF Switch the option off.

Page 340: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

322 CHAPTER 23. PARAMETERS

• MSK ON Switch the option on.

Default value:

MSK ON

23.2.108 MSK IPAR OPF WRITE SOL ITR

Corresponding constant:

MSK IPAR OPF WRITE SOL ITR

Description:

If MSK IPAR OPF WRITE SOLUTIONS is MSK ON and an interior solution is defined, write the interiorsolution in OPF files.

Possible values:

• MSK OFF Switch the option off.

• MSK ON Switch the option on.

Default value:

MSK ON

23.2.109 MSK IPAR OPF WRITE SOLUTIONS

Corresponding constant:

MSK IPAR OPF WRITE SOLUTIONS

Description:

Enable inclusion of solutions in the OPF files.

Possible values:

• MSK OFF Switch the option off.

• MSK ON Switch the option on.

Default value:

MSK OFF

Page 341: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

23.2. MSKIPARAME: INTEGER PARAMETERS 323

23.2.110 MSK IPAR OPTIMIZER

Corresponding constant:

MSK IPAR OPTIMIZER

Description:

The paramter controls which optimizer is used to optimize the task.

Possible values:

• MSK OPTIMIZER CONCURRENT The optimizer for nonconvex nonlinear problems.

• MSK OPTIMIZER CONIC The optimizer for problems having conic constraints.

• MSK OPTIMIZER DUAL SIMPLEX The dual simplex optimizer is used.

• MSK OPTIMIZER FREE The optimizer is chosen automatically.

• MSK OPTIMIZER FREE SIMPLEX One of the simplex optimizers is used.

• MSK OPTIMIZER INTPNT The interior-point optimizer is used.

• MSK OPTIMIZER MIXED INT The mixed-integer optimizer.

• MSK OPTIMIZER MIXED INT CONIC The mixed-integer optimizer for conic and linear prob-lems.

• MSK OPTIMIZER NETWORK PRIMAL SIMPLEX The network primal simplex optimizer is used.It is only applicable to pute network problems.

• MSK OPTIMIZER NONCONVEX The optimizer for nonconvex nonlinear problems.

• MSK OPTIMIZER PRIMAL DUAL SIMPLEX The primal dual simplex optimizer is used.

• MSK OPTIMIZER PRIMAL SIMPLEX The primal simplex optimizer is used.

Default value:

MSK OPTIMIZER FREE

23.2.111 MSK IPAR PARAM READ CASE NAME

Corresponding constant:

MSK IPAR PARAM READ CASE NAME

Description:

If turned on, then names in the parameter file are case sensitive.

Possible values:

• MSK OFF Switch the option off.

• MSK ON Switch the option on.

Default value:

MSK ON

Page 342: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

324 CHAPTER 23. PARAMETERS

23.2.112 MSK IPAR PARAM READ IGN ERROR

Corresponding constant:

MSK IPAR PARAM READ IGN ERROR

Description:

If turned on, then errors in paramter settings is ignored.

Possible values:

• MSK OFF Switch the option off.

• MSK ON Switch the option on.

Default value:

MSK OFF

23.2.113 MSK IPAR PRESOLVE ELIM FILL

Corresponding constant:

MSK IPAR PRESOLVE ELIM FILL

Description:

Controls the maximum amount of fill-in that can be created during the elimination phase of thepresolve. This parameter times (numcon+numvar) denotes the amount of fill-in.

Possible Values:

Any number between 0 and +inf.

Default value:

1

23.2.114 MSK IPAR PRESOLVE ELIMINATOR MAX NUM TRIES

Corresponding constant:

MSK IPAR PRESOLVE ELIMINATOR MAX NUM TRIES

Description:

Control the maximum number of times the eliminator is tried.

Possible Values:

A negative value implies MOSEK decides maximum number of times.

Default value:

-1

Page 343: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

23.2. MSKIPARAME: INTEGER PARAMETERS 325

23.2.115 MSK IPAR PRESOLVE ELIMINATOR USE

Corresponding constant:

MSK IPAR PRESOLVE ELIMINATOR USE

Description:

Controls whether free or implied free variables are eliminated from the problem.

Possible values:

• MSK OFF Switch the option off.

• MSK ON Switch the option on.

Default value:

MSK ON

23.2.116 MSK IPAR PRESOLVE LEVEL

Corresponding constant:

MSK IPAR PRESOLVE LEVEL

Description:

Currently not used.

Possible Values:

Any number between -inf and +inf.

Default value:

-1

23.2.117 MSK IPAR PRESOLVE LINDEP ABS WORK TRH

Corresponding constant:

MSK IPAR PRESOLVE LINDEP ABS WORK TRH

Description:

The linear dependency check is potentially computationally expensive.

Possible Values:

Any number between 0 and +inf.

Default value:

100

Page 344: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

326 CHAPTER 23. PARAMETERS

23.2.118 MSK IPAR PRESOLVE LINDEP REL WORK TRH

Corresponding constant:

MSK IPAR PRESOLVE LINDEP REL WORK TRH

Description:

The linear dependency check is potentially computationally expensive.

Possible Values:

Any number between 0 and +inf.

Default value:

100

23.2.119 MSK IPAR PRESOLVE LINDEP USE

Corresponding constant:

MSK IPAR PRESOLVE LINDEP USE

Description:

Controls whether the linear constraints are checked for linear dependencies.

Possible values:

• MSK OFF Switch the option off.

• MSK ON Switch the option on.

Default value:

MSK ON

23.2.120 MSK IPAR PRESOLVE MAX NUM REDUCTIONS

Corresponding constant:

MSK IPAR PRESOLVE MAX NUM REDUCTIONS

Description:

Controls the maximum number reductions performed by the presolve. The value of the parameteris normally only changed in connection with debugging. A negative value implies that an infinitenumber of reductions are allowed.

Possible Values:

Any number between -inf and +inf.

Default value:

-1

Page 345: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

23.2. MSKIPARAME: INTEGER PARAMETERS 327

23.2.121 MSK IPAR PRESOLVE USE

Corresponding constant:

MSK IPAR PRESOLVE USE

Description:

Controls whether the presolve is applied to a problem before it is optimized.

Possible values:

• MSK PRESOLVE MODE FREE It is decided automatically whether to presolve before the problemis optimized.

• MSK PRESOLVE MODE OFF The problem is not presolved before it is optimized.

• MSK PRESOLVE MODE ON The problem is presolved before it is optimized.

Default value:

MSK PRESOLVE MODE FREE

23.2.122 MSK IPAR PRIMAL REPAIR OPTIMIZER

Corresponding constant:

MSK IPAR PRIMAL REPAIR OPTIMIZER

Description:

Controls which optimizer that is used to find the optimal repair.

Possible values:

• MSK OPTIMIZER CONCURRENT The optimizer for nonconvex nonlinear problems.

• MSK OPTIMIZER CONIC The optimizer for problems having conic constraints.

• MSK OPTIMIZER DUAL SIMPLEX The dual simplex optimizer is used.

• MSK OPTIMIZER FREE The optimizer is chosen automatically.

• MSK OPTIMIZER FREE SIMPLEX One of the simplex optimizers is used.

• MSK OPTIMIZER INTPNT The interior-point optimizer is used.

• MSK OPTIMIZER MIXED INT The mixed-integer optimizer.

• MSK OPTIMIZER MIXED INT CONIC The mixed-integer optimizer for conic and linear prob-lems.

• MSK OPTIMIZER NETWORK PRIMAL SIMPLEX The network primal simplex optimizer is used.It is only applicable to pute network problems.

• MSK OPTIMIZER NONCONVEX The optimizer for nonconvex nonlinear problems.

• MSK OPTIMIZER PRIMAL DUAL SIMPLEX The primal dual simplex optimizer is used.

• MSK OPTIMIZER PRIMAL SIMPLEX The primal simplex optimizer is used.

Default value:

MSK OPTIMIZER FREE

Page 346: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

328 CHAPTER 23. PARAMETERS

23.2.123 MSK IPAR QO SEPARABLE REFORMULATION

Corresponding constant:

MSK IPAR QO SEPARABLE REFORMULATION

Description:

Determine if Quadratic programing problems should be reformulated to separable form.

Possible values:

• MSK OFF Switch the option off.

• MSK ON Switch the option on.

Default value:

MSK OFF

23.2.124 MSK IPAR READ ANZ

Corresponding constant:

MSK IPAR READ ANZ

Description:

Expected maximum number of A non-zeros to be read. The option is used only by fast MPSand LP file readers.

Possible Values:

Any number between 0 and +inf.

Default value:

100000

23.2.125 MSK IPAR READ CON

Corresponding constant:

MSK IPAR READ CON

Description:

Expected maximum number of constraints to be read. The option is only used by fast MPS andLP file readers.

Possible Values:

Any number between 0 and +inf.

Default value:

10000

Page 347: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

23.2. MSKIPARAME: INTEGER PARAMETERS 329

23.2.126 MSK IPAR READ CONE

Corresponding constant:

MSK IPAR READ CONE

Description:

Expected maximum number of conic constraints to be read. The option is used only by fastMPS and LP file readers.

Possible Values:

Any number between 0 and +inf.

Default value:

2500

23.2.127 MSK IPAR READ DATA COMPRESSED

Corresponding constant:

MSK IPAR READ DATA COMPRESSED

Description:

If this option is turned on,it is assumed that the data file is compressed.

Possible values:

• MSK COMPRESS FREE The type of compression used is chosen automatically.

• MSK COMPRESS GZIP The type of compression used is gzip compatible.

• MSK COMPRESS NONE No compression is used.

Default value:

MSK COMPRESS FREE

23.2.128 MSK IPAR READ DATA FORMAT

Corresponding constant:

MSK IPAR READ DATA FORMAT

Description:

Format of the data file to be read.

Possible values:

• MSK DATA FORMAT EXTENSION The file extension is used to determine the data file format.

• MSK DATA FORMAT FREE MPS The data data a free MPS formatted file.

Page 348: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

330 CHAPTER 23. PARAMETERS

• MSK DATA FORMAT LP The data file is LP formatted.

• MSK DATA FORMAT MPS The data file is MPS formatted.

• MSK DATA FORMAT OP The data file is an optimization problem formatted file.

• MSK DATA FORMAT TASK Generic task dump file.

• MSK DATA FORMAT XML The data file is an XML formatted file.

Default value:

MSK DATA FORMAT EXTENSION

23.2.129 MSK IPAR READ KEEP FREE CON

Corresponding constant:

MSK IPAR READ KEEP FREE CON

Description:

Controls whether the free constraints are included in the problem.

Possible values:

• MSK OFF Switch the option off.

• MSK ON Switch the option on.

Default value:

MSK OFF

23.2.130 MSK IPAR READ LP DROP NEW VARS IN BOU

Corresponding constant:

MSK IPAR READ LP DROP NEW VARS IN BOU

Description:

If this option is turned on, MOSEK will drop variables that are defined for the first time in thebounds section.

Possible values:

• MSK OFF Switch the option off.

• MSK ON Switch the option on.

Default value:

MSK OFF

Page 349: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

23.2. MSKIPARAME: INTEGER PARAMETERS 331

23.2.131 MSK IPAR READ LP QUOTED NAMES

Corresponding constant:

MSK IPAR READ LP QUOTED NAMES

Description:

If a name is in quotes when reading an LP file, the quotes will be removed.

Possible values:

• MSK OFF Switch the option off.

• MSK ON Switch the option on.

Default value:

MSK ON

23.2.132 MSK IPAR READ MPS FORMAT

Corresponding constant:

MSK IPAR READ MPS FORMAT

Description:

Controls how strictly the MPS file reader interprets the MPS format.

Possible values:

• MSK MPS FORMAT FREE It is assumed that the input file satisfies the free MPS format. Thisimplies that spaces are not allowed in names. Otherwise the format is free.

• MSK MPS FORMAT RELAXED It is assumed that the input file satisfies a slightly relaxed versionof the MPS format.

• MSK MPS FORMAT STRICT It is assumed that the input file satisfies the MPS format strictly.

Default value:

MSK MPS FORMAT RELAXED

23.2.133 MSK IPAR READ MPS KEEP INT

Corresponding constant:

MSK IPAR READ MPS KEEP INT

Description:

Controls whether MOSEK should keep the integer restrictions on the variables while reading theMPS file.

Page 350: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

332 CHAPTER 23. PARAMETERS

Possible values:

• MSK OFF Switch the option off.

• MSK ON Switch the option on.

Default value:

MSK ON

23.2.134 MSK IPAR READ MPS OBJ SENSE

Corresponding constant:

MSK IPAR READ MPS OBJ SENSE

Description:

If turned on, the MPS reader uses the objective sense section. Otherwise the MPS reader ignoresit.

Possible values:

• MSK OFF Switch the option off.

• MSK ON Switch the option on.

Default value:

MSK ON

23.2.135 MSK IPAR READ MPS RELAX

Corresponding constant:

MSK IPAR READ MPS RELAX

Description:

If this option is turned on, then mixed integer constraints are ignored when a problem is read.

Possible values:

• MSK OFF Switch the option off.

• MSK ON Switch the option on.

Default value:

MSK ON

Page 351: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

23.2. MSKIPARAME: INTEGER PARAMETERS 333

23.2.136 MSK IPAR READ MPS WIDTH

Corresponding constant:

MSK IPAR READ MPS WIDTH

Description:

Controls the maximal number of characters allowed in one line of the MPS file.

Possible Values:

Any positive number greater than 80.

Default value:

1024

23.2.137 MSK IPAR READ QNZ

Corresponding constant:

MSK IPAR READ QNZ

Description:

Expected maximum number of Q non-zeros to be read. The option is used only by MPS and LPfile readers.

Possible Values:

Any number between 0 and +inf.

Default value:

20000

23.2.138 MSK IPAR READ TASK IGNORE PARAM

Corresponding constant:

MSK IPAR READ TASK IGNORE PARAM

Description:

Controls whether MOSEK should ignore the parameter setting defined in the task file and usethe default parameter setting instead.

Possible values:

• MSK OFF Switch the option off.

• MSK ON Switch the option on.

Default value:

MSK OFF

Page 352: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

334 CHAPTER 23. PARAMETERS

23.2.139 MSK IPAR READ VAR

Corresponding constant:

MSK IPAR READ VAR

Description:

Expected maximum number of variable to be read. The option is used only by MPS and LP filereaders.

Possible Values:

Any number between 0 and +inf.

Default value:

10000

23.2.140 MSK IPAR SENSITIVITY ALL

Corresponding constant:

MSK IPAR SENSITIVITY ALL

Description:

Not applicable.

Possible values:

• MSK OFF Switch the option off.

• MSK ON Switch the option on.

Default value:

MSK OFF

23.2.141 MSK IPAR SENSITIVITY OPTIMIZER

Corresponding constant:

MSK IPAR SENSITIVITY OPTIMIZER

Description:

Controls which optimizer is used for optimal partition sensitivity analysis.

Possible values:

• MSK OPTIMIZER CONCURRENT The optimizer for nonconvex nonlinear problems.

• MSK OPTIMIZER CONIC The optimizer for problems having conic constraints.

• MSK OPTIMIZER DUAL SIMPLEX The dual simplex optimizer is used.

Page 353: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

23.2. MSKIPARAME: INTEGER PARAMETERS 335

• MSK OPTIMIZER FREE The optimizer is chosen automatically.

• MSK OPTIMIZER FREE SIMPLEX One of the simplex optimizers is used.

• MSK OPTIMIZER INTPNT The interior-point optimizer is used.

• MSK OPTIMIZER MIXED INT The mixed-integer optimizer.

• MSK OPTIMIZER MIXED INT CONIC The mixed-integer optimizer for conic and linear prob-lems.

• MSK OPTIMIZER NETWORK PRIMAL SIMPLEX The network primal simplex optimizer is used.It is only applicable to pute network problems.

• MSK OPTIMIZER NONCONVEX The optimizer for nonconvex nonlinear problems.

• MSK OPTIMIZER PRIMAL DUAL SIMPLEX The primal dual simplex optimizer is used.

• MSK OPTIMIZER PRIMAL SIMPLEX The primal simplex optimizer is used.

Default value:

MSK OPTIMIZER FREE SIMPLEX

23.2.142 MSK IPAR SENSITIVITY TYPE

Corresponding constant:

MSK IPAR SENSITIVITY TYPE

Description:

Controls which type of sensitivity analysis is to be performed.

Possible values:

• MSK SENSITIVITY TYPE BASIS Basis sensitivity analysis is performed.

• MSK SENSITIVITY TYPE OPTIMAL PARTITION Optimal partition sensitivity analysis is per-formed.

Default value:

MSK SENSITIVITY TYPE BASIS

23.2.143 MSK IPAR SIM BASIS FACTOR USE

Corresponding constant:

MSK IPAR SIM BASIS FACTOR USE

Description:

Controls whether a (LU) factorization of the basis is used in a hot-start. Forcing a refactor-ization sometimes improves the stability of the simplex optimizers, but in most cases there is aperformance penanlty.

Page 354: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

336 CHAPTER 23. PARAMETERS

Possible values:

• MSK OFF Switch the option off.

• MSK ON Switch the option on.

Default value:

MSK ON

23.2.144 MSK IPAR SIM DEGEN

Corresponding constant:

MSK IPAR SIM DEGEN

Description:

Controls how aggressively degeneration is handled.

Possible values:

• MSK SIM DEGEN AGGRESSIVE The simplex optimizer should use an aggressive degenerationstrategy.

• MSK SIM DEGEN FREE The simplex optimizer chooses the degeneration strategy.

• MSK SIM DEGEN MINIMUM The simplex optimizer should use a minimum degeneration strat-egy.

• MSK SIM DEGEN MODERATE The simplex optimizer should use a moderate degeneration strat-egy.

• MSK SIM DEGEN NONE The simplex optimizer should use no degeneration strategy.

Default value:

MSK SIM DEGEN FREE

23.2.145 MSK IPAR SIM DUAL CRASH

Corresponding constant:

MSK IPAR SIM DUAL CRASH

Description:

Controls whether crashing is performed in the dual simplex optimizer.

In general if a basis consists of more than (100-this parameter value)% fixed variables, then acrash will be performed.

Possible Values:

Any number between 0 and +inf.

Default value:

90

Page 355: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

23.2. MSKIPARAME: INTEGER PARAMETERS 337

23.2.146 MSK IPAR SIM DUAL PHASEONE METHOD

Corresponding constant:

MSK IPAR SIM DUAL PHASEONE METHOD

Description:

An exprimental feature.

Possible Values:

Any number between 0 and 10.

Default value:

0

23.2.147 MSK IPAR SIM DUAL RESTRICT SELECTION

Corresponding constant:

MSK IPAR SIM DUAL RESTRICT SELECTION

Description:

The dual simplex optimizer can use a so-called restricted selection/pricing strategy to choosesthe outgoing variable. Hence, if restricted selection is applied, then the dual simplex optimizerfirst choose a subset of all the potential outgoing variables. Next, for some time it will choosethe outgoing variable only among the subset. From time to time the subset is redefined.

A larger value of this parameter implies that the optimizer will be more aggressive in its restrictionstrategy, i.e. a value of 0 implies that the restriction strategy is not applied at all.

Possible Values:

Any number between 0 and 100.

Default value:

50

23.2.148 MSK IPAR SIM DUAL SELECTION

Corresponding constant:

MSK IPAR SIM DUAL SELECTION

Description:

Controls the choice of the incoming variable, known as the selection strategy, in the dual simplexoptimizer.

Possible values:

• MSK SIM SELECTION ASE The optimizer uses approximate steepest-edge pricing.

Page 356: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

338 CHAPTER 23. PARAMETERS

• MSK SIM SELECTION DEVEX The optimizer uses devex steepest-edge pricing (or if it is notavailable an approximate steep-edge selection).

• MSK SIM SELECTION FREE The optimizer chooses the pricing strategy.

• MSK SIM SELECTION FULL The optimizer uses full pricing.

• MSK SIM SELECTION PARTIAL The optimizer uses a partial selection approach. The approachis usually beneficial if the number of variables is much larger than the number of constraints.

• MSK SIM SELECTION SE The optimizer uses steepest-edge selection (or if it is not availablean approximate steep-edge selection).

Default value:

MSK SIM SELECTION FREE

23.2.149 MSK IPAR SIM EXPLOIT DUPVEC

Corresponding constant:

MSK IPAR SIM EXPLOIT DUPVEC

Description:

Controls if the simplex optimizers are allowed to exploit duplicated columns.

Possible values:

• MSK SIM EXPLOIT DUPVEC FREE The simplex optimizer can choose freely.

• MSK SIM EXPLOIT DUPVEC OFF Disallow the simplex optimizer to exploit duplicated columns.

• MSK SIM EXPLOIT DUPVEC ON Allow the simplex optimizer to exploit duplicated columns.

Default value:

MSK SIM EXPLOIT DUPVEC OFF

23.2.150 MSK IPAR SIM HOTSTART

Corresponding constant:

MSK IPAR SIM HOTSTART

Description:

Controls the type of hot-start that the simplex optimizer perform.

Possible values:

• MSK SIM HOTSTART FREE The simplex optimize chooses the hot-start type.

• MSK SIM HOTSTART NONE The simplex optimizer performs a coldstart.

• MSK SIM HOTSTART STATUS KEYS Only the status keys of the constraints and variables areused to choose the type of hot-start.

Default value:

MSK SIM HOTSTART FREE

Page 357: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

23.2. MSKIPARAME: INTEGER PARAMETERS 339

23.2.151 MSK IPAR SIM HOTSTART LU

Corresponding constant:

MSK IPAR SIM HOTSTART LU

Description:

Determines if the simplex optimizer should exploit the initial factorization.

Possible values:

• MSK OFF Switch the option off.

• MSK ON Switch the option on.

Default value:

MSK ON

23.2.152 MSK IPAR SIM INTEGER

Corresponding constant:

MSK IPAR SIM INTEGER

Description:

An exprimental feature.

Possible Values:

Any number between 0 and 10.

Default value:

0

23.2.153 MSK IPAR SIM MAX ITERATIONS

Corresponding constant:

MSK IPAR SIM MAX ITERATIONS

Description:

Maximum number of iterations that can be used by a simplex optimizer.

Possible Values:

Any number between 0 and +inf.

Default value:

10000000

Page 358: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

340 CHAPTER 23. PARAMETERS

23.2.154 MSK IPAR SIM MAX NUM SETBACKS

Corresponding constant:

MSK IPAR SIM MAX NUM SETBACKS

Description:

Controls how many set-backs are allowed within a simplex optimizer. A set-back is an eventwhere the optimizer moves in the wrong direction. This is impossible in theory but may happendue to numerical problems.

Possible Values:

Any number between 0 and +inf.

Default value:

250

23.2.155 MSK IPAR SIM NON SINGULAR

Corresponding constant:

MSK IPAR SIM NON SINGULAR

Description:

Controls if the simplex optimizer ensures a non-singular basis, if possible.

Possible values:

• MSK OFF Switch the option off.

• MSK ON Switch the option on.

Default value:

MSK ON

23.2.156 MSK IPAR SIM PRIMAL CRASH

Corresponding constant:

MSK IPAR SIM PRIMAL CRASH

Description:

Controls whether crashing is performed in the primal simplex optimizer.

In general, if a basis consists of more than (100-this parameter value)% fixed variables, then acrash will be performed.

Possible Values:

Any nonnegative integer value.

Page 359: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

23.2. MSKIPARAME: INTEGER PARAMETERS 341

Default value:

90

23.2.157 MSK IPAR SIM PRIMAL PHASEONE METHOD

Corresponding constant:

MSK IPAR SIM PRIMAL PHASEONE METHOD

Description:

An exprimental feature.

Possible Values:

Any number between 0 and 10.

Default value:

0

23.2.158 MSK IPAR SIM PRIMAL RESTRICT SELECTION

Corresponding constant:

MSK IPAR SIM PRIMAL RESTRICT SELECTION

Description:

The primal simplex optimizer can use a so-called restricted selection/pricing strategy to choosesthe outgoing variable. Hence, if restricted selection is applied, then the primal simplex optimizerfirst choose a subset of all the potential incoming variables. Next, for some time it will choosethe incoming variable only among the subset. From time to time the subset is redefined.

A larger value of this parameter implies that the optimizer will be more aggressive in its restrictionstrategy, i.e. a value of 0 implies that the restriction strategy is not applied at all.

Possible Values:

Any number between 0 and 100.

Default value:

50

23.2.159 MSK IPAR SIM PRIMAL SELECTION

Corresponding constant:

MSK IPAR SIM PRIMAL SELECTION

Description:

Controls the choice of the incoming variable, known as the selection strategy, in the primalsimplex optimizer.

Page 360: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

342 CHAPTER 23. PARAMETERS

Possible values:

• MSK SIM SELECTION ASE The optimizer uses approximate steepest-edge pricing.

• MSK SIM SELECTION DEVEX The optimizer uses devex steepest-edge pricing (or if it is notavailable an approximate steep-edge selection).

• MSK SIM SELECTION FREE The optimizer chooses the pricing strategy.

• MSK SIM SELECTION FULL The optimizer uses full pricing.

• MSK SIM SELECTION PARTIAL The optimizer uses a partial selection approach. The approachis usually beneficial if the number of variables is much larger than the number of constraints.

• MSK SIM SELECTION SE The optimizer uses steepest-edge selection (or if it is not availablean approximate steep-edge selection).

Default value:

MSK SIM SELECTION FREE

23.2.160 MSK IPAR SIM REFACTOR FREQ

Corresponding constant:

MSK IPAR SIM REFACTOR FREQ

Description:

Controls how frequent the basis is refactorized. The value 0 means that the optimizer determinesthe best point of refactorization.

It is strongly recommended NOT to change this parameter.

Possible Values:

Any number between 0 and +inf.

Default value:

0

23.2.161 MSK IPAR SIM REFORMULATION

Corresponding constant:

MSK IPAR SIM REFORMULATION

Description:

Controls if the simplex optimizers are allowed to reformulate the problem.

Possible values:

• MSK SIM REFORMULATION AGGRESSIVE The simplex optimizer should use an aggressive re-formulation strategy.

Page 361: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

23.2. MSKIPARAME: INTEGER PARAMETERS 343

• MSK SIM REFORMULATION FREE The simplex optimizer can choose freely.

• MSK SIM REFORMULATION OFF Disallow the simplex optimizer to reformulate the problem.

• MSK SIM REFORMULATION ON Allow the simplex optimizer to reformulate the problem.

Default value:

MSK SIM REFORMULATION OFF

23.2.162 MSK IPAR SIM SAVE LU

Corresponding constant:

MSK IPAR SIM SAVE LU

Description:

Controls if the LU factorization stored should be replaced with the LU factorization correspondingto the initial basis.

Possible values:

• MSK OFF Switch the option off.

• MSK ON Switch the option on.

Default value:

MSK OFF

23.2.163 MSK IPAR SIM SCALING

Corresponding constant:

MSK IPAR SIM SCALING

Description:

Controls how much effort is used in scaling the problem before a simplex optimizer is used.

Possible values:

• MSK SCALING AGGRESSIVE A very aggressive scaling is performed.

• MSK SCALING FREE The optimizer chooses the scaling heuristic.

• MSK SCALING MODERATE A conservative scaling is performed.

• MSK SCALING NONE No scaling is performed.

Default value:

MSK SCALING FREE

Page 362: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

344 CHAPTER 23. PARAMETERS

23.2.164 MSK IPAR SIM SCALING METHOD

Corresponding constant:

MSK IPAR SIM SCALING METHOD

Description:

Controls how the problem is scaled before a simplex optimizer is used.

Possible values:

• MSK SCALING METHOD FREE The optimizer chooses the scaling heuristic.

• MSK SCALING METHOD POW2 Scales only with power of 2 leaving the mantissa untouched.

Default value:

MSK SCALING METHOD POW2

23.2.165 MSK IPAR SIM SOLVE FORM

Corresponding constant:

MSK IPAR SIM SOLVE FORM

Description:

Controls whether the primal or the dual problem is solved by the primal-/dual- simplex optimizer.

Possible values:

• MSK SOLVE DUAL The optimizer should solve the dual problem.

• MSK SOLVE FREE The optimizer is free to solve either the primal or the dual problem.

• MSK SOLVE PRIMAL The optimizer should solve the primal problem.

Default value:

MSK SOLVE FREE

23.2.166 MSK IPAR SIM STABILITY PRIORITY

Corresponding constant:

MSK IPAR SIM STABILITY PRIORITY

Description:

Controls how high priority the numerical stability should be given.

Possible Values:

Any number between 0 and 100.

Default value:

50

Page 363: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

23.2. MSKIPARAME: INTEGER PARAMETERS 345

23.2.167 MSK IPAR SIM SWITCH OPTIMIZER

Corresponding constant:

MSK IPAR SIM SWITCH OPTIMIZER

Description:

The simplex optimizer sometimes chooses to solve the dual problem instead of the primal problem.This implies that if you have chosen to use the dual simplex optimizer and the problem is dualized,then it actually makes sense to use the primal simplex optimizer instead. If this parameter is onand the problem is dualized and furthermore the simplex optimizer is chosen to be the primal(dual) one, then it is switched to the dual (primal).

Possible values:

• MSK OFF Switch the option off.

• MSK ON Switch the option on.

Default value:

MSK OFF

23.2.168 MSK IPAR SOL FILTER KEEP BASIC

Corresponding constant:

MSK IPAR SOL FILTER KEEP BASIC

Description:

If turned on, then basic and super basic constraints and variables are written to the solution fileindependent of the filter setting.

Possible values:

• MSK OFF Switch the option off.

• MSK ON Switch the option on.

Default value:

MSK OFF

23.2.169 MSK IPAR SOL FILTER KEEP RANGED

Corresponding constant:

MSK IPAR SOL FILTER KEEP RANGED

Description:

If turned on, then ranged constraints and variables are written to the solution file independentof the filter setting.

Page 364: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

346 CHAPTER 23. PARAMETERS

Possible values:

• MSK OFF Switch the option off.

• MSK ON Switch the option on.

Default value:

MSK OFF

23.2.170 MSK IPAR SOL READ NAME WIDTH

Corresponding constant:

MSK IPAR SOL READ NAME WIDTH

Description:

When a solution is read by MOSEK and some constraint, variable or cone names contain blanks,then a maximum name width much be specified. A negative value implies that no name containblanks.

Possible Values:

Any number between -inf and +inf.

Default value:

-1

23.2.171 MSK IPAR SOL READ WIDTH

Corresponding constant:

MSK IPAR SOL READ WIDTH

Description:

Controls the maximal acceptable width of line in the solutions when read by MOSEK.

Possible Values:

Any positive number greater than 80.

Default value:

1024

Page 365: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

23.2. MSKIPARAME: INTEGER PARAMETERS 347

23.2.172 MSK IPAR SOLUTION CALLBACK

Corresponding constant:

MSK IPAR SOLUTION CALLBACK

Description:

Indicates whether solution call-backs will be performed during the optimization.

Possible values:

• MSK OFF Switch the option off.

• MSK ON Switch the option on.

Default value:

MSK OFF

23.2.173 MSK IPAR TIMING LEVEL

Corresponding constant:

MSK IPAR TIMING LEVEL

Description:

Controls the a amount of timing performed inside MOSEK.

Possible Values:

Any integer greater or equal to 0.

Default value:

1

23.2.174 MSK IPAR WARNING LEVEL

Corresponding constant:

MSK IPAR WARNING LEVEL

Description:

Warning level.

Possible Values:

Any number between 0 and +inf.

Default value:

1

Page 366: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

348 CHAPTER 23. PARAMETERS

23.2.175 MSK IPAR WRITE BAS CONSTRAINTS

Corresponding constant:

MSK IPAR WRITE BAS CONSTRAINTS

Description:

Controls whether the constraint section is written to the basic solution file.

Possible values:

• MSK OFF Switch the option off.

• MSK ON Switch the option on.

Default value:

MSK ON

23.2.176 MSK IPAR WRITE BAS HEAD

Corresponding constant:

MSK IPAR WRITE BAS HEAD

Description:

Controls whether the header section is written to the basic solution file.

Possible values:

• MSK OFF Switch the option off.

• MSK ON Switch the option on.

Default value:

MSK ON

23.2.177 MSK IPAR WRITE BAS VARIABLES

Corresponding constant:

MSK IPAR WRITE BAS VARIABLES

Description:

Controls whether the variables section is written to the basic solution file.

Possible values:

• MSK OFF Switch the option off.

• MSK ON Switch the option on.

Default value:

MSK ON

Page 367: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

23.2. MSKIPARAME: INTEGER PARAMETERS 349

23.2.178 MSK IPAR WRITE DATA COMPRESSED

Corresponding constant:

MSK IPAR WRITE DATA COMPRESSED

Description:

Controls whether the data file is compressed while it is written. 0 means no compression whilehigher values mean more compression.

Possible Values:

Any number between 0 and +inf.

Default value:

0

23.2.179 MSK IPAR WRITE DATA FORMAT

Corresponding constant:

MSK IPAR WRITE DATA FORMAT

Description:

Controls the file format when writing task data to a file.

Possible values:

• MSK DATA FORMAT EXTENSION The file extension is used to determine the data file format.

• MSK DATA FORMAT FREE MPS The data data a free MPS formatted file.

• MSK DATA FORMAT LP The data file is LP formatted.

• MSK DATA FORMAT MPS The data file is MPS formatted.

• MSK DATA FORMAT OP The data file is an optimization problem formatted file.

• MSK DATA FORMAT TASK Generic task dump file.

• MSK DATA FORMAT XML The data file is an XML formatted file.

Default value:

MSK DATA FORMAT EXTENSION

23.2.180 MSK IPAR WRITE DATA PARAM

Corresponding constant:

MSK IPAR WRITE DATA PARAM

Description:

If this option is turned on the parameter settings are written to the data file as parameters.

Page 368: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

350 CHAPTER 23. PARAMETERS

Possible values:

• MSK OFF Switch the option off.

• MSK ON Switch the option on.

Default value:

MSK OFF

23.2.181 MSK IPAR WRITE FREE CON

Corresponding constant:

MSK IPAR WRITE FREE CON

Description:

Controls whether the free constraints are written to the data file.

Possible values:

• MSK OFF Switch the option off.

• MSK ON Switch the option on.

Default value:

MSK OFF

23.2.182 MSK IPAR WRITE GENERIC NAMES

Corresponding constant:

MSK IPAR WRITE GENERIC NAMES

Description:

Controls whether the generic names or user-defined names are used in the data file.

Possible values:

• MSK OFF Switch the option off.

• MSK ON Switch the option on.

Default value:

MSK OFF

Page 369: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

23.2. MSKIPARAME: INTEGER PARAMETERS 351

23.2.183 MSK IPAR WRITE GENERIC NAMES IO

Corresponding constant:

MSK IPAR WRITE GENERIC NAMES IO

Description:

Index origin used in generic names.

Possible Values:

Any number between 0 and +inf.

Default value:

1

23.2.184 MSK IPAR WRITE IGNORE INCOMPATIBLE CONIC ITEMS

Corresponding constant:

MSK IPAR WRITE IGNORE INCOMPATIBLE CONIC ITEMS

Description:

If the output format is not compatible with conic quadratic problems this parameter controls ifthe writer ignores the conic parts or produces an error.

Possible values:

• MSK OFF Switch the option off.

• MSK ON Switch the option on.

Default value:

MSK OFF

23.2.185 MSK IPAR WRITE IGNORE INCOMPATIBLE ITEMS

Corresponding constant:

MSK IPAR WRITE IGNORE INCOMPATIBLE ITEMS

Description:

Controls if the writer ignores incompatible problem items when writing files.

Possible values:

• MSK OFF Switch the option off.

• MSK ON Switch the option on.

Default value:

MSK OFF

Page 370: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

352 CHAPTER 23. PARAMETERS

23.2.186 MSK IPAR WRITE IGNORE INCOMPATIBLE NL ITEMS

Corresponding constant:

MSK IPAR WRITE IGNORE INCOMPATIBLE NL ITEMS

Description:

Controls if the writer ignores general non-linear terms or produces an error.

Possible values:

• MSK OFF Switch the option off.

• MSK ON Switch the option on.

Default value:

MSK OFF

23.2.187 MSK IPAR WRITE IGNORE INCOMPATIBLE PSD ITEMS

Corresponding constant:

MSK IPAR WRITE IGNORE INCOMPATIBLE PSD ITEMS

Description:

If the output format is not compatible with semidefinite problems this parameter controls if thewriter ignores the conic parts or produces an error.

Possible values:

• MSK OFF Switch the option off.

• MSK ON Switch the option on.

Default value:

MSK OFF

23.2.188 MSK IPAR WRITE INT CONSTRAINTS

Corresponding constant:

MSK IPAR WRITE INT CONSTRAINTS

Description:

Controls whether the constraint section is written to the integer solution file.

Possible values:

• MSK OFF Switch the option off.

• MSK ON Switch the option on.

Default value:

MSK ON

Page 371: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

23.2. MSKIPARAME: INTEGER PARAMETERS 353

23.2.189 MSK IPAR WRITE INT HEAD

Corresponding constant:

MSK IPAR WRITE INT HEAD

Description:

Controls whether the header section is written to the integer solution file.

Possible values:

• MSK OFF Switch the option off.

• MSK ON Switch the option on.

Default value:

MSK ON

23.2.190 MSK IPAR WRITE INT VARIABLES

Corresponding constant:

MSK IPAR WRITE INT VARIABLES

Description:

Controls whether the variables section is written to the integer solution file.

Possible values:

• MSK OFF Switch the option off.

• MSK ON Switch the option on.

Default value:

MSK ON

23.2.191 MSK IPAR WRITE LP LINE WIDTH

Corresponding constant:

MSK IPAR WRITE LP LINE WIDTH

Description:

Maximum width of line in an LP file written by MOSEK.

Possible Values:

Any positive number.

Default value:

80

Page 372: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

354 CHAPTER 23. PARAMETERS

23.2.192 MSK IPAR WRITE LP QUOTED NAMES

Corresponding constant:

MSK IPAR WRITE LP QUOTED NAMES

Description:

If this option is turned on, then MOSEK will quote invalid LP names when writing an LP file.

Possible values:

• MSK OFF Switch the option off.

• MSK ON Switch the option on.

Default value:

MSK ON

23.2.193 MSK IPAR WRITE LP STRICT FORMAT

Corresponding constant:

MSK IPAR WRITE LP STRICT FORMAT

Description:

Controls whether LP output files satisfy the LP format strictly.

Possible values:

• MSK OFF Switch the option off.

• MSK ON Switch the option on.

Default value:

MSK OFF

23.2.194 MSK IPAR WRITE LP TERMS PER LINE

Corresponding constant:

MSK IPAR WRITE LP TERMS PER LINE

Description:

Maximum number of terms on a single line in an LP file written by MOSEK. 0 means unlimited.

Possible Values:

Any number between 0 and +inf.

Default value:

10

Page 373: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

23.2. MSKIPARAME: INTEGER PARAMETERS 355

23.2.195 MSK IPAR WRITE MPS INT

Corresponding constant:

MSK IPAR WRITE MPS INT

Description:

Controls if marker records are written to the MPS file to indicate whether variables are integerrestricted.

Possible values:

• MSK OFF Switch the option off.

• MSK ON Switch the option on.

Default value:

MSK ON

23.2.196 MSK IPAR WRITE PRECISION

Corresponding constant:

MSK IPAR WRITE PRECISION

Description:

Controls the precision with which double numbers are printed in the MPS data file. In generalit is not worthwhile to use a value higher than 15.

Possible Values:

Any number between 0 and +inf.

Default value:

8

23.2.197 MSK IPAR WRITE SOL BARVARIABLES

Corresponding constant:

MSK IPAR WRITE SOL BARVARIABLES

Description:

Controls whether the symmetric matrix variables section is written to the solution file.

Possible values:

• MSK OFF Switch the option off.

• MSK ON Switch the option on.

Default value:

MSK ON

Page 374: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

356 CHAPTER 23. PARAMETERS

23.2.198 MSK IPAR WRITE SOL CONSTRAINTS

Corresponding constant:

MSK IPAR WRITE SOL CONSTRAINTS

Description:

Controls whether the constraint section is written to the solution file.

Possible values:

• MSK OFF Switch the option off.

• MSK ON Switch the option on.

Default value:

MSK ON

23.2.199 MSK IPAR WRITE SOL HEAD

Corresponding constant:

MSK IPAR WRITE SOL HEAD

Description:

Controls whether the header section is written to the solution file.

Possible values:

• MSK OFF Switch the option off.

• MSK ON Switch the option on.

Default value:

MSK ON

23.2.200 MSK IPAR WRITE SOL IGNORE INVALID NAMES

Corresponding constant:

MSK IPAR WRITE SOL IGNORE INVALID NAMES

Description:

Even if the names are invalid MPS names, then they are employed when writing the solution file.

Possible values:

• MSK OFF Switch the option off.

• MSK ON Switch the option on.

Default value:

MSK OFF

Page 375: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

23.2. MSKIPARAME: INTEGER PARAMETERS 357

23.2.201 MSK IPAR WRITE SOL VARIABLES

Corresponding constant:

MSK IPAR WRITE SOL VARIABLES

Description:

Controls whether the variables section is written to the solution file.

Possible values:

• MSK OFF Switch the option off.

• MSK ON Switch the option on.

Default value:

MSK ON

23.2.202 MSK IPAR WRITE TASK INC SOL

Corresponding constant:

MSK IPAR WRITE TASK INC SOL

Description:

Controls whether the solutions are stored in the task file too.

Possible values:

• MSK OFF Switch the option off.

• MSK ON Switch the option on.

Default value:

MSK ON

23.2.203 MSK IPAR WRITE XML MODE

Corresponding constant:

MSK IPAR WRITE XML MODE

Description:

Controls if linear coefficients should be written by row or column when writing in the XML fileformat.

Possible values:

• MSK WRITE XML MODE COL Write in column order.

• MSK WRITE XML MODE ROW Write in row order.

Default value:

MSK WRITE XML MODE ROW

Page 376: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

358 CHAPTER 23. PARAMETERS

23.3 MSKsparame: String parameter types

23.3.1 MSK SPAR BAS SOL FILE NAME

Corresponding constant:

MSK SPAR BAS SOL FILE NAME

Description:

Name of the bas solution file.

Possible Values:

Any valid file name.

Default value:

""

23.3.2 MSK SPAR DATA FILE NAME

Corresponding constant:

MSK SPAR DATA FILE NAME

Description:

Data are read and written to this file.

Possible Values:

Any valid file name.

Default value:

""

23.3.3 MSK SPAR DEBUG FILE NAME

Corresponding constant:

MSK SPAR DEBUG FILE NAME

Description:

MOSEK debug file.

Possible Values:

Any valid file name.

Default value:

""

Page 377: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

23.3. MSKSPARAME: STRING PARAMETER TYPES 359

23.3.4 MSK SPAR FEASREPAIR NAME PREFIX

Corresponding constant:

MSK SPAR FEASREPAIR NAME PREFIX

Description:

Not applicable.

Possible Values:

Any valid string.

Default value:

"MSK-"

23.3.5 MSK SPAR FEASREPAIR NAME SEPARATOR

Corresponding constant:

MSK SPAR FEASREPAIR NAME SEPARATOR

Description:

Not applicable.

Possible Values:

Any valid string.

Default value:

"-"

23.3.6 MSK SPAR FEASREPAIR NAME WSUMVIOL

Corresponding constant:

MSK SPAR FEASREPAIR NAME WSUMVIOL

Description:

The constraint and variable associated with the total weighted sum of violations are each giventhe name of this parameter postfixed with CON and VAR respectively.

Possible Values:

Any valid string.

Default value:

"WSUMVIOL"

Page 378: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

360 CHAPTER 23. PARAMETERS

23.3.7 MSK SPAR INT SOL FILE NAME

Corresponding constant:

MSK SPAR INT SOL FILE NAME

Description:

Name of the int solution file.

Possible Values:

Any valid file name.

Default value:

""

23.3.8 MSK SPAR ITR SOL FILE NAME

Corresponding constant:

MSK SPAR ITR SOL FILE NAME

Description:

Name of the itr solution file.

Possible Values:

Any valid file name.

Default value:

""

23.3.9 MSK SPAR MIO DEBUG STRING

Corresponding constant:

MSK SPAR MIO DEBUG STRING

Description:

For internal use only.

Possible Values:

Any valid string.

Default value:

""

Page 379: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

23.3. MSKSPARAME: STRING PARAMETER TYPES 361

23.3.10 MSK SPAR PARAM COMMENT SIGN

Corresponding constant:

MSK SPAR PARAM COMMENT SIGN

Description:

Only the first character in this string is used. It is considered as a start of comment sign in theMOSEK parameter file. Spaces are ignored in the string.

Possible Values:

Any valid string.

Default value:

"%%"

23.3.11 MSK SPAR PARAM READ FILE NAME

Corresponding constant:

MSK SPAR PARAM READ FILE NAME

Description:

Modifications to the parameter database is read from this file.

Possible Values:

Any valid file name.

Default value:

""

23.3.12 MSK SPAR PARAM WRITE FILE NAME

Corresponding constant:

MSK SPAR PARAM WRITE FILE NAME

Description:

The parameter database is written to this file.

Possible Values:

Any valid file name.

Default value:

""

Page 380: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

362 CHAPTER 23. PARAMETERS

23.3.13 MSK SPAR READ MPS BOU NAME

Corresponding constant:

MSK SPAR READ MPS BOU NAME

Description:

Name of the BOUNDS vector used. An empty name means that the first BOUNDS vector isused.

Possible Values:

Any valid MPS name.

Default value:

""

23.3.14 MSK SPAR READ MPS OBJ NAME

Corresponding constant:

MSK SPAR READ MPS OBJ NAME

Description:

Name of the free constraint used as objective function. An empty name means that the firstconstraint is used as objective function.

Possible Values:

Any valid MPS name.

Default value:

""

23.3.15 MSK SPAR READ MPS RAN NAME

Corresponding constant:

MSK SPAR READ MPS RAN NAME

Description:

Name of the RANGE vector used. An empty name means that the first RANGE vector is used.

Possible Values:

Any valid MPS name.

Default value:

""

Page 381: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

23.3. MSKSPARAME: STRING PARAMETER TYPES 363

23.3.16 MSK SPAR READ MPS RHS NAME

Corresponding constant:

MSK SPAR READ MPS RHS NAME

Description:

Name of the RHS used. An empty name means that the first RHS vector is used.

Possible Values:

Any valid MPS name.

Default value:

""

23.3.17 MSK SPAR SENSITIVITY FILE NAME

Corresponding constant:

MSK SPAR SENSITIVITY FILE NAME

Description:

Not applicable.

Possible Values:

Any valid string.

Default value:

""

23.3.18 MSK SPAR SENSITIVITY RES FILE NAME

Corresponding constant:

MSK SPAR SENSITIVITY RES FILE NAME

Description:

Not applicable.

Possible Values:

Any valid string.

Default value:

""

Page 382: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

364 CHAPTER 23. PARAMETERS

23.3.19 MSK SPAR SOL FILTER XC LOW

Corresponding constant:

MSK SPAR SOL FILTER XC LOW

Description:

A filter used to determine which constraints should be listed in the solution file. A value of ”0.5”means that all constraints having xc[i]>0.5 should be listed, whereas ”+0.5” means that allconstraints having xc[i]>=blc[i]+0.5 should be listed. An empty filter means that no filter isapplied.

Possible Values:

Any valid filter.

Default value:

""

23.3.20 MSK SPAR SOL FILTER XC UPR

Corresponding constant:

MSK SPAR SOL FILTER XC UPR

Description:

A filter used to determine which constraints should be listed in the solution file. A value of”0.5” means that all constraints having xc[i]<0.5 should be listed, whereas ”-0.5” means allconstraints having xc[i]<=buc[i]-0.5 should be listed. An empty filter means that no filter isapplied.

Possible Values:

Any valid filter.

Default value:

""

23.3.21 MSK SPAR SOL FILTER XX LOW

Corresponding constant:

MSK SPAR SOL FILTER XX LOW

Description:

A filter used to determine which variables should be listed in the solution file. A value of ”0.5”means that all constraints having xx[j]>=0.5 should be listed, whereas ”+0.5” means thatall constraints having xx[j]>=blx[j]+0.5 should be listed. An empty filter means no filter isapplied.

Page 383: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

23.3. MSKSPARAME: STRING PARAMETER TYPES 365

Possible Values:

Any valid filter.

Default value:

""

23.3.22 MSK SPAR SOL FILTER XX UPR

Corresponding constant:

MSK SPAR SOL FILTER XX UPR

Description:

A filter used to determine which variables should be listed in the solution file. A value of”0.5” means that all constraints having xx[j]<0.5 should be printed, whereas ”-0.5” meansall constraints having xx[j]<=bux[j]-0.5 should be listed. An empty filter means no filter isapplied.

Possible Values:

Any valid file name.

Default value:

""

23.3.23 MSK SPAR STAT FILE NAME

Corresponding constant:

MSK SPAR STAT FILE NAME

Description:

Statistics file name.

Possible Values:

Any valid file name.

Default value:

""

23.3.24 MSK SPAR STAT KEY

Corresponding constant:

MSK SPAR STAT KEY

Description:

Key used when writing the summary file.

Page 384: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

366 CHAPTER 23. PARAMETERS

Possible Values:

Any valid XML string.

Default value:

""

23.3.25 MSK SPAR STAT NAME

Corresponding constant:

MSK SPAR STAT NAME

Description:

Name used when writing the statistics file.

Possible Values:

Any valid XML string.

Default value:

""

23.3.26 MSK SPAR WRITE LP GEN VAR NAME

Corresponding constant:

MSK SPAR WRITE LP GEN VAR NAME

Description:

Sometimes when an LP file is written additional variables must be inserted. They will have theprefix denoted by this parameter.

Possible Values:

Any valid string.

Default value:

"xmskgen"

Page 385: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

Chapter 24

Response codes

Response codes ordered by name.

MSK RES ERR AD INVALID CODELIST

The code list data was invalid.

MSK RES ERR AD INVALID OPERAND

The code list data was invalid. An unknown operand was used.

MSK RES ERR AD INVALID OPERATOR

The code list data was invalid. An unknown operator was used.

MSK RES ERR AD MISSING OPERAND

The code list data was invalid. Missing operand for operator.

MSK RES ERR AD MISSING RETURN

The code list data was invalid. Missing return operation in function.

MSK RES ERR API ARRAY TOO SMALL

An input array was too short.

MSK RES ERR API CB CONNECT

Failed to connect a callback object.

MSK RES ERR API FATAL ERROR

An internal error occurred in the API. Please report this problem.

MSK RES ERR API INTERNAL

An internal fatal error occurred in an interface function.

MSK RES ERR ARG IS TOO LARGE

The value of a argument is too small.

367

Page 386: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

368 CHAPTER 24. RESPONSE CODES

MSK RES ERR ARG IS TOO SMALL

The value of a argument is too small.

MSK RES ERR ARGUMENT DIMENSION

A function argument is of incorrect dimension.

MSK RES ERR ARGUMENT IS TOO LARGE

The value of a function argument is too large.

MSK RES ERR ARGUMENT LENNEQ

Incorrect length of arguments.

MSK RES ERR ARGUMENT PERM ARRAY

An invalid permutation array is specified.

MSK RES ERR ARGUMENT TYPE

Incorrect argument type.

MSK RES ERR BAR VAR DIM

The dimension of a symmetric matrix variable has to greater than 0.

MSK RES ERR BASIS

An invalid basis is specified. Either too many or too few basis variables are specified.

MSK RES ERR BASIS FACTOR

The factorization of the basis is invalid.

MSK RES ERR BASIS SINGULAR

The basis is singular and hence cannot be factored.

MSK RES ERR BLANK NAME

An all blank name has been specified.

MSK RES ERR CANNOT CLONE NL

A task with a nonlinear function call-back cannot be cloned.

MSK RES ERR CANNOT HANDLE NL

A function cannot handle a task with nonlinear function call-backs.

MSK RES ERR CON Q NOT NSD

The quadratic constraint matrix is not negative semidefinite as expected for a constraint with fi-nite lower bound. This results in a nonconvex problem. The parameter MSK DPAR CHECK CONVEXITY REL TOL

can be used to relax the convexity check.

Page 387: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

369

MSK RES ERR CON Q NOT PSD

The quadratic constraint matrix is not positive semidefinite as expected for a constraint with fi-nite upper bound. This results in a nonconvex problem. The parameter MSK DPAR CHECK CONVEXITY REL TOL

can be used to relax the convexity check.

MSK RES ERR CONCURRENT OPTIMIZER

An unsupported optimizer was chosen for use with the concurrent optimizer.

MSK RES ERR CONE INDEX

An index of a non-existing cone has been specified.

MSK RES ERR CONE OVERLAP

A new cone which variables overlap with an existing cone has been specified.

MSK RES ERR CONE OVERLAP APPEND

The cone to be appended has one variable which is already memeber of another cone.

MSK RES ERR CONE REP VAR

A variable is included multiple times in the cone.

MSK RES ERR CONE SIZE

A cone with too few members is specified.

MSK RES ERR CONE TYPE

Invalid cone type specified.

MSK RES ERR CONE TYPE STR

Invalid cone type specified.

MSK RES ERR DATA FILE EXT

The data file format cannot be determined from the file name.

MSK RES ERR DUP NAME

The same name was used multiple times for the same problem item type.

MSK RES ERR DUPLICATE BARVARIABLE NAMES

Two barvariable names are identical.

MSK RES ERR DUPLICATE CONE NAMES

Two cone names are identical.

MSK RES ERR DUPLICATE CONSTRAINT NAMES

Two constraint names are identical.

MSK RES ERR DUPLICATE VARIABLE NAMES

Two variable names are identical.

Page 388: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

370 CHAPTER 24. RESPONSE CODES

MSK RES ERR END OF FILE

End of file reached.

MSK RES ERR FACTOR

An error occurred while factorizing a matrix.

MSK RES ERR FEASREPAIR CANNOT RELAX

An optimization problem cannot be relaxed. This is the case e.g. for general nonlinear optimiza-tion problems.

MSK RES ERR FEASREPAIR INCONSISTENT BOUND

The upper bound is less than the lower bound for a variable or a constraint. Please correct thisbefore running the feasibility repair.

MSK RES ERR FEASREPAIR SOLVING RELAXED

The relaxed problem could not be solved to optimality. Please consult the log file for furtherdetails.

MSK RES ERR FILE LICENSE

Invalid license file.

MSK RES ERR FILE OPEN

Error while opening a file.

MSK RES ERR FILE READ

File read error.

MSK RES ERR FILE WRITE

File write error.

MSK RES ERR FIRST

Invalid first.

MSK RES ERR FIRSTI

Invalid firsti.

MSK RES ERR FIRSTJ

Invalid firstj.

MSK RES ERR FIXED BOUND VALUES

A fixed constraint/variable has been specified using the bound keys but the numerical value ofthe lower and upper bound is different.

MSK RES ERR FLEXLM

The FLEXlm license manager reported an error.

Page 389: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

371

MSK RES ERR GLOBAL INV CONIC PROBLEM

The global optimizer can only be applied to problems without semidefinite variables.

MSK RES ERR HUGE AIJ

A numerically huge value is specified for an ai,j element inA. The parameter MSK DPAR DATA TOL AIJ HUGE

controls when an ai,j is considered huge.

MSK RES ERR HUGE C

A huge value in absolute size is specified for one cj .

MSK RES ERR IDENTICAL TASKS

Some tasks related to this function call were identical. Unique tasks were expected.

MSK RES ERR IN ARGUMENT

A function argument is incorrect.

MSK RES ERR INDEX

An index is out of range.

MSK RES ERR INDEX ARR IS TOO LARGE

An index in an array argument is too large.

MSK RES ERR INDEX ARR IS TOO SMALL

An index in an array argument is too small.

MSK RES ERR INDEX IS TOO LARGE

An index in an argument is too large.

MSK RES ERR INDEX IS TOO SMALL

An index in an argument is too small.

MSK RES ERR INF DOU INDEX

A double information index is out of range for the specified type.

MSK RES ERR INF DOU NAME

A double information name is invalid.

MSK RES ERR INF INT INDEX

An integer information index is out of range for the specified type.

MSK RES ERR INF INT NAME

An integer information name is invalid.

MSK RES ERR INF LINT INDEX

A long integer information index is out of range for the specified type.

Page 390: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

372 CHAPTER 24. RESPONSE CODES

MSK RES ERR INF LINT NAME

A long integer information name is invalid.

MSK RES ERR INF TYPE

The information type is invalid.

MSK RES ERR INFEAS UNDEFINED

The requested value is not defined for this solution type.

MSK RES ERR INFINITE BOUND

A numerically huge bound value is specified.

MSK RES ERR INT64 TO INT32 CAST

An 32 bit integer could not cast to a 64 bit integer.

MSK RES ERR INTERNAL

An internal error occurred. Please report this problem.

MSK RES ERR INTERNAL TEST FAILED

An internal unit test function failed.

MSK RES ERR INV APTRE

aptre[j] is strictly smaller than aptrb[j] for some j.

MSK RES ERR INV BK

Invalid bound key.

MSK RES ERR INV BKC

Invalid bound key is specified for a constraint.

MSK RES ERR INV BKX

An invalid bound key is specified for a variable.

MSK RES ERR INV CONE TYPE

Invalid cone type code is encountered.

MSK RES ERR INV CONE TYPE STR

Invalid cone type string encountered.

MSK RES ERR INV CONIC PROBLEM

The conic optimizer can only be applied to problems with linear objective and constraints.Many problems such convex quadratically constrained problems can easily be reformulated toconic problems. See the appropriate MOSEK manual for details.

MSK RES ERR INV MARKI

Invalid value in marki.

Page 391: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

373

MSK RES ERR INV MARKJ

Invalid value in markj.

MSK RES ERR INV NAME ITEM

An invalid name item code is used.

MSK RES ERR INV NUMI

Invalid numi.

MSK RES ERR INV NUMJ

Invalid numj.

MSK RES ERR INV OPTIMIZER

An invalid optimizer has been chosen for the problem. This means that the simplex or the conicoptimizer is chosen to optimize a nonlinear problem.

MSK RES ERR INV PROBLEM

Invalid problem type. Probably a nonconvex problem has been specified.

MSK RES ERR INV QCON SUBI

Invalid value in qcsubi.

MSK RES ERR INV QCON SUBJ

Invalid value in qcsubj.

MSK RES ERR INV QCON SUBK

Invalid value in qcsubk.

MSK RES ERR INV QCON VAL

Invalid value in qcval.

MSK RES ERR INV QOBJ SUBI

Invalid value in qosubi.

MSK RES ERR INV QOBJ SUBJ

Invalid value in qosubj.

MSK RES ERR INV QOBJ VAL

Invalid value in qoval.

MSK RES ERR INV SK

Invalid status key code.

MSK RES ERR INV SK STR

Invalid status key string encountered.

Page 392: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

374 CHAPTER 24. RESPONSE CODES

MSK RES ERR INV SKC

Invalid value in skc.

MSK RES ERR INV SKN

Invalid value in skn.

MSK RES ERR INV SKX

Invalid value in skx.

MSK RES ERR INV VAR TYPE

An invalid variable type is specified for a variable.

MSK RES ERR INVALID ACCMODE

An invalid access mode is specified.

MSK RES ERR INVALID AMPL STUB

Invalid AMPL stub.

MSK RES ERR INVALID BARVAR NAME

An invalid symmetric matrix variable name is used.

MSK RES ERR INVALID BRANCH DIRECTION

An invalid branching direction is specified.

MSK RES ERR INVALID BRANCH PRIORITY

An invalid branching priority is specified. It should be nonnegative.

MSK RES ERR INVALID COMPRESSION

Invalid compression type.

MSK RES ERR INVALID CON NAME

An invalid constraint name is used.

MSK RES ERR INVALID CONE NAME

An invalid cone name is used.

MSK RES ERR INVALID FILE FORMAT FOR CONES

The file format does not support a problem with conic constraints.

MSK RES ERR INVALID FILE FORMAT FOR GENERAL NL

The file format does not support a problem with general nonlinear terms.

MSK RES ERR INVALID FILE FORMAT FOR SYM MAT

The file format does not support a problem with symmetric matrix variables.

MSK RES ERR INVALID FILE NAME

An invalid file name has been specified.

Page 393: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

375

MSK RES ERR INVALID FORMAT TYPE

Invalid format type.

MSK RES ERR INVALID IDX

A specified index is invalid.

MSK RES ERR INVALID IOMODE

Invalid io mode.

MSK RES ERR INVALID MAX NUM

A specified index is invalid.

MSK RES ERR INVALID NAME IN SOL FILE

An invalid name occurred in a solution file.

MSK RES ERR INVALID NETWORK PROBLEM

The problem is not a network problem as expected. The error occurs if a network optimizer isapplied to a problem that cannot (easily) be converted to a network problem.

MSK RES ERR INVALID OBJ NAME

An invalid objective name is specified.

MSK RES ERR INVALID OBJECTIVE SENSE

An invalid objective sense is specified.

MSK RES ERR INVALID PROBLEM TYPE

An invalid problem type.

MSK RES ERR INVALID SOL FILE NAME

An invalid file name has been specified.

MSK RES ERR INVALID STREAM

An invalid stream is referenced.

MSK RES ERR INVALID SURPLUS

Invalid surplus.

MSK RES ERR INVALID SYM MAT DIM

A sparse symmetric matrix of invalid dimension is specified.

MSK RES ERR INVALID TASK

The task is invalid.

MSK RES ERR INVALID UTF8

An invalid UTF8 string is encountered.

Page 394: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

376 CHAPTER 24. RESPONSE CODES

MSK RES ERR INVALID VAR NAME

An invalid variable name is used.

MSK RES ERR INVALID WCHAR

An invalid wchar string is encountered.

MSK RES ERR INVALID WHICHSOL

whichsol is invalid.

MSK RES ERR LAST

Invalid index last. A given index was out of expected range.

MSK RES ERR LASTI

Invalid lasti.

MSK RES ERR LASTJ

Invalid lastj.

MSK RES ERR LICENSE

Invalid license.

MSK RES ERR LICENSE CANNOT ALLOCATE

The license system cannot allocate the memory required.

MSK RES ERR LICENSE CANNOT CONNECT

MOSEK cannot connect to the license server. Most likely the license server is not up and running.

MSK RES ERR LICENSE EXPIRED

The license has expired.

MSK RES ERR LICENSE FEATURE

A requested feature is not available in the license file(s). Most likely due to an incorrect licensesystem setup.

MSK RES ERR LICENSE INVALID HOSTID

The host ID specified in the license file does not match the host ID of the computer.

MSK RES ERR LICENSE MAX

Maximum number of licenses is reached.

MSK RES ERR LICENSE MOSEKLM DAEMON

The MOSEKLM license manager daemon is not up and running.

MSK RES ERR LICENSE NO SERVER LINE

There is no SERVER line in the license file. All non-zero license count features need at least oneSERVER line.

Page 395: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

377

MSK RES ERR LICENSE NO SERVER SUPPORT

The license server does not support the requested feature. Possible reasons for this error include:

• The feature has expired.

• The feature’s start date is later than today’s date.

• The version requested is higher than feature’s the highest supported version.

• A corrupted license file.

Try restarting the license and inspect the license server debug file, usually called lmgrd.log.

MSK RES ERR LICENSE SERVER

The license server is not responding.

MSK RES ERR LICENSE SERVER VERSION

The version specified in the checkout request is greater than the highest version number thedaemon supports.

MSK RES ERR LICENSE VERSION

The license is valid for another version of MOSEK.

MSK RES ERR LINK FILE DLL

A file cannot be linked to a stream in the DLL version.

MSK RES ERR LIVING TASKS

All tasks associated with an enviroment must be deleted before the environment is deleted. Thereare still some undeleted tasks.

MSK RES ERR LOWER BOUND IS A NAN

The lower bound specificied is not a number (nan).

MSK RES ERR LP DUP SLACK NAME

The name of the slack variable added to a ranged constraint already exists.

MSK RES ERR LP EMPTY

The problem cannot be written to an LP formatted file.

MSK RES ERR LP FILE FORMAT

Syntax error in an LP file.

MSK RES ERR LP FORMAT

Syntax error in an LP file.

MSK RES ERR LP FREE CONSTRAINT

Free constraints cannot be written in LP file format.

MSK RES ERR LP INCOMPATIBLE

The problem cannot be written to an LP formatted file.

Page 396: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

378 CHAPTER 24. RESPONSE CODES

MSK RES ERR LP INVALID CON NAME

A constraint name is invalid when used in an LP formatted file.

MSK RES ERR LP INVALID VAR NAME

A variable name is invalid when used in an LP formatted file.

MSK RES ERR LP WRITE CONIC PROBLEM

The problem contains cones that cannot be written to an LP formatted file.

MSK RES ERR LP WRITE GECO PROBLEM

The problem contains general convex terms that cannot be written to an LP formatted file.

MSK RES ERR LU MAX NUM TRIES

Could not compute the LU factors of the matrix within the maximum number of allowed tries.

MSK RES ERR MAX LEN IS TOO SMALL

An maximum length that is too small has been specfified.

MSK RES ERR MAXNUMBARVAR

The maximum number of semidefinite variables specified is smaller than the number of semidef-inite variables in the task.

MSK RES ERR MAXNUMCON

The maximum number of constraints specified is smaller than the number of constraints in thetask.

MSK RES ERR MAXNUMCONE

The value specified for maxnumcone is too small.

MSK RES ERR MAXNUMQNZ

The maximum number of non-zeros specified for the Q matrixes is smaller than the number ofnon-zeros in the current Q matrixes.

MSK RES ERR MAXNUMVAR

The maximum number of variables specified is smaller than the number of variables in the task.

MSK RES ERR MBT INCOMPATIBLE

The MBT file is incompatible with this platform. This results from reading a file on a 32 bitplatform generated on a 64 bit platform.

MSK RES ERR MBT INVALID

The MBT file is invalid.

MSK RES ERR MIO INTERNAL

A fatal error occurred in the mixed integer optimizer. Please contact MOSEK support.

Page 397: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

379

MSK RES ERR MIO NO OPTIMIZER

No optimizer is available for the current class of integer optimization problems.

MSK RES ERR MIO NOT LOADED

The mixed-integer optimizer is not loaded.

MSK RES ERR MISSING LICENSE FILE

MOSEK cannot license file or a token server. See the MOSEK installation manual for details.

MSK RES ERR MIXED PROBLEM

The problem contains both conic and nonlinear constraints.

MSK RES ERR MPS CONE OVERLAP

A variable is specified to be a member of several cones.

MSK RES ERR MPS CONE REPEAT

A variable is repeated within the CSECTION.

MSK RES ERR MPS CONE TYPE

Invalid cone type specified in a CSECTION.

MSK RES ERR MPS FILE

An error occurred while reading an MPS file.

MSK RES ERR MPS INV BOUND KEY

An invalid bound key occurred in an MPS file.

MSK RES ERR MPS INV CON KEY

An invalid constraint key occurred in an MPS file.

MSK RES ERR MPS INV FIELD

A field in the MPS file is invalid. Probably it is too wide.

MSK RES ERR MPS INV MARKER

An invalid marker has been specified in the MPS file.

MSK RES ERR MPS INV SEC NAME

An invalid section name occurred in an MPS file.

MSK RES ERR MPS INV SEC ORDER

The sections in the MPS data file are not in the correct order.

MSK RES ERR MPS INVALID OBJ NAME

An invalid objective name is specified.

MSK RES ERR MPS INVALID OBJSENSE

An invalid objective sense is specified.

Page 398: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

380 CHAPTER 24. RESPONSE CODES

MSK RES ERR MPS MUL CON NAME

A constraint name was specified multiple times in the ROWS section.

MSK RES ERR MPS MUL CSEC

Multiple CSECTIONs are given the same name.

MSK RES ERR MPS MUL QOBJ

The Q term in the objective is specified multiple times in the MPS data file.

MSK RES ERR MPS MUL QSEC

Multiple QSECTIONs are specified for a constraint in the MPS data file.

MSK RES ERR MPS NO OBJECTIVE

No objective is defined in an MPS file.

MSK RES ERR MPS NULL CON NAME

An empty constraint name is used in an MPS file.

MSK RES ERR MPS NULL VAR NAME

An empty variable name is used in an MPS file.

MSK RES ERR MPS SPLITTED VAR

All elements in a column of the A matrix must be specified consecutively. Hence, it is illegal tospecify non-zero elements in A for variable 1, then for variable 2 and then variable 1 again.

MSK RES ERR MPS TAB IN FIELD2

A tab char occurred in field 2.

MSK RES ERR MPS TAB IN FIELD3

A tab char occurred in field 3.

MSK RES ERR MPS TAB IN FIELD5

A tab char occurred in field 5.

MSK RES ERR MPS UNDEF CON NAME

An undefined constraint name occurred in an MPS file.

MSK RES ERR MPS UNDEF VAR NAME

An undefined variable name occurred in an MPS file.

MSK RES ERR MUL A ELEMENT

An element in A is defined multiple times.

MSK RES ERR NAME IS NULL

The name buffer is a NULL pointer.

Page 399: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

381

MSK RES ERR NAME MAX LEN

A name is longer than the buffer that is supposed to hold it.

MSK RES ERR NAN IN AIJ

ai,j contains an invalid floating point value, i.e. a NaN.

MSK RES ERR NAN IN BLC

lc contains an invalid floating point value, i.e. a NaN.

MSK RES ERR NAN IN BLX

lx contains an invalid floating point value, i.e. a NaN.

MSK RES ERR NAN IN BUC

uc contains an invalid floating point value, i.e. a NaN.

MSK RES ERR NAN IN BUX

ux contains an invalid floating point value, i.e. a NaN.

MSK RES ERR NAN IN C

c contains an invalid floating point value, i.e. a NaN.

MSK RES ERR NAN IN DOUBLE DATA

An invalid floating point value was used in some double data.

MSK RES ERR NEGATIVE APPEND

Cannot append a negative number.

MSK RES ERR NEGATIVE SURPLUS

Negative surplus.

MSK RES ERR NEWER DLL

The dynamic link library is newer than the specified version.

MSK RES ERR NO BARS FOR SOLUTION

There is no s available for the solution specified. In particular note there are no s defined for thebasic and integer solutions.

MSK RES ERR NO BARX FOR SOLUTION

There is no X available for the solution specified. In particular note there are no X defined forthe basic and integer solutions.

MSK RES ERR NO BASIS SOL

No basic solution is defined.

MSK RES ERR NO DUAL FOR ITG SOL

No dual information is available for the integer solution.

Page 400: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

382 CHAPTER 24. RESPONSE CODES

MSK RES ERR NO DUAL INFEAS CER

A certificate of infeasibility is not available.

MSK RES ERR NO DUAL INFO FOR ITG SOL

Dual information is not available for the integer solution.

MSK RES ERR NO INIT ENV

env is not initialized.

MSK RES ERR NO OPTIMIZER VAR TYPE

No optimizer is available for this class of optimization problems.

MSK RES ERR NO PRIMAL INFEAS CER

A certificate of primal infeasibility is not available.

MSK RES ERR NO SNX FOR BAS SOL

sxn is not available for the basis solution.

MSK RES ERR NO SOLUTION IN CALLBACK

The required solution is not available.

MSK RES ERR NON UNIQUE ARRAY

An array does not contain unique elements.

MSK RES ERR NONCONVEX

The optimization problem is nonconvex.

MSK RES ERR NONLINEAR EQUALITY

The model contains a nonlinear equality which defines a nonconvex set.

MSK RES ERR NONLINEAR FUNCTIONS NOT ALLOWED

An operation that is invalid for problems with nonlinear functions defined has been attempted.

MSK RES ERR NONLINEAR RANGED

The model contains a nonlinear ranged constraint which by definition defines a nonconvex set.

MSK RES ERR NR ARGUMENTS

Incorrect number of function arguments.

MSK RES ERR NULL ENV

env is a NULL pointer.

MSK RES ERR NULL POINTER

An argument to a function is unexpectedly a NULL pointer.

MSK RES ERR NULL TASK

task is a NULL pointer.

Page 401: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

383

MSK RES ERR NUMCONLIM

Maximum number of constraints limit is exceeded.

MSK RES ERR NUMVARLIM

Maximum number of variables limit is exceeded.

MSK RES ERR OBJ Q NOT NSD

The quadratic coefficient matrix in the objective is not negative semidefinite as expected fora maximization problem. The parameter MSK DPAR CHECK CONVEXITY REL TOL can be used torelax the convexity check.

MSK RES ERR OBJ Q NOT PSD

The quadratic coefficient matrix in the objective is not positive semidefinite as expected for aminimization problem. The parameter MSK DPAR CHECK CONVEXITY REL TOL can be used to relaxthe convexity check.

MSK RES ERR OBJECTIVE RANGE

Empty objective range.

MSK RES ERR OLDER DLL

The dynamic link library is older than the specified version.

MSK RES ERR OPEN DL

A dynamic link library could not be opened.

MSK RES ERR OPF FORMAT

Syntax error in an OPF file

MSK RES ERR OPF NEW VARIABLE

Introducing new variables is now allowed. When a [variables] section is present, it is notallowed to introduce new variables later in the problem.

MSK RES ERR OPF PREMATURE EOF

Premature end of file in an OPF file.

MSK RES ERR OPTIMIZER LICENSE

The optimizer required is not licensed.

MSK RES ERR ORD INVALID

Invalid content in branch ordering file.

MSK RES ERR ORD INVALID BRANCH DIR

An invalid branch direction key is specified.

MSK RES ERR OVERFLOW

A computation produced an overflow i.e. a very large number.

Page 402: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

384 CHAPTER 24. RESPONSE CODES

MSK RES ERR PARAM INDEX

Parameter index is out of range.

MSK RES ERR PARAM IS TOO LARGE

The parameter value is too large.

MSK RES ERR PARAM IS TOO SMALL

The parameter value is too small.

MSK RES ERR PARAM NAME

The parameter name is not correct.

MSK RES ERR PARAM NAME DOU

The parameter name is not correct for a double parameter.

MSK RES ERR PARAM NAME INT

The parameter name is not correct for an integer parameter.

MSK RES ERR PARAM NAME STR

The parameter name is not correct for a string parameter.

MSK RES ERR PARAM TYPE

The parameter type is invalid.

MSK RES ERR PARAM VALUE STR

The parameter value string is incorrect.

MSK RES ERR PLATFORM NOT LICENSED

A requested license feature is not available for the required platform.

MSK RES ERR POSTSOLVE

An error occurred during the postsolve. Please contact MOSEK support.

MSK RES ERR PRO ITEM

An invalid problem is used.

MSK RES ERR PROB LICENSE

The software is not licensed to solve the problem.

MSK RES ERR QCON SUBI TOO LARGE

Invalid value in qcsubi.

MSK RES ERR QCON SUBI TOO SMALL

Invalid value in qcsubi.

Page 403: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

385

MSK RES ERR QCON UPPER TRIANGLE

An element in the upper triangle of a Qk is specified. Only elements in the lower triangle shouldbe specified.

MSK RES ERR QOBJ UPPER TRIANGLE

An element in the upper triangle of Qo is specified. Only elements in the lower triangle shouldbe specified.

MSK RES ERR READ FORMAT

The specified format cannot be read.

MSK RES ERR READ LP MISSING END TAG

Missing End tag in LP file.

MSK RES ERR READ LP NONEXISTING NAME

A variable never occurred in objective or constraints.

MSK RES ERR REMOVE CONE VARIABLE

A variable cannot be removed because it will make a cone invalid.

MSK RES ERR REPAIR INVALID PROBLEM

The feasibility repair does not support the specified problem type.

MSK RES ERR REPAIR OPTIMIZATION FAILED

Computation the optimal relaxation failed. The cause may have been numerical problems.

MSK RES ERR SEN BOUND INVALID LO

Analysis of lower bound requested for an index, where no lower bound exists.

MSK RES ERR SEN BOUND INVALID UP

Analysis of upper bound requested for an index, where no upper bound exists.

MSK RES ERR SEN FORMAT

Syntax error in sensitivity analysis file.

MSK RES ERR SEN INDEX INVALID

Invalid range given in the sensitivity file.

MSK RES ERR SEN INDEX RANGE

Index out of range in the sensitivity analysis file.

MSK RES ERR SEN INVALID REGEXP

Syntax error in regexp or regexp longer than 1024.

MSK RES ERR SEN NUMERICAL

Numerical difficulties encountered performing the sensitivity analysis.

Page 404: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

386 CHAPTER 24. RESPONSE CODES

MSK RES ERR SEN SOLUTION STATUS

No optimal solution found to the original problem given for sensitivity analysis.

MSK RES ERR SEN UNDEF NAME

An undefined name was encountered in the sensitivity analysis file.

MSK RES ERR SEN UNHANDLED PROBLEM TYPE

Sensitivity analysis cannot be performed for the spcified problem. Sensitivity analysis is onlypossible for linear problems.

MSK RES ERR SIZE LICENSE

The problem is bigger than the license.

MSK RES ERR SIZE LICENSE CON

The problem has too many constraints to be solved with the available license.

MSK RES ERR SIZE LICENSE INTVAR

The problem contains too many integer variables to be solved with the available license.

MSK RES ERR SIZE LICENSE NUMCORES

The computer contains more cpu cores than the license allows for.

MSK RES ERR SIZE LICENSE VAR

The problem has too many variables to be solved with the available license.

MSK RES ERR SOL FILE INVALID NUMBER

An invalid number is specified in a solution file.

MSK RES ERR SOLITEM

The solution item number solitem is invalid. Please note that MSK SOL ITEM SNX is invalid forthe basic solution.

MSK RES ERR SOLVER PROBTYPE

Problem type does not match the chosen optimizer.

MSK RES ERR SPACE

Out of space.

MSK RES ERR SPACE LEAKING

MOSEK is leaking memory. This can be due to either an incorrect use of MOSEK or a bug.

MSK RES ERR SPACE NO INFO

No available information about the space usage.

MSK RES ERR SYM MAT DUPLICATE

A value in a symmetric matric as been specified more than once.

Page 405: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

387

MSK RES ERR SYM MAT INVALID COL INDEX

A column index specified for sparse symmetric maxtrix is invalid.

MSK RES ERR SYM MAT INVALID ROW INDEX

A row index specified for sparse symmetric maxtrix is invalid.

MSK RES ERR SYM MAT INVALID VALUE

The numerical value specified in a sparse symmetric matrix is not a value floating value.

MSK RES ERR SYM MAT NOT LOWER TRINGULAR

Only the lower triangular part of sparse symmetric matrix should be specified.

MSK RES ERR TASK INCOMPATIBLE

The Task file is incompatible with this platform. This results from reading a file on a 32 bitplatform generated on a 64 bit platform.

MSK RES ERR TASK INVALID

The Task file is invalid.

MSK RES ERR THREAD COND INIT

Could not initialize a condition.

MSK RES ERR THREAD CREATE

Could not create a thread. This error may occur if a large number of environments are createdand not deleted again. In any case it is a good practice to minimize the number of environmentscreated.

MSK RES ERR THREAD MUTEX INIT

Could not initialize a mutex.

MSK RES ERR THREAD MUTEX LOCK

Could not lock a mutex.

MSK RES ERR THREAD MUTEX UNLOCK

Could not unlock a mutex.

MSK RES ERR TOO MANY CONCURRENT TASKS

Too many concurrent tasks specified.

MSK RES ERR TOO SMALL MAX NUM NZ

The maximum number of non-zeros specified is too small.

MSK RES ERR TOO SMALL MAXNUMANZ

The maximum number of non-zeros specified for A is smaller than the number of non-zeros inthe current A.

Page 406: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

388 CHAPTER 24. RESPONSE CODES

MSK RES ERR UNB STEP SIZE

A step size in an optimizer was unexpectedly unbounded. For instance, if the step-size becomesunbounded in phase 1 of the simplex algorithm then an error occurs. Normally this will happenonly if the problem is badly formulated. Please contact MOSEK support if this error occurs.

MSK RES ERR UNDEF SOLUTION

MOSEK has the following solution types:

• an interior-point solution,

• an basic solution,

• and an integer solution.

Each optimizer may set one or more of these solutions; e.g by default a successful optimizationwith the interior-point optimizer defines the interior-point solution, and, for linear problems,also the basic solution. This error occurs when asking for a solution or for information about asolution that is not defined.

MSK RES ERR UNDEFINED OBJECTIVE SENSE

The objective sense has not been specified before the optimization.

MSK RES ERR UNHANDLED SOLUTION STATUS

Unhandled solution status.

MSK RES ERR UNKNOWN

Unknown error.

MSK RES ERR UPPER BOUND IS A NAN

The upper bound specificied is not a number (nan).

MSK RES ERR UPPER TRIANGLE

An element in the upper triangle of a lower triangular matrix is specified.

MSK RES ERR USER FUNC RET

An user function reported an error.

MSK RES ERR USER FUNC RET DATA

An user function returned invalid data.

MSK RES ERR USER NLO EVAL

The user-defined nonlinear function reported an error.

MSK RES ERR USER NLO EVAL HESSUBI

The user-defined nonlinear function reported an invalid subscript in the Hessian.

MSK RES ERR USER NLO EVAL HESSUBJ

The user-defined nonlinear function reported an invalid subscript in the Hessian.

Page 407: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

389

MSK RES ERR USER NLO FUNC

The user-defined nonlinear function reported an error.

MSK RES ERR WHICHITEM NOT ALLOWED

whichitem is unacceptable.

MSK RES ERR WHICHSOL

The solution defined by compwhichsol does not exists.

MSK RES ERR WRITE LP FORMAT

Problem cannot be written as an LP file.

MSK RES ERR WRITE LP NON UNIQUE NAME

An auto-generated name is not unique.

MSK RES ERR WRITE MPS INVALID NAME

An invalid name is created while writing an MPS file. Usually this will make the MPS fileunreadable.

MSK RES ERR WRITE OPF INVALID VAR NAME

Empty variable names cannot be written to OPF files.

MSK RES ERR WRITING FILE

An error occurred while writing file

MSK RES ERR XML INVALID PROBLEM TYPE

The problem type is not supported by the XML format.

MSK RES ERR Y IS UNDEFINED

The solution item y is undefined.

MSK RES OK

No error occurred.

MSK RES TRM INTERNAL

The optimizer terminated due to some internal reason. Please contact MOSEK support.

MSK RES TRM INTERNAL STOP

The optimizer terminated for internal reasons. Please contact MOSEK support.

MSK RES TRM MAX ITERATIONS

The optimizer terminated at the maximum number of iterations.

MSK RES TRM MAX NUM SETBACKS

The optimizer terminated as the maximum number of set-backs was reached. This indicatesnumerical problems and a possibly badly formulated problem.

Page 408: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

390 CHAPTER 24. RESPONSE CODES

MSK RES TRM MAX TIME

The optimizer terminated at the maximum amount of time.

MSK RES TRM MIO NEAR ABS GAP

The mixed-integer optimizer terminated because the near optimal absolute gap tolerance wassatisfied.

MSK RES TRM MIO NEAR REL GAP

The mixed-integer optimizer terminated because the near optimal relative gap tolerance wassatisfied.

MSK RES TRM MIO NUM BRANCHES

The mixed-integer optimizer terminated as to the maximum number of branches was reached.

MSK RES TRM MIO NUM RELAXS

The mixed-integer optimizer terminated as the maximum number of relaxations was reached.

MSK RES TRM NUM MAX NUM INT SOLUTIONS

The mixed-integer optimizer terminated as the maximum number of feasible solutions wasreached.

MSK RES TRM NUMERICAL PROBLEM

The optimizer terminated due to numerical problems.

MSK RES TRM OBJECTIVE RANGE

The optimizer terminated on the bound of the objective range.

MSK RES TRM STALL

The optimizer is terminated due to slow progress.

Stalling means that numerical problems prevent the optimizer from making reasonable progressand that it make no sense to continue. In many cases this happens if the problem is badly scaledor otherwise ill-conditioned. There is no guarantee that the solution will be (near) feasible ornear optimal. However, often stalling happens near the optimum, and the returned solution maybe of good quality. Therefore, it is recommended to check the status of then solution. If thesolution near optimal the solution is most likely good enough for most practical purposes.

Please note that if a linear optimization problem is solved using the interior-point optimizerwith basis identification turned on, the returned basic solution likely to have high accuracy, eventhough the optimizer stalled.

Some common causes of stalling are a) badly scaled models, b) near feasible or near infeasibleproblems and c) a non-convex problems. Case c) is only relevant for general non-linear problems.It is not possible in general for MOSEK to check if a specific problems is convex since such acheck would be NP hard in itself. This implies that care should be taken when solving problemsinvolving general user defined functions.

MSK RES TRM USER CALLBACK

The optimizer terminated due to the return of the user-defined call-back function.

Page 409: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

391

MSK RES WRN ANA ALMOST INT BOUNDS

This warning is issued by the problem analyzer if a constraint is bound nearly integral.

MSK RES WRN ANA C ZERO

This warning is issued by the problem analyzer, if the coefficients in the linear part of theobjective are all zero.

MSK RES WRN ANA CLOSE BOUNDS

This warning is issued by problem analyzer, if ranged constraints or variables with very closeupper and lower bounds are detected. One should consider treating such constraints as equalitiesand such variables as constants.

MSK RES WRN ANA EMPTY COLS

This warning is issued by the problem analyzer, if columns, in which all coefficients are zero, arefound.

MSK RES WRN ANA LARGE BOUNDS

This warning is issued by the problem analyzer, if one or more constraint or variable bounds arevery large. One should consider omitting these bounds entirely by setting them to +inf or -inf.

MSK RES WRN CONSTRUCT INVALID SOL ITG

The intial value for one or more of the integer variables is not feasible.

MSK RES WRN CONSTRUCT NO SOL ITG

The construct solution requires an integer solution.

MSK RES WRN CONSTRUCT SOLUTION INFEAS

After fixing the integer variables at the suggested values then the problem is infeasible.

MSK RES WRN DROPPED NZ QOBJ

One or more non-zero elements were dropped in the Q matrix in the objective.

MSK RES WRN DUPLICATE BARVARIABLE NAMES

Two barvariable names are identical.

MSK RES WRN DUPLICATE CONE NAMES

Two cone names are identical.

MSK RES WRN DUPLICATE CONSTRAINT NAMES

Two constraint names are identical.

MSK RES WRN DUPLICATE VARIABLE NAMES

Two variable names are identical.

MSK RES WRN ELIMINATOR SPACE

The eliminator is skipped at least once due to lack of space.

Page 410: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

392 CHAPTER 24. RESPONSE CODES

MSK RES WRN EMPTY NAME

A variable or constraint name is empty. The output file may be invalid.

MSK RES WRN IGNORE INTEGER

Ignored integer constraints.

MSK RES WRN INCOMPLETE LINEAR DEPENDENCY CHECK

The linear dependency check(s) is not completed. Normally this is not an important warningunless the optimization problem has been formulated with linear dependencies which is badpractice.

MSK RES WRN LARGE AIJ

A numerically large value is specified for an ai,j element inA. The parameter MSK DPAR DATA TOL AIJ LARGE

controls when an ai,j is considered large.

MSK RES WRN LARGE BOUND

A numerically large bound value is specified.

MSK RES WRN LARGE CJ

A numerically large value is specified for one cj .

MSK RES WRN LARGE CON FX

An equality constraint is fixed to a numerically large value. This can cause numerical problems.

MSK RES WRN LARGE LO BOUND

A numerically large lower bound value is specified.

MSK RES WRN LARGE UP BOUND

A numerically large upper bound value is specified.

MSK RES WRN LICENSE EXPIRE

The license expires.

MSK RES WRN LICENSE FEATURE EXPIRE

The license expires.

MSK RES WRN LICENSE SERVER

The license server is not responding.

MSK RES WRN LP DROP VARIABLE

Ignored a variable because the variable was not previously defined. Usually this implies that avariable appears in the bound section but not in the objective or the constraints.

MSK RES WRN LP OLD QUAD FORMAT

Missing ’/2’ after quadratic expressions in bound or objective.

Page 411: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

393

MSK RES WRN MIO INFEASIBLE FINAL

The final mixed-integer problem with all the integer variables fixed at their optimal values isinfeasible.

MSK RES WRN MPS SPLIT BOU VECTOR

A BOUNDS vector is split into several nonadjacent parts in an MPS file.

MSK RES WRN MPS SPLIT RAN VECTOR

A RANGE vector is split into several nonadjacent parts in an MPS file.

MSK RES WRN MPS SPLIT RHS VECTOR

An RHS vector is split into several nonadjacent parts in an MPS file.

MSK RES WRN NAME MAX LEN

A name is longer than the buffer that is supposed to hold it.

MSK RES WRN NO DUALIZER

No automatic dualizer is available for the specified problem. The primal problem is solved.

MSK RES WRN NO GLOBAL OPTIMIZER

No global optimizer is available.

MSK RES WRN NO NONLINEAR FUNCTION WRITE

The problem contains a general nonlinear function in either the objective or the constraints. Sucha nonlinear function cannot be written to a disk file. Note that quadratic terms when inputtedexplicitly can be written to disk.

MSK RES WRN NZ IN UPR TRI

Non-zero elements specified in the upper triangle of a matrix were ignored.

MSK RES WRN OPEN PARAM FILE

The parameter file could not be opened.

MSK RES WRN PARAM IGNORED CMIO

A parameter was ignored by the conic mixed integer optimizer.

MSK RES WRN PARAM NAME DOU

The parameter name is not recognized as a double parameter.

MSK RES WRN PARAM NAME INT

The parameter name is not recognized as a integer parameter.

MSK RES WRN PARAM NAME STR

The parameter name is not recognized as a string parameter.

MSK RES WRN PARAM STR VALUE

The string is not recognized as a symbolic value for the parameter.

Page 412: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

394 CHAPTER 24. RESPONSE CODES

MSK RES WRN PRESOLVE OUTOFSPACE

The presolve is incomplete due to lack of space.

MSK RES WRN QUAD CONES WITH ROOT FIXED AT ZERO

For at least one quadratic cone the root is fixed at (nearly) zero. This may cause problemssuch as a very large dual solution. Therefore, it is recommended to remove such cones beforeoptimizing the problems, or to fix all the variables in the cone to 0.

MSK RES WRN RQUAD CONES WITH ROOT FIXED AT ZERO

For at least one rotated quadratic cone at least one of the root variables are fixed at (nearly)zero. This may cause problems such as a very large dual solution. Therefore, it is recommendedto remove such cones before optimizing the problems, or to fix all the variables in the cone to 0.

MSK RES WRN SOL FILE IGNORED CON

One or more lines in the constraint section were ignored when reading a solution file.

MSK RES WRN SOL FILE IGNORED VAR

One or more lines in the variable section were ignored when reading a solution file.

MSK RES WRN SOL FILTER

Invalid solution filter is specified.

MSK RES WRN SPAR MAX LEN

A value for a string parameter is longer than the buffer that is supposed to hold it.

MSK RES WRN TOO FEW BASIS VARS

An incomplete basis has been specified. Too few basis variables are specified.

MSK RES WRN TOO MANY BASIS VARS

A basis with too many variables has been specified.

MSK RES WRN TOO MANY THREADS CONCURRENT

The concurrent optimizer employs more threads than available. This will lead to poor perfor-mance.

MSK RES WRN UNDEF SOL FILE NAME

Undefined name occurred in a solution.

MSK RES WRN USING GENERIC NAMES

Generic names are used because a name is not valid. For instance when writing an LP file thenames must not contain blanks or start with a digit.

MSK RES WRN WRITE CHANGED NAMES

Some names were changed because they were invalid for the output file format.

Page 413: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

395

MSK RES WRN WRITE DISCARDED CFIX

The fixed objective term could not be converted to a variable and was discarded in the outputfile.

MSK RES WRN ZERO AIJ

One or more zero elements are specified in A.

MSK RES WRN ZEROS IN SPARSE COL

One or more (near) zero elements are specified in a sparse column of a matrix. It is redundantto specify zero elements. Hence, it may indicate an error.

MSK RES WRN ZEROS IN SPARSE ROW

One or more (near) zero elements are specified in a sparse row of a matrix. It is redundant tospecify zero elements. Hence it may indicate an error.

Page 414: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

396 CHAPTER 24. RESPONSE CODES

Page 415: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

Chapter 25

API constants

25.1 Constraint or variable access modes

MSK ACC VAR

Access data by columns (variable oriented)

MSK ACC CON

Access data by rows (constraint oriented)

25.2 Basis identification

MSK BI NEVER

Never do basis identification.

MSK BI ALWAYS

Basis identification is always performed even if the interior-point optimizer terminates abnor-mally.

MSK BI NO ERROR

Basis identification is performed if the interior-point optimizer terminates without an error.

MSK BI IF FEASIBLE

Basis identification is not performed if the interior-point optimizer terminates with a problemstatus saying that the problem is primal or dual infeasible.

MSK BI RESERVERED

Not currently in use.

397

Page 416: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

398 CHAPTER 25. API CONSTANTS

25.3 Bound keys

MSK BK LO

The constraint or variable has a finite lower bound and an infinite upper bound.

MSK BK UP

The constraint or variable has an infinite lower bound and an finite upper bound.

MSK BK FX

The constraint or variable is fixed.

MSK BK FR

The constraint or variable is free.

MSK BK RA

The constraint or variable is ranged.

25.4 Specifies the branching direction.

MSK BRANCH DIR FREE

The mixed-integer optimizer decides which branch to choose.

MSK BRANCH DIR UP

The mixed-integer optimizer always chooses the up branch first.

MSK BRANCH DIR DOWN

The mixed-integer optimizer always chooses the down branch first.

25.5 Progress call-back codes

MSK CALLBACK BEGIN BI

The basis identification procedure has been started.

MSK CALLBACK BEGIN CONCURRENT

Concurrent optimizer is started.

MSK CALLBACK BEGIN CONIC

The call-back function is called when the conic optimizer is started.

MSK CALLBACK BEGIN DUAL BI

The call-back function is called from within the basis identification procedure when the dualphase is started.

Page 417: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

25.5. PROGRESS CALL-BACK CODES 399

MSK CALLBACK BEGIN DUAL SENSITIVITY

Dual sensitivity analysis is started.

MSK CALLBACK BEGIN DUAL SETUP BI

The call-back function is called when the dual BI phase is started.

MSK CALLBACK BEGIN DUAL SIMPLEX

The call-back function is called when the dual simplex optimizer started.

MSK CALLBACK BEGIN DUAL SIMPLEX BI

The call-back function is called from within the basis identification procedure when the dualsimplex clean-up phase is started.

MSK CALLBACK BEGIN FULL CONVEXITY CHECK

Begin full convexity check.

MSK CALLBACK BEGIN INFEAS ANA

The call-back function is called when the infeasibility analyzer is started.

MSK CALLBACK BEGIN INTPNT

The call-back function is called when the interior-point optimizer is started.

MSK CALLBACK BEGIN LICENSE WAIT

Begin waiting for license.

MSK CALLBACK BEGIN MIO

The call-back function is called when the mixed-integer optimizer is started.

MSK CALLBACK BEGIN NETWORK DUAL SIMPLEX

The call-back function is called when the dual network simplex optimizer is started.

MSK CALLBACK BEGIN NETWORK PRIMAL SIMPLEX

The call-back function is called when the primal network simplex optimizer is started.

MSK CALLBACK BEGIN NETWORK SIMPLEX

The call-back function is called when the simplex network optimizer is started.

MSK CALLBACK BEGIN NONCONVEX

The call-back function is called when the nonconvex optimizer is started.

MSK CALLBACK BEGIN OPTIMIZER

The call-back function is called when the optimizer is started.

MSK CALLBACK BEGIN PRESOLVE

The call-back function is called when the presolve is started.

Page 418: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

400 CHAPTER 25. API CONSTANTS

MSK CALLBACK BEGIN PRIMAL BI

The call-back function is called from within the basis identification procedure when the primalphase is started.

MSK CALLBACK BEGIN PRIMAL DUAL SIMPLEX

The call-back function is called when the primal-dual simplex optimizer is started.

MSK CALLBACK BEGIN PRIMAL DUAL SIMPLEX BI

The call-back function is called from within the basis identification procedure when the primal-dual simplex clean-up phase is started.

MSK CALLBACK BEGIN PRIMAL REPAIR

Begin primal feasibility repair.

MSK CALLBACK BEGIN PRIMAL SENSITIVITY

Primal sensitivity analysis is started.

MSK CALLBACK BEGIN PRIMAL SETUP BI

The call-back function is called when the primal BI setup is started.

MSK CALLBACK BEGIN PRIMAL SIMPLEX

The call-back function is called when the primal simplex optimizer is started.

MSK CALLBACK BEGIN PRIMAL SIMPLEX BI

The call-back function is called from within the basis identification procedure when the primalsimplex clean-up phase is started.

MSK CALLBACK BEGIN QCQO REFORMULATE

Begin QCQO reformulation.

MSK CALLBACK BEGIN READ

MOSEK has started reading a problem file.

MSK CALLBACK BEGIN SIMPLEX

The call-back function is called when the simplex optimizer is started.

MSK CALLBACK BEGIN SIMPLEX BI

The call-back function is called from within the basis identification procedure when the simplexclean-up phase is started.

MSK CALLBACK BEGIN SIMPLEX NETWORK DETECT

The call-back function is called when the network detection procedure is started.

MSK CALLBACK BEGIN WRITE

MOSEK has started writing a problem file.

Page 419: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

25.5. PROGRESS CALL-BACK CODES 401

MSK CALLBACK CONIC

The call-back function is called from within the conic optimizer after the information databasehas been updated.

MSK CALLBACK DUAL SIMPLEX

The call-back function is called from within the dual simplex optimizer.

MSK CALLBACK END BI

The call-back function is called when the basis identification procedure is terminated.

MSK CALLBACK END CONCURRENT

Concurrent optimizer is terminated.

MSK CALLBACK END CONIC

The call-back function is called when the conic optimizer is terminated.

MSK CALLBACK END DUAL BI

The call-back function is called from within the basis identification procedure when the dualphase is terminated.

MSK CALLBACK END DUAL SENSITIVITY

Dual sensitivity analysis is terminated.

MSK CALLBACK END DUAL SETUP BI

The call-back function is called when the dual BI phase is terminated.

MSK CALLBACK END DUAL SIMPLEX

The call-back function is called when the dual simplex optimizer is terminated.

MSK CALLBACK END DUAL SIMPLEX BI

The call-back function is called from within the basis identification procedure when the dualclean-up phase is terminated.

MSK CALLBACK END FULL CONVEXITY CHECK

End full convexity check.

MSK CALLBACK END INFEAS ANA

The call-back function is called when the infeasibility analyzer is terminated.

MSK CALLBACK END INTPNT

The call-back function is called when the interior-point optimizer is terminated.

MSK CALLBACK END LICENSE WAIT

End waiting for license.

MSK CALLBACK END MIO

The call-back function is called when the mixed-integer optimizer is terminated.

Page 420: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

402 CHAPTER 25. API CONSTANTS

MSK CALLBACK END NETWORK DUAL SIMPLEX

The call-back function is called when the dual network simplex optimizer is terminated.

MSK CALLBACK END NETWORK PRIMAL SIMPLEX

The call-back function is called when the primal network simplex optimizer is terminated.

MSK CALLBACK END NETWORK SIMPLEX

The call-back function is called when the simplex network optimizer is terminated.

MSK CALLBACK END NONCONVEX

The call-back function is called when the nonconvex optimizer is terminated.

MSK CALLBACK END OPTIMIZER

The call-back function is called when the optimizer is terminated.

MSK CALLBACK END PRESOLVE

The call-back function is called when the presolve is completed.

MSK CALLBACK END PRIMAL BI

The call-back function is called from within the basis identification procedure when the primalphase is terminated.

MSK CALLBACK END PRIMAL DUAL SIMPLEX

The call-back function is called when the primal-dual simplex optimizer is terminated.

MSK CALLBACK END PRIMAL DUAL SIMPLEX BI

The call-back function is called from within the basis identification procedure when the primal-dual clean-up phase is terminated.

MSK CALLBACK END PRIMAL REPAIR

End primal feasibility repair.

MSK CALLBACK END PRIMAL SENSITIVITY

Primal sensitivity analysis is terminated.

MSK CALLBACK END PRIMAL SETUP BI

The call-back function is called when the primal BI setup is terminated.

MSK CALLBACK END PRIMAL SIMPLEX

The call-back function is called when the primal simplex optimizer is terminated.

MSK CALLBACK END PRIMAL SIMPLEX BI

The call-back function is called from within the basis identification procedure when the primalclean-up phase is terminated.

MSK CALLBACK END QCQO REFORMULATE

End QCQO reformulation.

Page 421: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

25.5. PROGRESS CALL-BACK CODES 403

MSK CALLBACK END READ

MOSEK has finished reading a problem file.

MSK CALLBACK END SIMPLEX

The call-back function is called when the simplex optimizer is terminated.

MSK CALLBACK END SIMPLEX BI

The call-back function is called from within the basis identification procedure when the simplexclean-up phase is terminated.

MSK CALLBACK END SIMPLEX NETWORK DETECT

The call-back function is called when the network detection procedure is terminated.

MSK CALLBACK END WRITE

MOSEK has finished writing a problem file.

MSK CALLBACK IM BI

The call-back function is called from within the basis identification procedure at an intermediatepoint.

MSK CALLBACK IM CONIC

The call-back function is called at an intermediate stage within the conic optimizer where theinformation database has not been updated.

MSK CALLBACK IM DUAL BI

The call-back function is called from within the basis identification procedure at an intermediatepoint in the dual phase.

MSK CALLBACK IM DUAL SENSIVITY

The call-back function is called at an intermediate stage of the dual sensitivity analysis.

MSK CALLBACK IM DUAL SIMPLEX

The call-back function is called at an intermediate point in the dual simplex optimizer.

MSK CALLBACK IM FULL CONVEXITY CHECK

The call-back function is called at an intermediate stage of the full convexity check.

MSK CALLBACK IM INTPNT

The call-back function is called at an intermediate stage within the interior-point optimizer wherethe information database has not been updated.

MSK CALLBACK IM LICENSE WAIT

MOSEK is waiting for a license.

MSK CALLBACK IM LU

The call-back function is called from within the LU factorization procedure at an intermediatepoint.

Page 422: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

404 CHAPTER 25. API CONSTANTS

MSK CALLBACK IM MIO

The call-back function is called at an intermediate point in the mixed-integer optimizer.

MSK CALLBACK IM MIO DUAL SIMPLEX

The call-back function is called at an intermediate point in the mixed-integer optimizer whilerunning the dual simplex optimizer.

MSK CALLBACK IM MIO INTPNT

The call-back function is called at an intermediate point in the mixed-integer optimizer whilerunning the interior-point optimizer.

MSK CALLBACK IM MIO PRESOLVE

The call-back function is called at an intermediate point in the mixed-integer optimizer whilerunning the presolve.

MSK CALLBACK IM MIO PRIMAL SIMPLEX

The call-back function is called at an intermediate point in the mixed-integer optimizer whilerunning the primal simplex optimizer.

MSK CALLBACK IM NETWORK DUAL SIMPLEX

The call-back function is called at an intermediate point in the dual network simplex optimizer.

MSK CALLBACK IM NETWORK PRIMAL SIMPLEX

The call-back function is called at an intermediate point in the primal network simplex optimizer.

MSK CALLBACK IM NONCONVEX

The call-back function is called at an intermediate stage within the nonconvex optimizer wherethe information database has not been updated.

MSK CALLBACK IM ORDER

The call-back function is called from within the matrix ordering procedure at an intermediatepoint.

MSK CALLBACK IM PRESOLVE

The call-back function is called from within the presolve procedure at an intermediate stage.

MSK CALLBACK IM PRIMAL BI

The call-back function is called from within the basis identification procedure at an intermediatepoint in the primal phase.

MSK CALLBACK IM PRIMAL DUAL SIMPLEX

The call-back function is called at an intermediate point in the primal-dual simplex optimizer.

MSK CALLBACK IM PRIMAL SENSIVITY

The call-back function is called at an intermediate stage of the primal sensitivity analysis.

Page 423: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

25.5. PROGRESS CALL-BACK CODES 405

MSK CALLBACK IM PRIMAL SIMPLEX

The call-back function is called at an intermediate point in the primal simplex optimizer.

MSK CALLBACK IM QO REFORMULATE

The call-back function is called at an intermediate stage of the conic quadratic reformulation.

MSK CALLBACK IM READ

Intermediate stage in reading.

MSK CALLBACK IM SIMPLEX

The call-back function is called from within the simplex optimizer at an intermediate point.

MSK CALLBACK IM SIMPLEX BI

The call-back function is called from within the basis identification procedure at an intermedi-ate point in the simplex clean-up phase. The frequency of the call-backs is controlled by theMSK IPAR LOG SIM FREQ parameter.

MSK CALLBACK INTPNT

The call-back function is called from within the interior-point optimizer after the informationdatabase has been updated.

MSK CALLBACK NEW INT MIO

The call-back function is called after a new integer solution has been located by the mixed-integeroptimizer.

MSK CALLBACK NONCOVEX

The call-back function is called from within the nonconvex optimizer after the informationdatabase has been updated.

MSK CALLBACK PRIMAL SIMPLEX

The call-back function is called from within the primal simplex optimizer.

MSK CALLBACK READ OPF

The call-back function is called from the OPF reader.

MSK CALLBACK READ OPF SECTION

A chunk of Q non-zeos has been read from a problem file.

MSK CALLBACK UPDATE DUAL BI

The call-back function is called from within the basis identification procedure at an intermediatepoint in the dual phase.

MSK CALLBACK UPDATE DUAL SIMPLEX

The call-back function is called in the dual simplex optimizer.

Page 424: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

406 CHAPTER 25. API CONSTANTS

MSK CALLBACK UPDATE DUAL SIMPLEX BI

The call-back function is called from within the basis identification procedure at an intermediatepoint in the dual simplex clean-up phase. The frequency of the call-backs is controlled by theMSK IPAR LOG SIM FREQ parameter.

MSK CALLBACK UPDATE NETWORK DUAL SIMPLEX

The call-back function is called in the dual network simplex optimizer.

MSK CALLBACK UPDATE NETWORK PRIMAL SIMPLEX

The call-back function is called in the primal network simplex optimizer.

MSK CALLBACK UPDATE NONCONVEX

The call-back function is called at an intermediate stage within the nonconvex optimizer wherethe information database has been updated.

MSK CALLBACK UPDATE PRESOLVE

The call-back function is called from within the presolve procedure.

MSK CALLBACK UPDATE PRIMAL BI

The call-back function is called from within the basis identification procedure at an intermediatepoint in the primal phase.

MSK CALLBACK UPDATE PRIMAL DUAL SIMPLEX

The call-back function is called in the primal-dual simplex optimizer.

MSK CALLBACK UPDATE PRIMAL DUAL SIMPLEX BI

The call-back function is called from within the basis identification procedure at an intermediatepoint in the primal-dual simplex clean-up phase. The frequency of the call-backs is controlledby the MSK IPAR LOG SIM FREQ parameter.

MSK CALLBACK UPDATE PRIMAL SIMPLEX

The call-back function is called in the primal simplex optimizer.

MSK CALLBACK UPDATE PRIMAL SIMPLEX BI

The call-back function is called from within the basis identification procedure at an intermediatepoint in the primal simplex clean-up phase. The frequency of the call-backs is controlled by theMSK IPAR LOG SIM FREQ parameter.

MSK CALLBACK WRITE OPF

The call-back function is called from the OPF writer.

Page 425: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

25.6. TYPES OF CONVEXITY CHECKS. 407

25.6 Types of convexity checks.

MSK CHECK CONVEXITY NONE

No convexity check.

MSK CHECK CONVEXITY SIMPLE

Perform simple and fast convexity check.

MSK CHECK CONVEXITY FULL

Perform a full convexity check.

25.7 Compression types

MSK COMPRESS NONE

No compression is used.

MSK COMPRESS FREE

The type of compression used is chosen automatically.

MSK COMPRESS GZIP

The type of compression used is gzip compatible.

25.8 Cone types

MSK CT QUAD

The cone is a quadratic cone.

MSK CT RQUAD

The cone is a rotated quadratic cone.

25.9 Data format types

MSK DATA FORMAT EXTENSION

The file extension is used to determine the data file format.

MSK DATA FORMAT MPS

The data file is MPS formatted.

MSK DATA FORMAT LP

The data file is LP formatted.

Page 426: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

408 CHAPTER 25. API CONSTANTS

MSK DATA FORMAT OP

The data file is an optimization problem formatted file.

MSK DATA FORMAT XML

The data file is an XML formatted file.

MSK DATA FORMAT FREE MPS

The data data a free MPS formatted file.

MSK DATA FORMAT TASK

Generic task dump file.

25.10 Double information items

MSK DINF BI CLEAN DUAL TIME

Time spent within the dual clean-up optimizer of the basis identification procedure since itsinvocation.

MSK DINF BI CLEAN PRIMAL DUAL TIME

Time spent within the primal-dual clean-up optimizer of the basis identification procedure sinceits invocation.

MSK DINF BI CLEAN PRIMAL TIME

Time spent within the primal clean-up optimizer of the basis identification procedure since itsinvocation.

MSK DINF BI CLEAN TIME

Time spent within the clean-up phase of the basis identification procedure since its invocation.

MSK DINF BI DUAL TIME

Time spent within the dual phase basis identification procedure since its invocation.

MSK DINF BI PRIMAL TIME

Time spent within the primal phase of the basis identification procedure since its invocation.

MSK DINF BI TIME

Time spent within the basis identification procedure since its invocation.

MSK DINF CONCURRENT TIME

Time spent within the concurrent optimizer since its invocation.

MSK DINF INTPNT DUAL FEAS

Dual feasibility measure reported by the interior-point optimizer. (For the interior-point op-timizer this measure does not directly related to the original problem because a homogeneousmodel is employed.)

Page 427: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

25.10. DOUBLE INFORMATION ITEMS 409

MSK DINF INTPNT DUAL OBJ

Dual objective value reported by the interior-point optimizer.

MSK DINF INTPNT FACTOR NUM FLOPS

An estimate of the number of flops used in the factorization.

MSK DINF INTPNT OPT STATUS

This measure should converge to +1 if the problem has a primal-dual optimal solution, andconverge to -1 if problem is (strictly) primal or dual infeasible. Furthermore, if the measureconverges to 0 the problem is usually ill-posed.

MSK DINF INTPNT ORDER TIME

Order time (in seconds).

MSK DINF INTPNT PRIMAL FEAS

Primal feasibility measure reported by the interior-point optimizers. (For the interior-pointoptimizer this measure does not directly related to the original problem because a homogeneousmodel is employed).

MSK DINF INTPNT PRIMAL OBJ

Primal objective value reported by the interior-point optimizer.

MSK DINF INTPNT TIME

Time spent within the interior-point optimizer since its invocation.

MSK DINF MIO CONSTRUCT SOLUTION OBJ

If MOSEK has successfully constructed an integer feasible solution, then this item contains theoptimal objective value corresponding to the feasible solution.

MSK DINF MIO HEURISTIC TIME

Time spent in the optimizer while solving the relaxtions.

MSK DINF MIO OBJ ABS GAP

Given the mixed-integer optimizer has computed a feasible solution and a bound on the optimalobjective value, then this item contains the absolute gap defined by

|(objective value of feasible solution)− (objective bound)|.

Otherwise it has the value -1.0.

MSK DINF MIO OBJ BOUND

The best known bound on the objective function. This value is undefined until at least onerelaxation has been solved: To see if this is the case check that MSK IINF MIO NUM RELAX isstricly positive.

Page 428: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

410 CHAPTER 25. API CONSTANTS

MSK DINF MIO OBJ INT

The primal objective value corresponding to the best integer feasible solution. Please note that atleast one integer feasible solution must have located i.e. check MSK IINF MIO NUM INT SOLUTIONS.

MSK DINF MIO OBJ REL GAP

Given that the mixed-integer optimizer has computed a feasible solution and a bound on theoptimal objective value, then this item contains the relative gap defined by

|(objective value of feasible solution)− (objective bound)|max(δ, |(objective value of feasible solution)|)

.

where δ is given by the paramater MSK DPAR MIO REL GAP CONST. Otherwise it has the value -1.0.

MSK DINF MIO OPTIMIZER TIME

Time spent in the optimizer while solving the relaxtions.

MSK DINF MIO ROOT OPTIMIZER TIME

Time spent in the optimizer while solving the root relaxation.

MSK DINF MIO ROOT PRESOLVE TIME

Time spent in while presolveing the root relaxation.

MSK DINF MIO TIME

Time spent in the mixed-integer optimizer.

MSK DINF MIO USER OBJ CUT

If the objective cut is used, then this information item has the value of the cut.

MSK DINF OPTIMIZER TIME

Total time spent in the optimizer since it was invoked.

MSK DINF PRESOLVE ELI TIME

Total time spent in the eliminator since the presolve was invoked.

MSK DINF PRESOLVE LINDEP TIME

Total time spent in the linear dependency checker since the presolve was invoked.

MSK DINF PRESOLVE TIME

Total time (in seconds) spent in the presolve since it was invoked.

MSK DINF PRIMAL REPAIR PENALTY OBJ

The optimal objective value of the penalty function.

MSK DINF QCQO REFORMULATE TIME

Time spent with conic quadratic reformulation.

Page 429: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

25.10. DOUBLE INFORMATION ITEMS 411

MSK DINF RD TIME

Time spent reading the data file.

MSK DINF SIM DUAL TIME

Time spent in the dual simplex optimizer since invoking it.

MSK DINF SIM FEAS

Feasibility measure reported by the simplex optimizer.

MSK DINF SIM NETWORK DUAL TIME

Time spent in the dual network simplex optimizer since invoking it.

MSK DINF SIM NETWORK PRIMAL TIME

Time spent in the primal network simplex optimizer since invoking it.

MSK DINF SIM NETWORK TIME

Time spent in the network simplex optimizer since invoking it.

MSK DINF SIM OBJ

Objective value reported by the simplex optimizer.

MSK DINF SIM PRIMAL DUAL TIME

Time spent in the primal-dual simplex optimizer optimizer since invoking it.

MSK DINF SIM PRIMAL TIME

Time spent in the primal simplex optimizer since invoking it.

MSK DINF SIM TIME

Time spent in the simplex optimizer since invoking it.

MSK DINF SOL BAS DUAL OBJ

Dual objective value of the basic solution.

MSK DINF SOL BAS DVIOLCON

Maximal dual bound violation for xc in the basic solution.

MSK DINF SOL BAS DVIOLVAR

Maximal dual bound violation for xx in the basic solution.

MSK DINF SOL BAS PRIMAL OBJ

Primal objective value of the basic solution.

MSK DINF SOL BAS PVIOLCON

Maximal primal bound violation for xc in the basic solution.

MSK DINF SOL BAS PVIOLVAR

Maximal primal bound violation for xx in the basic solution.

Page 430: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

412 CHAPTER 25. API CONSTANTS

MSK DINF SOL ITG PRIMAL OBJ

Primal objective value of the integer solution.

MSK DINF SOL ITG PVIOLBARVAR

Maximal primal bound violation for X in the integer solution.

MSK DINF SOL ITG PVIOLCON

Maximal primal bound violation for xc in the integer solution.

MSK DINF SOL ITG PVIOLCONES

Maximal primal violation for primal conic constraints in the integer solution.

MSK DINF SOL ITG PVIOLITG

Maximal violation for the integer constraints in the integer solution.

MSK DINF SOL ITG PVIOLVAR

Maximal primal bound violation for xx in the integer solution.

MSK DINF SOL ITR DUAL OBJ

Dual objective value of the interior-point solution.

MSK DINF SOL ITR DVIOLBARVAR

Maximal dual bound violation for X in the interior-point solution.

MSK DINF SOL ITR DVIOLCON

Maximal dual bound violation for xc in the interior-point solution.

MSK DINF SOL ITR DVIOLCONES

Maximal dual violation for dual conic constraints in the interior-point solution.

MSK DINF SOL ITR DVIOLVAR

Maximal dual bound violation for xx in the interior-point solution.

MSK DINF SOL ITR PRIMAL OBJ

Primal objective value of the interior-point solution.

MSK DINF SOL ITR PVIOLBARVAR

Maximal primal bound violation for X in the interior-point solution.

MSK DINF SOL ITR PVIOLCON

Maximal primal bound violation for xc in the interior-point solution.

MSK DINF SOL ITR PVIOLCONES

Maximal primal violation for primal conic constraints in the interior-point solution.

MSK DINF SOL ITR PVIOLVAR

Maximal primal bound violation for xx in the interior-point solution.

Page 431: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

25.11. FEASIBILITY REPAIR TYPES 413

25.11 Feasibility repair types

MSK FEASREPAIR OPTIMIZE NONE

Do not optimize the feasibility repair problem.

MSK FEASREPAIR OPTIMIZE PENALTY

Minimize weighted sum of violations.

MSK FEASREPAIR OPTIMIZE COMBINED

Minimize with original objective subject to minimal weighted violation of bounds.

25.12 License feature

MSK FEATURE PTS

Base system.

MSK FEATURE PTON

Nonlinear extension.

MSK FEATURE PTOM

Mixed-integer extension.

MSK FEATURE PTOX

Non-convex extension.

25.13 Integer information items.

MSK IINF ANA PRO NUM CON

Number of constraints in the problem.

MSK IINF ANA PRO NUM CON EQ

Number of equality constraints.

MSK IINF ANA PRO NUM CON FR

Number of unbounded constraints.

MSK IINF ANA PRO NUM CON LO

Number of constraints with a lower bound and an infinite upper bound.

MSK IINF ANA PRO NUM CON RA

Number of constraints with finite lower and upper bounds.

Page 432: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

414 CHAPTER 25. API CONSTANTS

MSK IINF ANA PRO NUM CON UP

Number of constraints with an upper bound and an infinite lower bound.

MSK IINF ANA PRO NUM VAR

Number of variables in the problem.

MSK IINF ANA PRO NUM VAR BIN

Number of binary (0-1) variables.

MSK IINF ANA PRO NUM VAR CONT

Number of continuous variables.

MSK IINF ANA PRO NUM VAR EQ

Number of fixed variables.

MSK IINF ANA PRO NUM VAR FR

Number of free variables.

MSK IINF ANA PRO NUM VAR INT

Number of general integer variables.

MSK IINF ANA PRO NUM VAR LO

Number of variables with a lower bound and an infinite upper bound.

MSK IINF ANA PRO NUM VAR RA

Number of variables with finite lower and upper bounds.

MSK IINF ANA PRO NUM VAR UP

Number of variables with an upper bound and an infinite lower bound. This value is set by

MSK IINF CONCURRENT FASTEST OPTIMIZER

The type of the optimizer that finished first in a concurrent optimization.

MSK IINF INTPNT FACTOR DIM DENSE

Dimension of the dense sub system in factorization.

MSK IINF INTPNT ITER

Number of interior-point iterations since invoking the interior-point optimizer.

MSK IINF INTPNT NUM THREADS

Number of threads that the interior-point optimizer is using.

MSK IINF INTPNT SOLVE DUAL

Non-zero if the interior-point optimizer is solving the dual problem.

MSK IINF MIO CONSTRUCT NUM ROUNDINGS

Number of values in the integer solution that is rounded to an integer value.

Page 433: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

25.13. INTEGER INFORMATION ITEMS. 415

MSK IINF MIO CONSTRUCT SOLUTION

If this item has the value 0, then MOSEK did not try to construct an initial integer feasiblesolution. If the item has a positive value, then MOSEK successfully constructed an initial integerfeasible solution.

MSK IINF MIO INITIAL SOLUTION

Is non-zero if an initial integer solution is specified.

MSK IINF MIO NUM ACTIVE NODES

Number of active brabch bound nodes.

MSK IINF MIO NUM BASIS CUTS

Number of basis cuts.

MSK IINF MIO NUM BRANCH

Number of branches performed during the optimization.

MSK IINF MIO NUM CARDGUB CUTS

Number of cardgub cuts.

MSK IINF MIO NUM CLIQUE CUTS

Number of clique cuts.

MSK IINF MIO NUM COEF REDC CUTS

Number of coef. redc. cuts.

MSK IINF MIO NUM CONTRA CUTS

Number of contra cuts.

MSK IINF MIO NUM DISAGG CUTS

Number of diasagg cuts.

MSK IINF MIO NUM FLOW COVER CUTS

Number of flow cover cuts.

MSK IINF MIO NUM GCD CUTS

Number of gcd cuts.

MSK IINF MIO NUM GOMORY CUTS

Number of Gomory cuts.

MSK IINF MIO NUM GUB COVER CUTS

Number of GUB cover cuts.

MSK IINF MIO NUM INT SOLUTIONS

Number of integer feasible solutions that has been found.

Page 434: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

416 CHAPTER 25. API CONSTANTS

MSK IINF MIO NUM KNAPSUR COVER CUTS

Number of knapsack cover cuts.

MSK IINF MIO NUM LATTICE CUTS

Number of lattice cuts.

MSK IINF MIO NUM LIFT CUTS

Number of lift cuts.

MSK IINF MIO NUM OBJ CUTS

Number of obj cuts.

MSK IINF MIO NUM PLAN LOC CUTS

Number of loc cuts.

MSK IINF MIO NUM RELAX

Number of relaxations solved during the optimization.

MSK IINF MIO NUMCON

Number of constraints in the problem solved be the mixed-integer optimizer.

MSK IINF MIO NUMINT

Number of integer variables in the problem solved be the mixed-integer optimizer.

MSK IINF MIO NUMVAR

Number of variables in the problem solved be the mixed-integer optimizer.

MSK IINF MIO OBJ BOUND DEFINED

Non-zero if a valid objective bound has been found, otherwise zero.

MSK IINF MIO TOTAL NUM CUTS

Total number of cuts generated by the mixed-integer optimizer.

MSK IINF MIO USER OBJ CUT

If it is non-zero, then the objective cut is used.

MSK IINF OPT NUMCON

Number of constraints in the problem solved when the optimizer is called.

MSK IINF OPT NUMVAR

Number of variables in the problem solved when the optimizer is called

MSK IINF OPTIMIZE RESPONSE

The reponse code returned by optimize.

MSK IINF RD NUMBARVAR

Number of variables read.

Page 435: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

25.13. INTEGER INFORMATION ITEMS. 417

MSK IINF RD NUMCON

Number of constraints read.

MSK IINF RD NUMCONE

Number of conic constraints read.

MSK IINF RD NUMINTVAR

Number of integer-constrained variables read.

MSK IINF RD NUMQ

Number of nonempty Q matrixes read.

MSK IINF RD NUMVAR

Number of variables read.

MSK IINF RD PROTYPE

Problem type.

MSK IINF SIM DUAL DEG ITER

The number of dual degenerate iterations.

MSK IINF SIM DUAL HOTSTART

If 1 then the dual simplex algorithm is solving from an advanced basis.

MSK IINF SIM DUAL HOTSTART LU

If 1 then a valid basis factorization of full rank was located and used by the dual simplexalgorithm.

MSK IINF SIM DUAL INF ITER

The number of iterations taken with dual infeasibility.

MSK IINF SIM DUAL ITER

Number of dual simplex iterations during the last optimization.

MSK IINF SIM NETWORK DUAL DEG ITER

The number of dual network degenerate iterations.

MSK IINF SIM NETWORK DUAL HOTSTART

If 1 then the dual network simplex algorithm is solving from an advanced basis.

MSK IINF SIM NETWORK DUAL HOTSTART LU

If 1 then a valid basis factorization of full rank was located and used by the dual network simplexalgorithm.

MSK IINF SIM NETWORK DUAL INF ITER

The number of iterations taken with dual infeasibility in the network optimizer.

Page 436: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

418 CHAPTER 25. API CONSTANTS

MSK IINF SIM NETWORK DUAL ITER

Number of dual network simplex iterations during the last optimization.

MSK IINF SIM NETWORK PRIMAL DEG ITER

The number of primal network degenerate iterations.

MSK IINF SIM NETWORK PRIMAL HOTSTART

If 1 then the primal network simplex algorithm is solving from an advanced basis.

MSK IINF SIM NETWORK PRIMAL HOTSTART LU

If 1 then a valid basis factorization of full rank was located and used by the primal networksimplex algorithm.

MSK IINF SIM NETWORK PRIMAL INF ITER

The number of iterations taken with primal infeasibility in the network optimizer.

MSK IINF SIM NETWORK PRIMAL ITER

Number of primal network simplex iterations during the last optimization.

MSK IINF SIM NUMCON

Number of constraints in the problem solved by the simplex optimizer.

MSK IINF SIM NUMVAR

Number of variables in the problem solved by the simplex optimizer.

MSK IINF SIM PRIMAL DEG ITER

The number of primal degenerate iterations.

MSK IINF SIM PRIMAL DUAL DEG ITER

The number of degenerate major iterations taken by the primal dual simplex algorithm.

MSK IINF SIM PRIMAL DUAL HOTSTART

If 1 then the primal dual simplex algorithm is solving from an advanced basis.

MSK IINF SIM PRIMAL DUAL HOTSTART LU

If 1 then a valid basis factorization of full rank was located and used by the primal dual simplexalgorithm.

MSK IINF SIM PRIMAL DUAL INF ITER

The number of master iterations with dual infeasibility taken by the primal dual simplex algo-rithm.

MSK IINF SIM PRIMAL DUAL ITER

Number of primal dual simplex iterations during the last optimization.

MSK IINF SIM PRIMAL HOTSTART

If 1 then the primal simplex algorithm is solving from an advanced basis.

Page 437: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

25.13. INTEGER INFORMATION ITEMS. 419

MSK IINF SIM PRIMAL HOTSTART LU

If 1 then a valid basis factorization of full rank was located and used by the primal simplexalgorithm.

MSK IINF SIM PRIMAL INF ITER

The number of iterations taken with primal infeasibility.

MSK IINF SIM PRIMAL ITER

Number of primal simplex iterations during the last optimization.

MSK IINF SIM SOLVE DUAL

Is non-zero if dual problem is solved.

MSK IINF SOL BAS PROSTA

Problem status of the basic solution. Updated after each optimization.

MSK IINF SOL BAS SOLSTA

Solution status of the basic solution. Updated after each optimization.

MSK IINF SOL INT PROSTA

Deprecated.

MSK IINF SOL INT SOLSTA

Degrecated.

MSK IINF SOL ITG PROSTA

Problem status of the integer solution. Updated after each optimization.

MSK IINF SOL ITG SOLSTA

Solution status of the integer solution. Updated after each optimization.

MSK IINF SOL ITR PROSTA

Problem status of the interior-point solution. Updated after each optimization.

MSK IINF SOL ITR SOLSTA

Solution status of the interior-point solution. Updated after each optimization.

MSK IINF STO NUM A CACHE FLUSHES

Number of times the cache of A elements is flushed. A large number implies that maxnumanz istoo small as well as an inefficient usage of MOSEK.

MSK IINF STO NUM A REALLOC

Number of times the storage for storing A has been changed. A large value may indicates thatmemory fragmentation may occur.

MSK IINF STO NUM A TRANSPOSES

Number of times the A matrix is transposed. A large number implies that maxnumanz is too smallor an inefficient usage of MOSEK. This will occur in particular if the code alternate betweenaccessing rows and columns of A.

Page 438: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

420 CHAPTER 25. API CONSTANTS

25.14 Information item types

MSK INF DOU TYPE

Is a double information type.

MSK INF INT TYPE

Is an integer.

MSK INF LINT TYPE

Is a long integer.

25.15 Hot-start type employed by the interior-point optimiz-ers.

MSK INTPNT HOTSTART NONE

The interior-point optimizer performs a coldstart.

MSK INTPNT HOTSTART PRIMAL

The interior-point optimizer exploits the primal solution only.

MSK INTPNT HOTSTART DUAL

The interior-point optimizer exploits the dual solution only.

MSK INTPNT HOTSTART PRIMAL DUAL

The interior-point optimizer exploits both the primal and dual solution.

25.16 Input/output modes

MSK IOMODE READ

The file is read-only.

MSK IOMODE WRITE

The file is write-only. If the file exists then it is truncated when it is opened. Otherwise it iscreated when it is opened.

MSK IOMODE READWRITE

The file is to read and written.

Page 439: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

25.17. LANGUAGE SELECTION CONSTANTS 421

25.17 Language selection constants

MSK LANG ENG

English language selection

MSK LANG DAN

Danish language selection

25.18 Long integer information items.

MSK LIINF BI CLEAN DUAL DEG ITER

Number of dual degenerate clean iterations performed in the basis identification.

MSK LIINF BI CLEAN DUAL ITER

Number of dual clean iterations performed in the basis identification.

MSK LIINF BI CLEAN PRIMAL DEG ITER

Number of primal degenerate clean iterations performed in the basis identification.

MSK LIINF BI CLEAN PRIMAL DUAL DEG ITER

Number of primal-dual degenerate clean iterations performed in the basis identification.

MSK LIINF BI CLEAN PRIMAL DUAL ITER

Number of primal-dual clean iterations performed in the basis identification.

MSK LIINF BI CLEAN PRIMAL DUAL SUB ITER

Number of primal-dual subproblem clean iterations performed in the basis identification.

MSK LIINF BI CLEAN PRIMAL ITER

Number of primal clean iterations performed in the basis identification.

MSK LIINF BI DUAL ITER

Number of dual pivots performed in the basis identification.

MSK LIINF BI PRIMAL ITER

Number of primal pivots performed in the basis identification.

MSK LIINF INTPNT FACTOR NUM NZ

Number of non-zeros in factorization.

MSK LIINF MIO INTPNT ITER

Number of interior-point iterations performed by the mixed-integer optimizer.

MSK LIINF MIO SIMPLEX ITER

Number of simplex iterations performed by the mixed-integer optimizer.

Page 440: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

422 CHAPTER 25. API CONSTANTS

MSK LIINF RD NUMANZ

Number of non-zeros in A that is read.

MSK LIINF RD NUMQNZ

Number of Q non-zeros.

25.19 Mark

MSK MARK LO

The lower bound is selected for sensitivity analysis.

MSK MARK UP

The upper bound is selected for sensitivity analysis.

25.20 Continuous mixed-integer solution type

MSK MIO CONT SOL NONE

No interior-point or basic solution are reported when the mixed-integer optimizer is used.

MSK MIO CONT SOL ROOT

The reported interior-point and basic solutions are a solution to the root node problem whenmixed-integer optimizer is used.

MSK MIO CONT SOL ITG

The reported interior-point and basic solutions are a solution to the problem with all integervariables fixed at the value they have in the integer solution. A solution is only reported in casethe problem has a primal feasible solution.

MSK MIO CONT SOL ITG REL

In case the problem is primal feasible then the reported interior-point and basic solutions area solution to the problem with all integer variables fixed at the value they have in the integersolution. If the problem is primal infeasible, then the solution to the root node problem isreported.

25.21 Integer restrictions

MSK MIO MODE IGNORED

The integer constraints are ignored and the problem is solved as a continuous problem.

MSK MIO MODE SATISFIED

Integer restrictions should be satisfied.

Page 441: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

25.22. MIXED-INTEGER NODE SELECTION TYPES 423

MSK MIO MODE LAZY

Integer restrictions should be satisfied if an optimizer is available for the problem.

25.22 Mixed-integer node selection types

MSK MIO NODE SELECTION FREE

The optimizer decides the node selection strategy.

MSK MIO NODE SELECTION FIRST

The optimizer employs a depth first node selection strategy.

MSK MIO NODE SELECTION BEST

The optimizer employs a best bound node selection strategy.

MSK MIO NODE SELECTION WORST

The optimizer employs a worst bound node selection strategy.

MSK MIO NODE SELECTION HYBRID

The optimizer employs a hybrid strategy.

MSK MIO NODE SELECTION PSEUDO

The optimizer employs selects the node based on a pseudo cost estimate.

25.23 MPS file format type

MSK MPS FORMAT STRICT

It is assumed that the input file satisfies the MPS format strictly.

MSK MPS FORMAT RELAXED

It is assumed that the input file satisfies a slightly relaxed version of the MPS format.

MSK MPS FORMAT FREE

It is assumed that the input file satisfies the free MPS format. This implies that spaces are notallowed in names. Otherwise the format is free.

25.24 Message keys

MSK MSG READING FILE

MSK MSG WRITING FILE

MSK MSG MPS SELECTED

Page 442: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

424 CHAPTER 25. API CONSTANTS

25.25 Cone types

MSK NAME TYPE GEN

General names. However, no duplicate and blank names are allowed.

MSK NAME TYPE MPS

MPS type names.

MSK NAME TYPE LP

LP type names.

25.26 Objective sense types

MSK OBJECTIVE SENSE MINIMIZE

The problem should be minimized.

MSK OBJECTIVE SENSE MAXIMIZE

The problem should be maximized.

25.27 On/off

MSK OFF

Switch the option off.

MSK ON

Switch the option on.

25.28 Optimizer types

MSK OPTIMIZER FREE

The optimizer is chosen automatically.

MSK OPTIMIZER INTPNT

The interior-point optimizer is used.

MSK OPTIMIZER CONIC

The optimizer for problems having conic constraints.

MSK OPTIMIZER PRIMAL SIMPLEX

The primal simplex optimizer is used.

Page 443: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

25.29. ORDERING STRATEGIES 425

MSK OPTIMIZER DUAL SIMPLEX

The dual simplex optimizer is used.

MSK OPTIMIZER PRIMAL DUAL SIMPLEX

The primal dual simplex optimizer is used.

MSK OPTIMIZER FREE SIMPLEX

One of the simplex optimizers is used.

MSK OPTIMIZER NETWORK PRIMAL SIMPLEX

The network primal simplex optimizer is used. It is only applicable to pute network problems.

MSK OPTIMIZER MIXED INT CONIC

The mixed-integer optimizer for conic and linear problems.

MSK OPTIMIZER MIXED INT

The mixed-integer optimizer.

MSK OPTIMIZER CONCURRENT

The optimizer for nonconvex nonlinear problems.

MSK OPTIMIZER NONCONVEX

The optimizer for nonconvex nonlinear problems.

25.29 Ordering strategies

MSK ORDER METHOD FREE

The ordering method is chosen automatically.

MSK ORDER METHOD APPMINLOC

Approximate minimum local fill-in ordering is employed.

MSK ORDER METHOD EXPERIMENTAL

This option should not be used.

MSK ORDER METHOD TRY GRAPHPAR

Always try the the graph partitioning based ordering.

MSK ORDER METHOD FORCE GRAPHPAR

Always use the graph partitioning based ordering even if it is worse that the approximate mini-mum local fill ordering.

MSK ORDER METHOD NONE

No ordering is used.

Page 444: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

426 CHAPTER 25. API CONSTANTS

25.30 Parameter type

MSK PAR INVALID TYPE

Not a valid parameter.

MSK PAR DOU TYPE

Is a double parameter.

MSK PAR INT TYPE

Is an integer parameter.

MSK PAR STR TYPE

Is a string parameter.

25.31 Presolve method.

MSK PRESOLVE MODE OFF

The problem is not presolved before it is optimized.

MSK PRESOLVE MODE ON

The problem is presolved before it is optimized.

MSK PRESOLVE MODE FREE

It is decided automatically whether to presolve before the problem is optimized.

25.32 Problem data items

MSK PI VAR

Item is a variable.

MSK PI CON

Item is a constraint.

MSK PI CONE

Item is a cone.

25.33 Problem types

MSK PROBTYPE LO

The problem is a linear optimization problem.

Page 445: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

25.34. PROBLEM STATUS KEYS 427

MSK PROBTYPE QO

The problem is a quadratic optimization problem.

MSK PROBTYPE QCQO

The problem is a quadratically constrained optimization problem.

MSK PROBTYPE GECO

General convex optimization.

MSK PROBTYPE CONIC

A conic optimization.

MSK PROBTYPE MIXED

General nonlinear constraints and conic constraints. This combination can not be solved byMOSEK.

25.34 Problem status keys

MSK PRO STA UNKNOWN

Unknown problem status.

MSK PRO STA PRIM AND DUAL FEAS

The problem is primal and dual feasible.

MSK PRO STA PRIM FEAS

The problem is primal feasible.

MSK PRO STA DUAL FEAS

The problem is dual feasible.

MSK PRO STA PRIM INFEAS

The problem is primal infeasible.

MSK PRO STA DUAL INFEAS

The problem is dual infeasible.

MSK PRO STA PRIM AND DUAL INFEAS

The problem is primal and dual infeasible.

MSK PRO STA ILL POSED

The problem is ill-posed. For example, it may be primal and dual feasible but have a positiveduality gap.

MSK PRO STA NEAR PRIM AND DUAL FEAS

The problem is at least nearly primal and dual feasible.

Page 446: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

428 CHAPTER 25. API CONSTANTS

MSK PRO STA NEAR PRIM FEAS

The problem is at least nearly primal feasible.

MSK PRO STA NEAR DUAL FEAS

The problem is at least nearly dual feasible.

MSK PRO STA PRIM INFEAS OR UNBOUNDED

The problem is either primal infeasible or unbounded. This may occur for mixed-integer prob-lems.

25.35 Response code type

MSK RESPONSE OK

The response code is OK.

MSK RESPONSE WRN

The response code is a warning.

MSK RESPONSE TRM

The response code is an optimizer termination status.

MSK RESPONSE ERR

The response code is an error.

MSK RESPONSE UNK

The response code does not belong to any class.

25.36 Scaling type

MSK SCALING METHOD POW2

Scales only with power of 2 leaving the mantissa untouched.

MSK SCALING METHOD FREE

The optimizer chooses the scaling heuristic.

25.37 Scaling type

MSK SCALING FREE

The optimizer chooses the scaling heuristic.

Page 447: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

25.38. SENSITIVITY TYPES 429

MSK SCALING NONE

No scaling is performed.

MSK SCALING MODERATE

A conservative scaling is performed.

MSK SCALING AGGRESSIVE

A very aggressive scaling is performed.

25.38 Sensitivity types

MSK SENSITIVITY TYPE BASIS

Basis sensitivity analysis is performed.

MSK SENSITIVITY TYPE OPTIMAL PARTITION

Optimal partition sensitivity analysis is performed.

25.39 Degeneracy strategies

MSK SIM DEGEN NONE

The simplex optimizer should use no degeneration strategy.

MSK SIM DEGEN FREE

The simplex optimizer chooses the degeneration strategy.

MSK SIM DEGEN AGGRESSIVE

The simplex optimizer should use an aggressive degeneration strategy.

MSK SIM DEGEN MODERATE

The simplex optimizer should use a moderate degeneration strategy.

MSK SIM DEGEN MINIMUM

The simplex optimizer should use a minimum degeneration strategy.

25.40 Exploit duplicate columns.

MSK SIM EXPLOIT DUPVEC OFF

Disallow the simplex optimizer to exploit duplicated columns.

MSK SIM EXPLOIT DUPVEC ON

Allow the simplex optimizer to exploit duplicated columns.

Page 448: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

430 CHAPTER 25. API CONSTANTS

MSK SIM EXPLOIT DUPVEC FREE

The simplex optimizer can choose freely.

25.41 Hot-start type employed by the simplex optimizer

MSK SIM HOTSTART NONE

The simplex optimizer performs a coldstart.

MSK SIM HOTSTART FREE

The simplex optimize chooses the hot-start type.

MSK SIM HOTSTART STATUS KEYS

Only the status keys of the constraints and variables are used to choose the type of hot-start.

25.42 Problem reformulation.

MSK SIM REFORMULATION OFF

Disallow the simplex optimizer to reformulate the problem.

MSK SIM REFORMULATION ON

Allow the simplex optimizer to reformulate the problem.

MSK SIM REFORMULATION FREE

The simplex optimizer can choose freely.

MSK SIM REFORMULATION AGGRESSIVE

The simplex optimizer should use an aggressive reformulation strategy.

25.43 Simplex selection strategy

MSK SIM SELECTION FREE

The optimizer chooses the pricing strategy.

MSK SIM SELECTION FULL

The optimizer uses full pricing.

MSK SIM SELECTION ASE

The optimizer uses approximate steepest-edge pricing.

MSK SIM SELECTION DEVEX

The optimizer uses devex steepest-edge pricing (or if it is not available an approximate steep-edgeselection).

Page 449: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

25.44. SOLUTION ITEMS 431

MSK SIM SELECTION SE

The optimizer uses steepest-edge selection (or if it is not available an approximate steep-edgeselection).

MSK SIM SELECTION PARTIAL

The optimizer uses a partial selection approach. The approach is usually beneficial if the numberof variables is much larger than the number of constraints.

25.44 Solution items

MSK SOL ITEM XC

Solution for the constraints.

MSK SOL ITEM XX

Variable solution.

MSK SOL ITEM Y

Lagrange multipliers for equations.

MSK SOL ITEM SLC

Lagrange multipliers for lower bounds on the constraints.

MSK SOL ITEM SUC

Lagrange multipliers for upper bounds on the constraints.

MSK SOL ITEM SLX

Lagrange multipliers for lower bounds on the variables.

MSK SOL ITEM SUX

Lagrange multipliers for upper bounds on the variables.

MSK SOL ITEM SNX

Lagrange multipliers corresponding to the conic constraints on the variables.

25.45 Solution status keys

MSK SOL STA UNKNOWN

Status of the solution is unknown.

MSK SOL STA OPTIMAL

The solution is optimal.

Page 450: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

432 CHAPTER 25. API CONSTANTS

MSK SOL STA PRIM FEAS

The solution is primal feasible.

MSK SOL STA DUAL FEAS

The solution is dual feasible.

MSK SOL STA PRIM AND DUAL FEAS

The solution is both primal and dual feasible.

MSK SOL STA PRIM INFEAS CER

The solution is a certificate of primal infeasibility.

MSK SOL STA DUAL INFEAS CER

The solution is a certificate of dual infeasibility.

MSK SOL STA NEAR OPTIMAL

The solution is nearly optimal.

MSK SOL STA NEAR PRIM FEAS

The solution is nearly primal feasible.

MSK SOL STA NEAR DUAL FEAS

The solution is nearly dual feasible.

MSK SOL STA NEAR PRIM AND DUAL FEAS

The solution is nearly both primal and dual feasible.

MSK SOL STA NEAR PRIM INFEAS CER

The solution is almost a certificate of primal infeasibility.

MSK SOL STA NEAR DUAL INFEAS CER

The solution is almost a certificate of dual infeasibility.

MSK SOL STA INTEGER OPTIMAL

The primal solution is integer optimal.

MSK SOL STA NEAR INTEGER OPTIMAL

The primal solution is near integer optimal.

Page 451: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

25.46. SOLUTION TYPES 433

25.46 Solution types

MSK SOL ITR

The interior solution.

MSK SOL BAS

The basic solution.

MSK SOL ITG

The integer solution.

25.47 Solve primal or dual form

MSK SOLVE FREE

The optimizer is free to solve either the primal or the dual problem.

MSK SOLVE PRIMAL

The optimizer should solve the primal problem.

MSK SOLVE DUAL

The optimizer should solve the dual problem.

25.48 Status keys

MSK SK UNK

The status for the constraint or variable is unknown.

MSK SK BAS

The constraint or variable is in the basis.

MSK SK SUPBAS

The constraint or variable is super basic.

MSK SK LOW

The constraint or variable is at its lower bound.

MSK SK UPR

The constraint or variable is at its upper bound.

MSK SK FIX

The constraint or variable is fixed.

MSK SK INF

The constraint or variable is infeasible in the bounds.

Page 452: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

434 CHAPTER 25. API CONSTANTS

25.49 Starting point types

MSK STARTING POINT FREE

The starting point is chosen automatically.

MSK STARTING POINT GUESS

The optimizer guesses a starting point.

MSK STARTING POINT CONSTANT

The optimizer constructs a starting point by assigning a constant value to all primal and dualvariables. This starting point is normally robust.

MSK STARTING POINT SATISFY BOUNDS

The starting point is choosen to satisfy all the simple bounds on nonlinear variables. If thisstarting point is employed, then more care than usual should employed when choosing the boundson the nonlinear variables. In particular very tight bounds should be avoided.

25.50 Stream types

MSK STREAM LOG

Log stream. Contains the aggregated contents of all other streams. This means that a messagewritten to any other stream will also be written to this stream.

MSK STREAM MSG

Message stream. Log information relating to performance and progress of the optimization iswritten to this stream.

MSK STREAM ERR

Error stream. Error messages are written to this stream.

MSK STREAM WRN

Warning stream. Warning messages are written to this stream.

25.51 Cone types

MSK SYMMAT TYPE SPARSE

Sparse symmetric matrix.

Page 453: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

25.52. INTEGER VALUES 435

25.52 Integer values

MSK LICENSE BUFFER LENGTH

The length of a license key buffer.

MSK MAX STR LEN

Maximum string length allowed in MOSEK.

25.53 Variable types

MSK VAR TYPE CONT

Is a continuous variable.

MSK VAR TYPE INT

Is an integer variable.

25.54 XML writer output mode

MSK WRITE XML MODE ROW

Write in row order.

MSK WRITE XML MODE COL

Write in column order.

Page 454: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

436 CHAPTER 25. API CONSTANTS

Page 455: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

Chapter 26

Problem analyzer examples

This appendix presents a few examples of the output produced by the problem analyzer described inSection 14.1. The first two problems are taken from the MIPLIB 2003 collection, http://miplib.zib.de/.

26.1 air04

Analyzing the problem

Constraints Bounds Variables

fixed : all ranged : all bin : all

-------------------------------------------------------------------------------

Objective, min cx

range: min |c|: 31.0000 max |c|: 2258.00

distrib: |c| vars

[31, 100) 176

[100, 1e+03) 8084

[1e+03, 2.26e+03] 644

-------------------------------------------------------------------------------

Constraint matrix A has

823 rows (constraints)

8904 columns (variables)

72965 (0.995703%) nonzero entries (coefficients)

Row nonzeros, A i

range: min A i: 2 (0.0224618%) max A i: 368 (4.13297%)

distrib: A i rows rows% acc%

2 2 0.24 0.24

[3, 7] 4 0.49 0.73

[8, 15] 19 2.31 3.04

[16, 31] 80 9.72 12.76

[32, 63] 236 28.68 41.43

[64, 127] 289 35.12 76.55

437

Page 456: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

438 CHAPTER 26. PROBLEM ANALYZER EXAMPLES

[128, 255] 186 22.60 99.15

[256, 368] 7 0.85 100.00

Column nonzeros, A|j

range: min A|j: 2 (0.243013%) max A|j: 15 (1.8226%)

distrib: A|j cols cols% acc%

2 118 1.33 1.33

[3, 7] 2853 32.04 33.37

[8, 15] 5933 66.63 100.00

A nonzeros, A(ij)

range: all |A(ij)| = 1.00000

-------------------------------------------------------------------------------

Constraint bounds, lb <= Ax <= ub

distrib: |b| lbs ubs

[1, 10] 823 823

Variable bounds, lb <= x <= ub

distrib: |b| lbs ubs

0 8904

[1, 10] 8904

-------------------------------------------------------------------------------

26.2 arki001

Analyzing the problem

Constraints Bounds Variables

lower bd: 82 lower bd: 38 cont: 850

upper bd: 946 fixed : 353 bin : 415

fixed : 20 free : 1 int : 123

ranged : 996

-------------------------------------------------------------------------------

Objective, min cx

range: all |c| in 0.00000, 1.00000distrib: |c| vars

0 1387

1 1

-------------------------------------------------------------------------------

Constraint matrix A has

1048 rows (constraints)

1388 columns (variables)

20439 (1.40511%) nonzero entries (coefficients)

Row nonzeros, A i

range: min A i: 1 (0.0720461%) max A i: 1046 (75.3602%)

distrib: A i rows rows% acc%

1 29 2.77 2.77

Page 457: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

26.2. ARKI001 439

2 476 45.42 48.19

[3, 7] 49 4.68 52.86

[8, 15] 56 5.34 58.21

[16, 31] 64 6.11 64.31

[32, 63] 373 35.59 99.90

[1024, 1046] 1 0.10 100.00

Column nonzeros, A|j

range: min A|j: 1 (0.0954198%) max A|j: 29 (2.76718%)

distrib: A|j cols cols% acc%

1 381 27.45 27.45

2 19 1.37 28.82

[3, 7] 38 2.74 31.56

[8, 15] 233 16.79 48.34

[16, 29] 717 51.66 100.00

A nonzeros, A(ij)

range: min |A(ij)|: 0.000200000 max |A(ij)|: 2.33067e+07

distrib: A(ij) coeffs

[0.0002, 0.001) 167

[0.001, 0.01) 1049

[0.01, 0.1) 4553

[0.1, 1) 8840

[1, 10) 3822

[10, 100) 630

[100, 1e+03) 267

[1e+03, 1e+04) 699

[1e+04, 1e+05) 291

[1e+05, 1e+06) 83

[1e+06, 1e+07) 19

[1e+07, 2.33e+07] 19

-------------------------------------------------------------------------------

Constraint bounds, lb <= Ax <= ub

distrib: |b| lbs ubs

[0.1, 1) 386

[1, 10) 74

[10, 100) 101 456

[100, 1000) 34

[1000, 10000) 15

[100000, 1e+06] 1 1

Variable bounds, lb <= x <= ub

distrib: |b| lbs ubs

0 974 323

[0.001, 0.01) 19

[0.1, 1) 370 57

[1, 10) 41 704

[10, 100] 2 246

-------------------------------------------------------------------------------

Page 458: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

440 CHAPTER 26. PROBLEM ANALYZER EXAMPLES

26.3 Problem with both linear and quadratic constraints

Analyzing the problem

Constraints Bounds Variables

lower bd: 40 upper bd: 1 cont: all

upper bd: 121 fixed : 204

fixed : 5480 free : 5600

ranged : 161 ranged : 40

-------------------------------------------------------------------------------

Objective, maximize cx

range: all |c| in 0.00000, 15.4737distrib: |c| vars

0 5844

15.4737 1

-------------------------------------------------------------------------------

Constraint matrix A has

5802 rows (constraints)

5845 columns (variables)

6480 (0.0191079%) nonzero entries (coefficients)

Row nonzeros, A i

range: min A i: 0 (0%) max A i: 3 (0.0513259%)

distrib: A i rows rows% acc%

0 80 1.38 1.38

1 5003 86.23 87.61

2 680 11.72 99.33

3 39 0.67 100.00

0/80 empty rows have quadratic terms

Column nonzeros, A|j

range: min A|j: 0 (0%) max A|j: 15 (0.258532%)

distrib: A|j cols cols% acc%

0 204 3.49 3.49

1 5521 94.46 97.95

2 40 0.68 98.63

[3, 7] 40 0.68 99.32

[8, 15] 40 0.68 100.00

0/204 empty columns correspond to variables used in conic

and/or quadratic expressions only

A nonzeros, A(ij)

range: min |A(ij)|: 2.02410e-05 max |A(ij)|: 35.8400

distrib: A(ij) coeffs

[2.02e-05, 0.0001) 40

[0.0001, 0.001) 118

[0.001, 0.01) 305

[0.01, 0.1) 176

[0.1, 1) 40

[1, 10) 5721

[10, 35.8] 80

-------------------------------------------------------------------------------

Page 459: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

26.4. PROBLEM WITH BOTH LINEAR AND CONIC CONSTRAINTS 441

Constraint bounds, lb <= Ax <= ub

distrib: |b| lbs ubs

0 5481 5600

[1000, 10000) 1

[10000, 100000) 2 1

[1e+06, 1e+07) 78 40

[1e+08, 1e+09] 120 120

Variable bounds, lb <= x <= ub

distrib: |b| lbs ubs

0 243 203

[0.1, 1) 1 1

[1e+06, 1e+07) 40

[1e+11, 1e+12] 1

-------------------------------------------------------------------------------

Quadratic constraints: 121

Gradient nonzeros, Qx

range: min Qx: 1 (0.0171086%) max Qx: 2720 (46.5355%)

distrib: Qx cons cons% acc%

1 40 33.06 33.06

[64, 127] 80 66.12 99.17

[2048, 2720] 1 0.83 100.00

-------------------------------------------------------------------------------

26.4 Problem with both linear and conic constraints

Analyzing the problem

Constraints Bounds Variables

upper bd: 3600 fixed : 3601 cont: all

fixed : 21760 free : 28802

-------------------------------------------------------------------------------

Objective, minimize cx

range: all |c| in 0.00000, 1.00000distrib: |c| vars

0 32402

1 1

-------------------------------------------------------------------------------

Constraint matrix A has

25360 rows (constraints)

32403 columns (variables)

93339 (0.0113587%) nonzero entries (coefficients)

Row nonzeros, A i

range: min A i: 1 (0.00308613%) max A i: 8 (0.0246891%)

Page 460: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

442 CHAPTER 26. PROBLEM ANALYZER EXAMPLES

distrib: A i rows rows% acc%

1 3600 14.20 14.20

2 10803 42.60 56.79

[3, 7] 3995 15.75 72.55

8 6962 27.45 100.00

Column nonzeros, A|j

range: min A|j: 0 (0%) max A|j: 61 (0.240536%)

distrib: A|j cols cols% acc%

0 3602 11.12 11.12

1 10800 33.33 44.45

2 7200 22.22 66.67

[3, 7] 7279 22.46 89.13

[8, 15] 3521 10.87 100.00

[32, 61] 1 0.00 100.00

3600/3602 empty columns correspond to variables used in conic

and/or quadratic constraints only

A nonzeros, A(ij)

range: min |A(ij)|: 0.00833333 max |A(ij)|: 1.00000

distrib: A(ij) coeffs

[0.00833, 0.01) 57280

[0.01, 0.1) 59

[0.1, 1] 36000

-------------------------------------------------------------------------------

Constraint bounds, lb <= Ax <= ub

distrib: |b| lbs ubs

0 21760 21760

[0.1, 1] 3600

Variable bounds, lb <= x <= ub

distrib: |b| lbs ubs

[1, 10] 3601 3601

-------------------------------------------------------------------------------

-------------------------------------------------------------------------------

Rotated quadratic cones: 3600

dim RQCs

4 3600

Page 461: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

Bibliography

[1] Chvatal, V.. Linear programming, 1983. W.H. Freeman and Company

[2] Nazareth, J. L.. Computer Solution of Linear Programs, 1987. Oxford University Press,New York

[3] Bazaraa, M. S., Sherali, H. D. and Shetty, C. M.. Nonlinear programming: Theory andalgorithms, 2 edition, 1993. John Wiley and Sons, New York

[4] Williams, H. P.. Model building in mathematical programming, 3 edition, 1993. JohnWiley and Sons

[5] Wolsey, L. A.. Integer programming, 1998. John Wiley and Sons

[6] Ben-Tal, A. and Nemirovski, A.. Robust solutions of Linear Programming problems con-taminated with uncertain data. Math. Programming 3:411-424

[7] Ben-Tal, A. and Nemirovski, A. Lectures on Modern Convex Optimization: Analysis,Algorithms, and Engineering Applications, 2001. SIAM

[8] Boyd, S.P., Kim, S.J., Vandenberghe, L. and Hassibi, A.. A Tutorial on Geometric Pro-gramming., 2004. ISL, Electrical Engineering Department, Stanford University, Stanford,CA. Available at http://www.stanford.edu/ boyd/gp tutorial.html

[9] Beightler, C. and Phillips, D. T.. Applied geometric programming, 1976. John Wiley andSons, New York

[10] Andersen, E. D. and Andersen, K. D.. Presolving in linear programming. Math. Program-ming 2:221-245

[11] Andersen, E. D., Gondzio, J., Meszaros, Cs. and Xu, X.. Implementation of interiorpoint methods for large scale linear programming, Interior-point methods of mathematicalprogramming p. 189-252, 1996. Kluwer Academic Publishers

[12] Erling D. Andersen. The homogeneous and self-dual model and algorithmfor linear optimization. Technical report TR-1-2009, 2009. MOSEK ApS.http://www.mosek.com/fileadmin/reports/tech/homolo.pdf

[13] Andersen, E. D. and Ye, Y.. Combining interior-point and pivoting algorithms. Manage-ment Sci. December 12:1719-1731

443

Page 462: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

444 BIBLIOGRAPHY

[14] Ahuja, R. K., Magnanti, T. L. and Orlin, J. B.. Network flows, Optimization, vol. 1 p.211-369, 1989. North Holland, Amsterdam

[15] Andersen, E. D., Roos, C. and Terlaky, T.. On implementing a primal-dual interior-pointmethod for conic quadratic optimization. Math. Programming February 2

[16] Andersen, E. D. and Ye, Y.. A computational study of the homogeneous algorithm forlarge-scale convex optimization. Computational Optimization and Applications 10:243-269

[17] Andersen, E. D. and Ye, Y.. On a homogeneous algorithm for the monotone complemen-tarity problem. Math. Programming February 2:375-399

[18] Roos, C., Terlaky, T. and Vial, J. -Ph.. Theory and algorithms for linear optimization:an interior point approach, 1997. John Wiley and Sons, New York

[19] Wallace, S. W.. Decision making under uncertainty: Is sensitivity of any use. Oper. Res.January 1:20-25

[20] MOSEK ApS. MOSEK Modeling manual, 2012. Last revised January 31 2013.http://docs.mosek.com/generic/modeling-a4.pdf

Page 463: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

Index

basis identification, 136bintprog, 98bounds, infinite, 194

certificatedual, 196, 199, 201, 203primal, 196, 199, 201

class, 19, 21, 23, 26, 48, 49, 77, 83–86, 88–90, 93complementarity conditions, 195concurrent optimization, 143concurrent solution, 142conic

optimization, 197problem, 197

constraintmatrix, 193, 204, 207quadratic, 202

constraintslower limit, 193, 204, 207upper limit, 193, 204, 207

continuous relaxation, 147copyright, ii

disclaimer, iidual certificate, 196, 199, 201, 203dual feasible, 194dual infeasible, 194, 196, 199, 201, 203duality gap, 194dualizer, 131

eliminator, 131example

ill-posed, 172linear dependency, 171

feasibility repair, 171feasible, dual, 194feasible, primal, 194

help desk, 17hot-start, 138

ill-posedexample, 172

infeasible, 161dual, 196, 199, 201, 203primal, 196, 199, 201

infeasible problem, 171infeasible problems, 161infeasible, dual, 194infeasible, primal, 194infinite bounds, 194integer optimization, 147

relaxation, 147interior-point optimizer, 133, 140, 141interior-point or simplex optimizer, 139

linear dependency, 131example, 171

linear dependency check, 131linear problem, 193linearity interval, 180linprog, 94LP format, 219

maximization problem, 195mixed-integer optimization, 147MPS format, 207

compBOUNDS, 214compCOLUMNS, 210free, 218compNAME, 209compOBJNAME, 210compOBJSENSE, 209compQSECTION, 212compRANGES, 212compRHS, 211

445

Page 464: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

446 INDEX

compROWS, 210

Network flow problemsoptimizing, 140

objectivevector, 193

objective sensemaximize, 195

objective vector, 204OPF format, 227optimal solution, 195optimality gap, 153, 194optimization

conic, 197integer, 147mixed-integer, 147

optimizersconcurrent, 143conic interior-point, 140convex interior-point, 141linear interior-point, 133parallel, 143simplex, 138

Optimizingnetwork flow problems, 140

parallel extensions, 142parallel interior-point, 132parallel optimizers

interior point, 132parallel solution, 142posynomial, 123presolve, 130

eliminator, 131linear dependency check, 131numerical issues, 130

primal certificate, 196, 199, 201primal feasible, 194primal infeasible, 171, 194, 196, 199, 201primal-dual solution, 194

quadratic constraint, 202quadratic optimization, 202

relaxation, continuous, 147Response codes

MSK RES ERR AD INVALID CODELIST, 367MSK RES ERR AD INVALID OPERAND, 367MSK RES ERR AD INVALID OPERATOR,

367MSK RES ERR AD MISSING OPERAND, 367MSK RES ERR AD MISSING RETURN, 367MSK RES ERR API ARRAY TOO SMALL,

367MSK RES ERR API CB CONNECT, 367MSK RES ERR API FATAL ERROR, 367MSK RES ERR API INTERNAL, 367MSK RES ERR ARG IS TOO LARGE, 367MSK RES ERR ARG IS TOO SMALL, 368MSK RES ERR ARGUMENT DIMENSION,

368MSK RES ERR ARGUMENT IS TOO LARGE,

368MSK RES ERR ARGUMENT LENNEQ, 368MSK RES ERR ARGUMENT PERM ARRAY,

368MSK RES ERR ARGUMENT TYPE, 368MSK RES ERR BAR VAR DIM, 368MSK RES ERR BASIS, 368MSK RES ERR BASIS FACTOR, 368MSK RES ERR BASIS SINGULAR, 368MSK RES ERR BLANK NAME, 368MSK RES ERR CANNOT CLONE NL, 368MSK RES ERR CANNOT HANDLE NL, 368MSK RES ERR CON Q NOT NSD, 368MSK RES ERR CON Q NOT PSD, 369MSK RES ERR CONCURRENT OPTIMIZER,

369MSK RES ERR CONE INDEX, 369MSK RES ERR CONE OVERLAP, 369MSK RES ERR CONE OVERLAP APPEND,

369MSK RES ERR CONE REP VAR, 369MSK RES ERR CONE SIZE, 369MSK RES ERR CONE TYPE, 369MSK RES ERR CONE TYPE STR, 369MSK RES ERR DATA FILE EXT, 369MSK RES ERR DUP NAME, 369MSK RES ERR DUPLICATE BARVARIABLE NAMES,

369MSK RES ERR DUPLICATE CONE NAMES,

369

Page 465: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

INDEX 447

MSK RES ERR DUPLICATE CONSTRAINT NAMES,369

MSK RES ERR DUPLICATE VARIABLE NAMES,369

MSK RES ERR END OF FILE, 370MSK RES ERR FACTOR, 370MSK RES ERR FEASREPAIR CANNOT RELAX,

370MSK RES ERR FEASREPAIR INCONSISTENT BOUND,

370MSK RES ERR FEASREPAIR SOLVING RELAXED,

370MSK RES ERR FILE LICENSE, 370MSK RES ERR FILE OPEN, 370MSK RES ERR FILE READ, 370MSK RES ERR FILE WRITE, 370MSK RES ERR FIRST, 370MSK RES ERR FIRSTI, 370MSK RES ERR FIRSTJ, 370MSK RES ERR FIXED BOUND VALUES, 370MSK RES ERR FLEXLM, 370MSK RES ERR GLOBAL INV CONIC PROBLEM,

371MSK RES ERR HUGE AIJ, 371MSK RES ERR HUGE C, 371MSK RES ERR IDENTICAL TASKS, 371MSK RES ERR IN ARGUMENT, 371MSK RES ERR INDEX, 371MSK RES ERR INDEX ARR IS TOO LARGE,

371MSK RES ERR INDEX ARR IS TOO SMALL,

371MSK RES ERR INDEX IS TOO LARGE, 371MSK RES ERR INDEX IS TOO SMALL, 371MSK RES ERR INF DOU INDEX, 371MSK RES ERR INF DOU NAME, 371MSK RES ERR INF INT INDEX, 371MSK RES ERR INF INT NAME, 371MSK RES ERR INF LINT INDEX, 371MSK RES ERR INF LINT NAME, 372MSK RES ERR INF TYPE, 372MSK RES ERR INFEAS UNDEFINED, 372MSK RES ERR INFINITE BOUND, 372MSK RES ERR INT64 TO INT32 CAST, 372MSK RES ERR INTERNAL, 372MSK RES ERR INTERNAL TEST FAILED,

372MSK RES ERR INV APTRE, 372MSK RES ERR INV BK, 372MSK RES ERR INV BKC, 372MSK RES ERR INV BKX, 372MSK RES ERR INV CONE TYPE, 372MSK RES ERR INV CONE TYPE STR, 372MSK RES ERR INV CONIC PROBLEM, 372MSK RES ERR INV MARKI, 372MSK RES ERR INV MARKJ, 373MSK RES ERR INV NAME ITEM, 373MSK RES ERR INV NUMI, 373MSK RES ERR INV NUMJ, 373MSK RES ERR INV OPTIMIZER, 373MSK RES ERR INV PROBLEM, 373MSK RES ERR INV QCON SUBI, 373MSK RES ERR INV QCON SUBJ, 373MSK RES ERR INV QCON SUBK, 373MSK RES ERR INV QCON VAL, 373MSK RES ERR INV QOBJ SUBI, 373MSK RES ERR INV QOBJ SUBJ, 373MSK RES ERR INV QOBJ VAL, 373MSK RES ERR INV SK, 373MSK RES ERR INV SK STR, 373MSK RES ERR INV SKC, 374MSK RES ERR INV SKN, 374MSK RES ERR INV SKX, 374MSK RES ERR INV VAR TYPE, 374MSK RES ERR INVALID ACCMODE, 374MSK RES ERR INVALID AMPL STUB, 374MSK RES ERR INVALID BARVAR NAME,

374MSK RES ERR INVALID BRANCH DIRECTION,

374MSK RES ERR INVALID BRANCH PRIORITY,

374MSK RES ERR INVALID COMPRESSION,

374MSK RES ERR INVALID CON NAME, 374MSK RES ERR INVALID CONE NAME, 374MSK RES ERR INVALID FILE FORMAT FOR CONES,

374MSK RES ERR INVALID FILE FORMAT FOR GENERAL NL,

374MSK RES ERR INVALID FILE FORMAT FOR SYM MAT,

374

Page 466: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

448 INDEX

MSK RES ERR INVALID FILE NAME, 374MSK RES ERR INVALID FORMAT TYPE,

375MSK RES ERR INVALID IDX, 375MSK RES ERR INVALID IOMODE, 375MSK RES ERR INVALID MAX NUM, 375MSK RES ERR INVALID NAME IN SOL FILE,

375MSK RES ERR INVALID NETWORK PROBLEM,

375MSK RES ERR INVALID OBJ NAME, 375MSK RES ERR INVALID OBJECTIVE SENSE,

375MSK RES ERR INVALID PROBLEM TYPE,

375MSK RES ERR INVALID SOL FILE NAME,

375MSK RES ERR INVALID STREAM, 375MSK RES ERR INVALID SURPLUS, 375MSK RES ERR INVALID SYM MAT DIM, 375MSK RES ERR INVALID TASK, 375MSK RES ERR INVALID UTF8, 375MSK RES ERR INVALID VAR NAME, 376MSK RES ERR INVALID WCHAR, 376MSK RES ERR INVALID WHICHSOL, 376MSK RES ERR LAST, 376MSK RES ERR LASTI, 376MSK RES ERR LASTJ, 376MSK RES ERR LICENSE, 376MSK RES ERR LICENSE CANNOT ALLOCATE,

376MSK RES ERR LICENSE CANNOT CONNECT,

376MSK RES ERR LICENSE EXPIRED, 376MSK RES ERR LICENSE FEATURE, 376MSK RES ERR LICENSE INVALID HOSTID,

376MSK RES ERR LICENSE MAX, 376MSK RES ERR LICENSE MOSEKLM DAEMON,

376MSK RES ERR LICENSE NO SERVER LINE,

376MSK RES ERR LICENSE NO SERVER SUPPORT,

377MSK RES ERR LICENSE SERVER, 377MSK RES ERR LICENSE SERVER VERSION,

377MSK RES ERR LICENSE VERSION, 377MSK RES ERR LINK FILE DLL, 377MSK RES ERR LIVING TASKS, 377MSK RES ERR LOWER BOUND IS A NAN,

377MSK RES ERR LP DUP SLACK NAME, 377MSK RES ERR LP EMPTY, 377MSK RES ERR LP FILE FORMAT, 377MSK RES ERR LP FORMAT, 377MSK RES ERR LP FREE CONSTRAINT, 377MSK RES ERR LP INCOMPATIBLE, 377MSK RES ERR LP INVALID CON NAME,

378MSK RES ERR LP INVALID VAR NAME, 378MSK RES ERR LP WRITE CONIC PROBLEM,

378MSK RES ERR LP WRITE GECO PROBLEM,

378MSK RES ERR LU MAX NUM TRIES, 378MSK RES ERR MAX LEN IS TOO SMALL,

378MSK RES ERR MAXNUMBARVAR, 378MSK RES ERR MAXNUMCON, 378MSK RES ERR MAXNUMCONE, 378MSK RES ERR MAXNUMQNZ, 378MSK RES ERR MAXNUMVAR, 378MSK RES ERR MBT INCOMPATIBLE, 378MSK RES ERR MBT INVALID, 378MSK RES ERR MIO INTERNAL, 378MSK RES ERR MIO NO OPTIMIZER, 379MSK RES ERR MIO NOT LOADED, 379MSK RES ERR MISSING LICENSE FILE, 379MSK RES ERR MIXED PROBLEM, 379MSK RES ERR MPS CONE OVERLAP, 379MSK RES ERR MPS CONE REPEAT, 379MSK RES ERR MPS CONE TYPE, 379MSK RES ERR MPS FILE, 379MSK RES ERR MPS INV BOUND KEY, 379MSK RES ERR MPS INV CON KEY, 379MSK RES ERR MPS INV FIELD, 379MSK RES ERR MPS INV MARKER, 379MSK RES ERR MPS INV SEC NAME, 379MSK RES ERR MPS INV SEC ORDER, 379MSK RES ERR MPS INVALID OBJ NAME,

379

Page 467: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

INDEX 449

MSK RES ERR MPS INVALID OBJSENSE,379

MSK RES ERR MPS MUL CON NAME, 380MSK RES ERR MPS MUL CSEC, 380MSK RES ERR MPS MUL QOBJ, 380MSK RES ERR MPS MUL QSEC, 380MSK RES ERR MPS NO OBJECTIVE, 380MSK RES ERR MPS NULL CON NAME, 380MSK RES ERR MPS NULL VAR NAME, 380MSK RES ERR MPS SPLITTED VAR, 380MSK RES ERR MPS TAB IN FIELD2, 380MSK RES ERR MPS TAB IN FIELD3, 380MSK RES ERR MPS TAB IN FIELD5, 380MSK RES ERR MPS UNDEF CON NAME,

380MSK RES ERR MPS UNDEF VAR NAME,

380MSK RES ERR MUL A ELEMENT, 380MSK RES ERR NAME IS NULL, 380MSK RES ERR NAME MAX LEN, 381MSK RES ERR NAN IN AIJ, 381MSK RES ERR NAN IN BLC, 381MSK RES ERR NAN IN BLX, 381MSK RES ERR NAN IN BUC, 381MSK RES ERR NAN IN BUX, 381MSK RES ERR NAN IN C, 381MSK RES ERR NAN IN DOUBLE DATA, 381MSK RES ERR NEGATIVE APPEND, 381MSK RES ERR NEGATIVE SURPLUS, 381MSK RES ERR NEWER DLL, 381MSK RES ERR NO BARS FOR SOLUTION,

381MSK RES ERR NO BARX FOR SOLUTION,

381MSK RES ERR NO BASIS SOL, 381MSK RES ERR NO DUAL FOR ITG SOL, 381MSK RES ERR NO DUAL INFEAS CER, 382MSK RES ERR NO DUAL INFO FOR ITG SOL,

382MSK RES ERR NO INIT ENV, 382MSK RES ERR NO OPTIMIZER VAR TYPE,

382MSK RES ERR NO PRIMAL INFEAS CER,

382MSK RES ERR NO SNX FOR BAS SOL, 382MSK RES ERR NO SOLUTION IN CALLBACK,

382MSK RES ERR NON UNIQUE ARRAY, 382MSK RES ERR NONCONVEX, 382MSK RES ERR NONLINEAR EQUALITY,

382MSK RES ERR NONLINEAR FUNCTIONS NOT ALLOWED,

382MSK RES ERR NONLINEAR RANGED, 382MSK RES ERR NR ARGUMENTS, 382MSK RES ERR NULL ENV, 382MSK RES ERR NULL POINTER, 382MSK RES ERR NULL TASK, 382MSK RES ERR NUMCONLIM, 383MSK RES ERR NUMVARLIM, 383MSK RES ERR OBJ Q NOT NSD, 383MSK RES ERR OBJ Q NOT PSD, 383MSK RES ERR OBJECTIVE RANGE, 383MSK RES ERR OLDER DLL, 383MSK RES ERR OPEN DL, 383MSK RES ERR OPF FORMAT, 383MSK RES ERR OPF NEW VARIABLE, 383MSK RES ERR OPF PREMATURE EOF, 383MSK RES ERR OPTIMIZER LICENSE, 383MSK RES ERR ORD INVALID, 383MSK RES ERR ORD INVALID BRANCH DIR,

383MSK RES ERR OVERFLOW, 383MSK RES ERR PARAM INDEX, 384MSK RES ERR PARAM IS TOO LARGE, 384MSK RES ERR PARAM IS TOO SMALL, 384MSK RES ERR PARAM NAME, 384MSK RES ERR PARAM NAME DOU, 384MSK RES ERR PARAM NAME INT, 384MSK RES ERR PARAM NAME STR, 384MSK RES ERR PARAM TYPE, 384MSK RES ERR PARAM VALUE STR, 384MSK RES ERR PLATFORM NOT LICENSED,

384MSK RES ERR POSTSOLVE, 384MSK RES ERR PRO ITEM, 384MSK RES ERR PROB LICENSE, 384MSK RES ERR QCON SUBI TOO LARGE,

384MSK RES ERR QCON SUBI TOO SMALL,

384MSK RES ERR QCON UPPER TRIANGLE,

Page 468: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

450 INDEX

385MSK RES ERR QOBJ UPPER TRIANGLE,

385MSK RES ERR READ FORMAT, 385MSK RES ERR READ LP MISSING END TAG,

385MSK RES ERR READ LP NONEXISTING NAME,

385MSK RES ERR REMOVE CONE VARIABLE,

385MSK RES ERR REPAIR INVALID PROBLEM,

385MSK RES ERR REPAIR OPTIMIZATION FAILED,

385MSK RES ERR SEN BOUND INVALID LO,

385MSK RES ERR SEN BOUND INVALID UP,

385MSK RES ERR SEN FORMAT, 385MSK RES ERR SEN INDEX INVALID, 385MSK RES ERR SEN INDEX RANGE, 385MSK RES ERR SEN INVALID REGEXP, 385MSK RES ERR SEN NUMERICAL, 385MSK RES ERR SEN SOLUTION STATUS, 386MSK RES ERR SEN UNDEF NAME, 386MSK RES ERR SEN UNHANDLED PROBLEM TYPE,

386MSK RES ERR SIZE LICENSE, 386MSK RES ERR SIZE LICENSE CON, 386MSK RES ERR SIZE LICENSE INTVAR, 386MSK RES ERR SIZE LICENSE NUMCORES,

386MSK RES ERR SIZE LICENSE VAR, 386MSK RES ERR SOL FILE INVALID NUMBER,

386MSK RES ERR SOLITEM, 386MSK RES ERR SOLVER PROBTYPE, 386MSK RES ERR SPACE, 386MSK RES ERR SPACE LEAKING, 386MSK RES ERR SPACE NO INFO, 386MSK RES ERR SYM MAT DUPLICATE, 386MSK RES ERR SYM MAT INVALID COL INDEX,

387MSK RES ERR SYM MAT INVALID ROW INDEX,

387MSK RES ERR SYM MAT INVALID VALUE,

387MSK RES ERR SYM MAT NOT LOWER TRINGULAR,

387MSK RES ERR TASK INCOMPATIBLE, 387MSK RES ERR TASK INVALID, 387MSK RES ERR THREAD COND INIT, 387MSK RES ERR THREAD CREATE, 387MSK RES ERR THREAD MUTEX INIT, 387MSK RES ERR THREAD MUTEX LOCK, 387MSK RES ERR THREAD MUTEX UNLOCK,

387MSK RES ERR TOO MANY CONCURRENT TASKS,

387MSK RES ERR TOO SMALL MAX NUM NZ,

387MSK RES ERR TOO SMALL MAXNUMANZ,

387MSK RES ERR UNB STEP SIZE, 388MSK RES ERR UNDEF SOLUTION, 388MSK RES ERR UNDEFINED OBJECTIVE SENSE,

388MSK RES ERR UNHANDLED SOLUTION STATUS,

388MSK RES ERR UNKNOWN, 388MSK RES ERR UPPER BOUND IS A NAN,

388MSK RES ERR UPPER TRIANGLE, 388MSK RES ERR USER FUNC RET, 388MSK RES ERR USER FUNC RET DATA, 388MSK RES ERR USER NLO EVAL, 388MSK RES ERR USER NLO EVAL HESSUBI,

388MSK RES ERR USER NLO EVAL HESSUBJ,

388MSK RES ERR USER NLO FUNC, 389MSK RES ERR WHICHITEM NOT ALLOWED,

389MSK RES ERR WHICHSOL, 389MSK RES ERR WRITE LP FORMAT, 389MSK RES ERR WRITE LP NON UNIQUE NAME,

389MSK RES ERR WRITE MPS INVALID NAME,

389MSK RES ERR WRITE OPF INVALID VAR NAME,

389MSK RES ERR WRITING FILE, 389

Page 469: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

INDEX 451

MSK RES ERR XML INVALID PROBLEM TYPE,389

MSK RES ERR Y IS UNDEFINED, 389MSK RES OK, 389MSK RES TRM INTERNAL, 389MSK RES TRM INTERNAL STOP, 389MSK RES TRM MAX ITERATIONS, 389MSK RES TRM MAX NUM SETBACKS, 389MSK RES TRM MAX TIME, 390MSK RES TRM MIO NEAR ABS GAP, 390MSK RES TRM MIO NEAR REL GAP, 390MSK RES TRM MIO NUM BRANCHES, 390MSK RES TRM MIO NUM RELAXS, 390MSK RES TRM NUM MAX NUM INT SOLUTIONS,

390MSK RES TRM NUMERICAL PROBLEM,

390MSK RES TRM OBJECTIVE RANGE, 390MSK RES TRM STALL, 390MSK RES TRM USER CALLBACK, 390MSK RES WRN ANA ALMOST INT BOUNDS,

391MSK RES WRN ANA C ZERO, 391MSK RES WRN ANA CLOSE BOUNDS, 391MSK RES WRN ANA EMPTY COLS, 391MSK RES WRN ANA LARGE BOUNDS, 391MSK RES WRN CONSTRUCT INVALID SOL ITG,

391MSK RES WRN CONSTRUCT NO SOL ITG,

391MSK RES WRN CONSTRUCT SOLUTION INFEAS,

391MSK RES WRN DROPPED NZ QOBJ, 391MSK RES WRN DUPLICATE BARVARIABLE NAMES,

391MSK RES WRN DUPLICATE CONE NAMES,

391MSK RES WRN DUPLICATE CONSTRAINT NAMES,

391MSK RES WRN DUPLICATE VARIABLE NAMES,

391MSK RES WRN ELIMINATOR SPACE, 391MSK RES WRN EMPTY NAME, 392MSK RES WRN IGNORE INTEGER, 392MSK RES WRN INCOMPLETE LINEAR DEPENDENCY CHECK,

392

MSK RES WRN LARGE AIJ, 392MSK RES WRN LARGE BOUND, 392MSK RES WRN LARGE CJ, 392MSK RES WRN LARGE CON FX, 392MSK RES WRN LARGE LO BOUND, 392MSK RES WRN LARGE UP BOUND, 392MSK RES WRN LICENSE EXPIRE, 392MSK RES WRN LICENSE FEATURE EXPIRE,

392MSK RES WRN LICENSE SERVER, 392MSK RES WRN LP DROP VARIABLE, 392MSK RES WRN LP OLD QUAD FORMAT,

392MSK RES WRN MIO INFEASIBLE FINAL,

393MSK RES WRN MPS SPLIT BOU VECTOR,

393MSK RES WRN MPS SPLIT RAN VECTOR,

393MSK RES WRN MPS SPLIT RHS VECTOR,

393MSK RES WRN NAME MAX LEN, 393MSK RES WRN NO DUALIZER, 393MSK RES WRN NO GLOBAL OPTIMIZER,

393MSK RES WRN NO NONLINEAR FUNCTION WRITE,

393MSK RES WRN NZ IN UPR TRI, 393MSK RES WRN OPEN PARAM FILE, 393MSK RES WRN PARAM IGNORED CMIO,

393MSK RES WRN PARAM NAME DOU, 393MSK RES WRN PARAM NAME INT, 393MSK RES WRN PARAM NAME STR, 393MSK RES WRN PARAM STR VALUE, 393MSK RES WRN PRESOLVE OUTOFSPACE,

394MSK RES WRN QUAD CONES WITH ROOT FIXED AT ZERO,

394MSK RES WRN RQUAD CONES WITH ROOT FIXED AT ZERO,

394MSK RES WRN SOL FILE IGNORED CON,

394MSK RES WRN SOL FILE IGNORED VAR,

394MSK RES WRN SOL FILTER, 394

Page 470: The MOSEK optimization toolbox for MATLAB manual. Version 7.0

452 INDEX

MSK RES WRN SPAR MAX LEN, 394MSK RES WRN TOO FEW BASIS VARS, 394MSK RES WRN TOO MANY BASIS VARS,

394MSK RES WRN TOO MANY THREADS CONCURRENT,

394MSK RES WRN UNDEF SOL FILE NAME,

394MSK RES WRN USING GENERIC NAMES,

394MSK RES WRN WRITE CHANGED NAMES,

394MSK RES WRN WRITE DISCARDED CFIX,

395MSK RES WRN ZERO AIJ, 395MSK RES WRN ZEROS IN SPARSE COL, 395MSK RES WRN ZEROS IN SPARSE ROW,

395

scaling, 132sensitivity analysis, 179

basis type, 181optimal partition type, 182

shadow price, 180simplex optimizer, 138solution

optimal, 195primal-dual, 194

solution summary, 145, 155

variablesdecision, 193, 204, 207lower limit, 194, 204, 207upper limit, 194, 204, 207

xml format, 241