# Why does MATLAB's quadprog outperform MOSEK for my problem?

For a problem I am trying to solve it appears MOSEK's Quadratic Program solver is 100 times slower than MATLAB's Interior Point solver.

Has anyone encountered this behavior in the past, or maybe could guess what sort of problem might cause this behavior?

The problem is of the form:

\begin{align} \text{min }& 0.5 x^T Q x + c^T x \\ \text{s.t. }& A x \leq b \end{align}

With more linear constraints than variables.

-

Can you give an example problem where you are seeing this performance difference, as well as the version of MOSEK you are using and hardware?  I'm happy to invite a MOSEK developer on here to respond but your question will need a bit more detail. – Aron Ahmadia Oct 23 '12 at 8:38
I've tried to clean your question up to make it more useful to future visitors, as it was first stated it was pretty unclear what you were asking.  Please try to spend time making your question both detailed and general enough that it will be of future use to other users. – Aron Ahmadia Oct 24 '12 at 1:26
Thanks :) of course, I would have put emphasis on the form of the problem if I knew that the primal\dual selection is critical. – noam Oct 24 '12 at 1:28

## 1 Answer

For problems of this form, you should solve the dual problem using MOSEK. In some cases this can provide several orders of magnitudes of speedup. MOSEK is tuned for the more common case

\begin{align} \text{min }& 0.5 x^T Q x + c^T x \\ \text{s.t. }& A x = b \\ & x >= 0 \end{align}

where there are many more variables than constraints.

If you contact MOSEK support at support@mosek.com and are willing to give us your problem then we can most likely tell what you should change to get a better performance of MOSEK. If you are not willing to provide any information (Size and density of $Q$ and $A$, other special structure to the problem) then it is hard to help you.

-
Your guess is correct! Indeed my problem is more of the first form. However, when I add the line param.MSK_IPAR_INTPNT_SOLVE_FORM=res.symbcon.MSK_SOLVE_DUAL; to make mosek solve the dual problem, I still get Optimizer - solved problem : the primal and no improvement in times – noam Oct 23 '12 at 22:53
@user3207, Erling, thanks for the detailed answer (and the astute guesswork). I've modified noam's question to provide the details he should have originally put in, and excised them from your answer. Feel free to edit further if you'd like to fix anything. – Aron Ahmadia Oct 24 '12 at 1:29

2
MOSEK only dualize linear problems. We should print out warning when we do not dualize as requested. The upcoming version 7 does that. It is not that hard to dualize a QP by hand. It is shown in the MOSEK manuals for instance. – user3207 Oct 24 '12 at 13:06
@user3207 Thanks! – noam Oct 24 '12 at 14:38
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 2, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0}, "config": {"markdown_headings": true, "markdown_code": false, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 20, "end_threshold": 5, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "github"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "english_confidence": 0.9430670142173767, "perplexity_flag": "middle"}