The MOSEK Python optimizer API manual Version 7.0 (Revision 141)
Optimizer API for Python - Documentation - Mosek Optimizer API for Python - Documentation - Mosek
124 CHAPTER 10. PROBLEM FORMULATION AND SOLUTIONS • l x ∈ R n is the lower limit on the activity for the variables. • u x ∈ R n is the upper limit on the activity for the variables. A primal solution (x) is (primal) feasible if it satisfies all constraints in (10.1). If (10.1) has at least one primal feasible solution, then (10.1) is said to be (primal) feasible. In case (10.1) does not have a feasible solution, the problem is said to be (primal) infeasible . 10.1.1 Duality for linear optimization Corresponding to the primal problem (10.1), there is a dual problem maximize (l c ) T s c l − (u c ) T s c u + (l x ) T s x l − (u x ) T s x u + c f subject to A T y + s x l − s x u = c, − y + s c l − s c u = 0, s c l , s c u, s x l , s x u ≥ 0. (10.2) If a bound in the primal problem is plus or minus infinity, the corresponding dual variable is fixed at 0, and we use the convention that the product of the bound value and the corresponding dual variable is 0. E.g. l x j = −∞ ⇒ (s x l ) j = 0 and l x j · (s x l ) j = 0. This is equivalent to removing variable (s x l ) j from the dual problem. A solution (y, s c l , s c u, s x l , s x u) to the dual problem is feasible if it satisfies all the constraints in (10.2). If (10.2) has at least one feasible solution, then (10.2) is (dual) feasible, otherwise the problem is (dual) infeasible. 10.1.1.1 A primal-dual feasible solution A solution (x, y, s c l , s c u, s x l , s x u) is denoted a primal-dual feasible solution, if (x) is a solution to the primal problem (10.1) and (y, s c l , sc u, s x l , sx u) is a solution to the corresponding dual problem (10.2). 10.1.1.2 The duality gap Let (x ∗ , y ∗ , (s c l ) ∗ , (s c u) ∗ , (s x l ) ∗ , (s x u) ∗ )
10.1. LINEAR OPTIMIZATION 125 be a primal-dual feasible solution, and let (x c ) ∗ := Ax ∗ . For a primal-dual feasible solution we define the duality gap as the difference between the primal and the dual objective value, = m−1 ∑ i=0 c T x ∗ + c f − ( (l c ) T (s c l ) ∗ − (u c ) T (s c u) ∗ + (l x ) T (s x l ) ∗ − (u x ) T (s x u) ∗ + c f ) n−1 ∑ [(s c l ) ∗ i ((x c i) ∗ − li c ) + (s c u) ∗ i (u c i − (x c i) ∗ [ )] + (s x l ) ∗ j (x j − lj x ) + (s x u) ∗ j (u x j − x ∗ j ) ] ≥ 0 j=0 (10.3) where the first relation can be obtained by transposing and multiplying the dual constraints (10.2) by x ∗ and (x c ) ∗ respectively, and the second relation comes from the fact that each term in each sum is nonnegative. It follows that the primal objective will always be greater than or equal to the dual objective. 10.1.1.3 When the objective is to be maximized When the objective sense of problem (10.1) is maximization, i.e. maximize c T x + c f subject to l c ≤ Ax ≤ u c , l x ≤ x ≤ u x , the objective sense of the dual problem changes to minimization, and the domain of all dual variables changes sign in comparison to (10.2). The dual problem thus takes the form minimize (l c ) T s c l − (u c ) T s c u + (l x ) T s x l − (u x ) T s x u + c f subject to A T y + s x l − s x u = c, − y + s c l − s c u = 0, s c l , s c u, s x l , s x u ≤ 0. This means that the duality gap, defined in (10.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 the primal objective. 10.1.1.4 An optimal solution It is well-known that a linear optimization problem has an optimal solution if and only if there exist feasible primal and dual solutions so that the duality gap is zero, or, equivalently, that the complementarity conditions
- Page 95 and 96: 5.13. CONVENTIONS EMPLOYED IN THE A
- Page 97 and 98: 5.13. CONVENTIONS EMPLOYED IN THE A
- Page 99 and 100: Chapter 6 Nonlinear API tutorial Th
- Page 101 and 102: 6.1. SEPARABLE CONVEX (SCOPT) INTER
- Page 103 and 104: 6.1. SEPARABLE CONVEX (SCOPT) INTER
- Page 105 and 106: 6.1. SEPARABLE CONVEX (SCOPT) INTER
- Page 107 and 108: Chapter 7 Advanced API tutorial Thi
- Page 109 and 110: 7.1. THE PROGRESS CALL-BACK 87 71 p
- Page 111 and 112: 7.2. SOLVING LINEAR SYSTEMS INVOLVI
- Page 113 and 114: 7.2. SOLVING LINEAR SYSTEMS INVOLVI
- Page 115 and 116: 7.2. SOLVING LINEAR SYSTEMS INVOLVI
- Page 117 and 118: 7.2. SOLVING LINEAR SYSTEMS INVOLVI
- Page 119 and 120: Chapter 8 A case study 8.1 Portfoli
- Page 121 and 122: 8.1. PORTFOLIO OPTIMIZATION 99 e T
- Page 123 and 124: 8.1. PORTFOLIO OPTIMIZATION 101 is
- Page 125 and 126: 8.1. PORTFOLIO OPTIMIZATION 103 15
- Page 127 and 128: 8.1. PORTFOLIO OPTIMIZATION 105 63
- Page 129 and 130: 8.1. PORTFOLIO OPTIMIZATION 107 8.1
- Page 131 and 132: 8.1. PORTFOLIO OPTIMIZATION 109 110
- Page 133 and 134: 8.1. PORTFOLIO OPTIMIZATION 111 z j
- Page 135 and 136: 8.1. PORTFOLIO OPTIMIZATION 113 Var
- Page 137 and 138: 8.1. PORTFOLIO OPTIMIZATION 115 56
- Page 139 and 140: 8.1. PORTFOLIO OPTIMIZATION 117 172
- Page 141 and 142: Chapter 9 Usage guidelines The purp
- Page 143 and 144: 9.3. WRITING TASK DATA TO A FILE 12
- Page 145: Chapter 10 Problem formulation and
- Page 149 and 150: 10.2. CONIC QUADRATIC OPTIMIZATION
- Page 151 and 152: 10.2. CONIC QUADRATIC OPTIMIZATION
- Page 153 and 154: 10.3. SEMIDEFINITE OPTIMIZATION 131
- Page 155 and 156: 10.4. QUADRATIC AND QUADRATICALLY C
- Page 157 and 158: Chapter 11 The optimizers for conti
- Page 159 and 160: 11.1. HOW AN OPTIMIZER WORKS 137 11
- Page 161 and 162: 11.2. LINEAR OPTIMIZATION 139 11.2.
- Page 163 and 164: 11.2. LINEAR OPTIMIZATION 141 Whene
- Page 165 and 166: 11.2. LINEAR OPTIMIZATION 143 11.2.
- Page 167 and 168: 11.2. LINEAR OPTIMIZATION 145 • R
- Page 169 and 170: 11.5. NONLINEAR CONVEX OPTIMIZATION
- Page 171 and 172: 11.6. SOLVING PROBLEMS IN PARALLEL
- Page 173 and 174: 11.6. SOLVING PROBLEMS IN PARALLEL
- Page 175 and 176: 11.6. SOLVING PROBLEMS IN PARALLEL
- Page 177 and 178: Chapter 12 The optimizers for mixed
- Page 179 and 180: 12.3. THE MIXED-INTEGER CONIC OPTIM
- Page 181 and 182: 12.5. TERMINATION CRITERION 159 •
- Page 183 and 184: 12.7. UNDERSTANDING SOLUTION QUALIT
- Page 185 and 186: Chapter 13 The analyzers 13.1 The p
- Page 187 and 188: 13.1. THE PROBLEM ANALYZER 165 Cons
- Page 189 and 190: 13.2. ANALYZING INFEASIBLE PROBLEMS
- Page 191 and 192: 13.2. ANALYZING INFEASIBLE PROBLEMS
- Page 193 and 194: 13.2. ANALYZING INFEASIBLE PROBLEMS
- Page 195 and 196: 13.2. ANALYZING INFEASIBLE PROBLEMS
124 CHAPTER 10. PROBLEM FORMULATION AND SOLUTIONS<br />
• l x ∈ R n is the lower limit on the activity for the variables.<br />
• u x ∈ R n is the upper limit on the activity for the variables.<br />
A primal solution (x) is (primal) feasible if it satisfies all constraints in (10.1). If (10.1) has at least<br />
one primal feasible solution, then (10.1) is said to be (primal) feasible.<br />
In case (10.1) does not have a feasible solution, the problem is said to be (primal) infeasible .<br />
10.1.1 Duality for linear optimization<br />
Corresponding to the primal problem (10.1), there is a dual problem<br />
maximize (l c ) T s c l − (u c ) T s c u + (l x ) T s x l − (u x ) T s x u + c f<br />
subject to A T y + s x l − s x u = c,<br />
− y + s c l − s c u = 0,<br />
s c l , s c u, s x l , s x u ≥ 0.<br />
(10.2)<br />
If a bound in the primal problem is plus or minus infinity, the corresponding dual variable is fixed at<br />
0, and we use the convention that the product of the bound value and the corresponding dual variable<br />
is 0. E.g.<br />
l x j = −∞ ⇒ (s x l ) j = 0 and l x j · (s x l ) j = 0.<br />
This is equivalent to removing variable (s x l ) j from the dual problem.<br />
A solution<br />
(y, s c l , s c u, s x l , s x u)<br />
to the dual problem is feasible if it satisfies all the constraints in (10.2). If (10.2) has at least one<br />
feasible solution, then (10.2) is (dual) feasible, otherwise the problem is (dual) infeasible.<br />
10.1.1.1 A primal-dual feasible solution<br />
A solution<br />
(x, y, s c l , s c u, s x l , s x u)<br />
is denoted a primal-dual feasible solution, if (x) is a solution to the primal problem (10.1) and<br />
(y, s c l , sc u, s x l , sx u) is a solution to the corresponding dual problem (10.2).<br />
10.1.1.2 <strong>The</strong> duality gap<br />
Let<br />
(x ∗ , y ∗ , (s c l ) ∗ , (s c u) ∗ , (s x l ) ∗ , (s x u) ∗ )