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

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

25.11.2015 Views

144 CHAPTER 11. THE OPTIMIZERS FOR CONTINUOUS PROBLEMS 11.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 optimal solution to reduce the solution time. Depending on the problem it may be faster or slower to use an initial guess; see section 11.2.4 for a discussion. MOSEK provides both a primal and a dual variant of the simplex optimizer — we will return to this later. 11.2.3.1 Simplex termination criterion The simplex optimizer terminates when it finds an optimal basic solution or an infeasibility certificate. A basic solution is optimal when it is primal and dual feasible; see (10.1) and (10.2) for a definition of the primal and dual problem. Due the fact that to computations are performed in finite precision MOSEK allows violation of primal and dual feasibility within certain tolerances. The user can control the allowed primal and dual infeasibility with the parameters dparam.basis tol x and dparam.basis tol s. 11.2.3.2 Starting from an existing solution When using the simplex optimizer it may be possible to reuse an existing solution and thereby reduce the solution time significantly. When a simplex optimizer starts from an existing solution it is said to perform 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 iparam.optimizer to optimizertype.free simplex instructs MOSEK to select automatically between the primal and the dual simplex optimizers. Hence, MOSEK tries to choose 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 few iterations to find the optimal solution it may be better to turn off the presolve. 11.2.3.3 Numerical difficulties in the simplex optimizers Though MOSEK is designed to minimize numerical instability, completely avoiding it is impossible when working in finite precision. MOSEK counts a ”numerical unexpected behavior” event inside the optimizer as a set-back. The user can define how many set-backs the optimizer accepts; if that number is exceeded, the optimization will be aborted. Set-backs are implemented to avoid long sequences where the optimizer tries to recover from an unstable situation. Set-backs are, for example, repeated singularities when factorizing the basis matrix, repeated loss of feasibility, degeneracy problems (no progress in objective) and other events indicating numerical difficulties. 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 still occur, trying one or more of the following suggestions may be worthwhile:

11.2. LINEAR OPTIMIZATION 145 • Raise tolerances for allowed primal or dual feasibility: Hence, increase the value of – dparam.basis tol x, and – dparam.basis tol s. • Raise or lower pivot tolerance: Change the dparam.simplex abs tol piv parameter. • Switch optimizer: Try another optimizer. • Switch off crash: Set both iparam.sim primal crash and iparam.sim dual crash to 0. • Experiment with other pricing strategies: Try different values for the parameters – iparam.sim primal selection and – iparam.sim dual selection. • If you are using hot-starts, in rare cases switching off this feature may improve stability. This is controlled by the iparam.sim hotstart parameter. • Increase maximum set-backs allowed controlled by iparam.sim max num setbacks. • If the problem repeatedly becomes infeasible try switching off the special degeneracy handling. See the parameter iparam.sim degen for details. 11.2.4 The interior-point or the simplex optimizer? Given a linear optimization problem, which optimizer is the best: The primal simplex, the dual simplex or the interior-point optimizer? It is impossible to provide a general answer to this question, however, the interior-point optimizer behaves more predictably — it tends to use between 20 and 100 iterations, almost independently of problem 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. 11.2.5 The primal or the dual simplex variant? MOSEK provides both a primal and a dual simplex optimizer. Predicting which simplex optimizer is faster is impossible, however, in recent years the dual optimizer has seen several algorithmic and computational improvements, which, in our experience, makes it faster on average than the primal simplex optimizer. Still, it depends much on the problem structure and size. Setting the iparam.optimizer parameter to optimizertype.free simplex instructs MOSEK to choose which simplex optimizer to use automatically. To summarize, if you want to know which optimizer is faster for a given problem type, you should try all the optimizers. Alternatively, use the concurrent optimizer presented in Section 11.6.3.

11.2. LINEAR OPTIMIZATION 145<br />

• Raise tolerances for allowed primal or dual feasibility: Hence, increase the value of<br />

– dparam.basis tol x, and<br />

– dparam.basis tol s.<br />

• Raise or lower pivot tolerance: Change the dparam.simplex abs tol piv parameter.<br />

• Switch <strong>optimizer</strong>: Try another <strong>optimizer</strong>.<br />

• Switch off crash: Set both iparam.sim primal crash and iparam.sim dual crash to 0.<br />

• Experiment with other pricing strategies: Try different values for the parameters<br />

– iparam.sim primal selection and<br />

– iparam.sim dual selection.<br />

• If you are using hot-starts, in rare cases switching off this feature may improve stability. This is<br />

controlled by the iparam.sim hotstart parameter.<br />

• Increase maximum set-backs allowed controlled by iparam.sim max num setbacks.<br />

• If the problem repeatedly becomes infeasible try switching off the special degeneracy handling.<br />

See the parameter iparam.sim degen for details.<br />

11.2.4 <strong>The</strong> interior-point or the simplex <strong>optimizer</strong>?<br />

Given a linear optimization problem, which <strong>optimizer</strong> is the best: <strong>The</strong> primal simplex, the dual simplex<br />

or the interior-point <strong>optimizer</strong>?<br />

It is impossible to provide a general answer to this question, however, the interior-point <strong>optimizer</strong><br />

behaves more predictably — it tends to use between 20 and 100 iterations, almost independently of<br />

problem size — but cannot perform hot-start, while simplex can take advantage of an initial solution,<br />

but is less predictable for cold-start. <strong>The</strong> interior-point <strong>optimizer</strong> is used by default.<br />

11.2.5 <strong>The</strong> primal or the dual simplex variant?<br />

<strong>MOSEK</strong> provides both a primal and a dual simplex <strong>optimizer</strong>. Predicting which simplex <strong>optimizer</strong><br />

is faster is impossible, however, in recent years the dual <strong>optimizer</strong> has seen several algorithmic and<br />

computational improvements, which, in our experience, makes it faster on average than the primal<br />

simplex <strong>optimizer</strong>. Still, it depends much on the problem structure and size.<br />

Setting the iparam.<strong>optimizer</strong> parameter to <strong>optimizer</strong>type.free simplex instructs <strong>MOSEK</strong> to<br />

choose which simplex <strong>optimizer</strong> to use automatically.<br />

To summarize, if you want to know which <strong>optimizer</strong> is faster for a given problem type, you should try<br />

all the <strong>optimizer</strong>s.<br />

Alternatively, use the concurrent <strong>optimizer</strong> presented in Section 11.6.3.

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

Saved successfully!

Ooh no, something went wrong!