Quadratic Program solver for Portfolio Optimization

Any recommendations? For portfolio selection problem with equality and inequality constraints, and lower and upper bounds for portfolio weights.

So far, what I have tested ( I do not test commercial solver like Gurobi or CPLEX)

  • Clarabel : fast and robust, but a heavy weapon (this package eats 1G in ~/.julia )
  • GeneralQP : fast and light. but an initial feasible point should be provided by user (can be obtained e.g. by performing Phase-I Simplex on the polyhedron Ax ≤ b). With this additional cost, is not as fast as Clarabel.
  • QPDAS : positive-definite quadratic programming problem. Most of time fail by ‘matrix is not positive definite; Cholesky factorization failed’
  • HiGHS : the QP functionality is added recently, but mostly fail on my data
  • OSQP : not Julia native, do not support BigFloat. The default setting should be tuned for portfolio optimization.
  • COSMO : 'Solver reached iteration limit ’ for my data, have to set max_iter=N*10000. And we can’t install COSMO & Clarabel.jl together
  • RipQP: never succeed, even its examples on Tutorial · RipQP.jl

Weakly related: in C++, provides the optimal portfolio conditional to a given risk aversion:


Registered yesterday

The Readme states

Fast: beat Clarabel for efficient portfolio seeking


I use OSQP for such problems. Seems quick and versatile. Also took Clarabel for a spin, and it also did a very good job. “First time to solution” was a bit of an issue with Clarabel, but maybe that’s different on 1.9.

“First time to solution”: do you mean that a first time run takes 19 seconds, and a second time run takes just 0.03 seconds?

yes. OSQP is clearly quicker.

The best, undoubtedly, EfficientFrontier is the best

EfficientFrontier is an analytical solver, the numerical solvers, such as OSQP, Clarabel, and LightenQP are in the second tier.

see Speed and Accuracy · PharosAbad/LightenQP.jl Wiki · GitHub for more information.

Is there anything available if we also add integer constraints?

Is there anything available if we also add integer constraints?

There’s quite a few options.


Open source

If you have a license, Gurobi is probably the best.