qpsolvers / qpsolvers

Quadratic programming solvers in Python with a unified API
GNU Lesser General Public License v3.0
590 stars 86 forks source link

Confusion regarding solver types on repo landing page #2

Closed rileyjmurray closed 6 years ago

rileyjmurray commented 6 years ago

On the repository page it says that sparse solvers include CVXPY and MOSEK.

But CVXPY isn't a solver, it's a modeling language. What is meant by using CVXPY as a solver?

Also, MOSEK is a sparse solver in general, but unfortunately not for QP's. MOSEK's documentation indicates that QP's are transformed to equivalent SOCP representations, and this transformation will inevitably destroy sparsity in the quadratic terms. Just point this out to explain why MOSEK performed so poorly on the sparse QP's.

stephane-caron commented 6 years ago

Thanks for this helpful comment :)

Indeed the underlying solver is ECOS when solving both dense and sparse QP's with CVXOPT on my machine. The distinction is now made as of commit cab4b63ed5d49bb309162bdf45c23a3ac8aad2d1.

For MOSEK, can you point out where in the documentation the transformation from QP to SOCP is mentioned?

rileyjmurray commented 6 years ago

You are very welcome!

On page 104 of of the PDF "MOSEK Optimizer API for Python, Release 8.1.0.34", there's Section 12.4.1, "A Recommendation". That section contains the following text:

Any convex quadratic optimization problem can be reformulated as a conic quadratic optimization prob- lem, see [MOSEKApS12] and in particular [And13] . In fact MOSEK does such conversion internally as a part of the solution process .... ... To summarize we recommend to formulate quadratic problems and in particular quadratically constrained problems directly in conic form.

rileyjmurray commented 6 years ago

@stephane-caron , a follow-up:

Although ECOS uses a sparse linear system solver (see: https://web.stanford.edu/~boyd/papers/ecos.html), the ECOS standard form requires that QP's be transformed to SOCP's. This would also explain why ECOS performed so poorly on the sparse problems.

stephane-caron commented 6 years ago

Awesome, thanks for these pointers :) I added both to the README.