OSQP: An Operator Splitting Solver for Quadratic Programs

Bartolomeo Stellato, Goran Banjac, Paul J. Goulart, Alberto Bemporad, Stephen BoydMath. Program. Comput 2018

Abstract

Quadratic Programming (QP) is a fundamental tool in modern engineering, utilized in fields ranging from financial portfolio optimization to real-time trajectory planning for autonomous systems. Despite its ubiquity, existing solvers often struggle to balance speed, robustness, and the ability to handle large-scale problems on resource-constrained hardware. This paper introduces OSQP, an open-source solver based on a novel operator splitting technique that leverages the Alternating Direction Method of Multipliers (ADMM). OSQP is designed to be a general-purpose solver that provides high-performance results, supports warm starting, and offers certificates of infeasibility, making it particularly well-suited for embedded applications.

Introduction

Quadratic programs are optimization problems characterized by a quadratic objective function and linear constraints. Historically, practitioners have had to choose between two main classes of solvers, each with distinct trade-offs. Interior-point methods offer high accuracy and predictable convergence but scale poorly with problem size and lack the ability to "warm start"—using a previous solution to accelerate the solving of a new, similar problem. Conversely, active-set methods support warm starting but suffer from poor worst-case complexity as the number of constraints increases.

OSQP addresses this "Goldilocks" problem by providing a robust, first-order solver that is lightweight enough for embedded systems while remaining competitive with—and often outperforming—commercial interior-point solvers in terms of speed and reliability.

Methodology

At its core, OSQP utilizes the Alternating Direction Method of Multipliers (ADMM). The authors' primary contribution is a novel operator splitting that reduces the optimization process to solving a sequence of quasi-definite linear systems. This approach offers several technical advantages:

Quasi-Definite Linear Systems

The chosen splitting ensures that the underlying linear system is solvable for any problem data. Unlike many other solvers, OSQP does not require assumptions such as strict convexity or the linear independence of constraints, making it exceptionally robust against poorly defined problems.

Factorization Caching and Warm Starting

In many applications, such as Model Predictive Control (MPC), a series of similar QPs are solved in sequence. OSQP is designed to exploit this. Because the matrix factorization (the most computationally expensive part of the process) remains constant across iterations if the problem structure does not change, OSQP caches this factorization. Subsequent iterations or new problems with updated parameters can be solved using only inexpensive back-substitutions. This "warm starting" capability allows OSQP to find solutions in a fraction of the time required for a cold start.

Solution Polishing

First-order methods like ADMM are sometimes criticized for providing only medium-accuracy solutions. OSQP overcomes this by implementing a "polishing" step. Once the ADMM iterations converge, the solver identifies the active constraints and solves a small, high-precision linear system to refine the solution. This allows OSQP to achieve accuracy levels comparable to industry-standard interior-point methods.

Infeasibility Detection

OSQP is the first ADMM-based QP solver capable of providing mathematical certificates of primal and dual infeasibility. This is a critical feature for real-world applications where it is vital to know definitively if a set of constraints cannot be satisfied.

Performance Evaluation

The authors conducted an extensive benchmarking study using 1,400 problem instances across diverse domains, including portfolio optimization, Lasso, Support Vector Machines (SVMs), and optimal control. They compared OSQP against leading solvers such as GUROBI, MOSEK, ECOS, and qpOASES.

Key Results

  • Speed: OSQP was typically 10 times faster than traditional interior-point methods. In parametric cases where factorization caching was utilized, speedups reached up to 19x.
  • Reliability: In high-accuracy tests across the benchmark library, OSQP achieved a 0% failure rate. In comparison, commercial solvers like GUROBI and MOSEK failed on 1.4% and 11% of instances, respectively.
  • Embedded Suitability: The solver is implemented in library-free C with a minimal memory footprint. Its "division-free" nature (after initial factorization) makes it ideal for deployment on microcontrollers and other embedded hardware.

Discussion and Limitations

While OSQP represents a significant advancement, its performance is sensitive to the step-size parameter ($\rho$). Although the solver includes a heuristic for automated parameter tuning, finding the optimal value for every problem remains a challenge. Additionally, the solution polishing step, while highly effective, is not guaranteed to succeed in every instance (succeeding in approximately 83% of high-accuracy test cases). Finally, the current implementation uses a direct linear solver (QDLDL), which may be limited by memory constraints for extremely large-scale problems; future iterations may explore indirect, iterative solvers to address this.

Conclusion

OSQP provides a powerful, robust, and efficient alternative to traditional QP solvers. By combining the flexibility of ADMM with innovative operator splitting and practical features like factorization caching and solution polishing, it meets the demands of both large-scale machine learning and high-speed embedded control. OSQP is open-source and available for the broader research and engineering community at osqp.org.

Summary updated

BibTeX
@article{stellato2018osqp,
  author = {Bartolomeo Stellato and Goran Banjac and Paul J. Goulart and Alberto Bemporad and Stephen Boyd},
  title = {{OSQP: An Operator Splitting Solver for Quadratic Programs}},
  journal = {Math. Program. Comput.},
  year = {2018},
}
Figure