Solved – What are the differences between various R quadratic programming solvers

I am looking for a package to help me solve some quadratic optimisation problems and I see there are at least half a dozen different packages. According to this page:

QP (Quadratic programming, 90C20): cplexAPI, kernlab, limSolve, LowRankQP, quadprog, Rcplex, Rmosek

Some of these (Rmosek and cplexAPI) depend on other proprietary packages, so I'm not interested in those.

What are the notable differences between the other QP packages?

  • Cplex (cplexAPI, Rcplex): is not open source (but there is a yearly renewable free academic licence). It supports sparse matrices. Was my gotto wrapper for QP while I was using it. Beaware that the academic licence does not allow to use it on many cores (say through mclapply()).
  • ipop (the one in kernlab) is implemented in pure R. That makes it unnecessarily slow in big applications. Doesn't support sparse matrices.
  • limSolve doesn't solve full fledged QP's, only those where the constraints are of type equality. Not all QP problems can be framed this way, but when then can, they have an explicit solution. Does not support sparse matrices.
  • LowRankQP: this one in my experience is a good one (fast compared to the other open source ones). Does not support sparse matrices.
  • quadprog: baseline implementation of the Goldfarb & Idnani Dual and Primal-Dual solver. Does not support sparse matrices but quiet fast for moderatly sized problems.
  • Rmosek: never tried.


Since I wrote this answer, a new package, ipoptr is now available on R-forge. This R-blogger post compares it performance on pure QP with quadprog. In short, ipoptr supports sparse matrix triplets and tends to be much faster than quadprod when the design matrices are sparse. When the design matrices are dense however, quadprog still appears to be significantly faster.

Similar Posts:

Rate this post

Leave a Comment