Benchmark for quadratic programming solvers available in Python.
Project description
QP solvers benchmark
Benchmark for quadratic programming (QP) solvers available in Python.
The goal of this benchmark is to help us compare and select QP solvers. Its methodology is open to discussions. New test sets are also welcome. Feel free to add one that better represents the kind of problems you are working on.
Solvers
Solver | Keyword | Algorithm | Matrices | License |
---|---|---|---|---|
CVXOPT | cvxopt |
Interior point | Dense | GPL-3.0 |
ECOS | ecos |
Interior point | Sparse | GPL-3.0 |
Gurobi | gurobi |
Interior point | Sparse | Commercial |
HiGHS | highs |
Active set | Sparse | MIT |
MOSEK | mosek |
Interior point | Sparse | Commercial |
OSQP | osqp |
Douglas–Rachford | Sparse | Apache-2.0 |
ProxQP | proxqp |
Augmented Lagrangian | Dense & Sparse | BSD-2-Clause |
qpOASES | qpoases |
Active set | Dense | LGPL-2.1 |
qpSWIFT | qpswift |
Interior point | Sparse | GPL-3.0 |
quadprog | quadprog |
Goldfarb-Idnani | Dense | GPL-2.0 |
SCS | scs |
Douglas–Rachford | Sparse | MIT |
Test sets and results
The benchmark has different test sets that represent different use cases for QP solvers. Click on a test set to check out its report.
Test set | Keyword | Description |
---|---|---|
GitHub free-for-all | github_ffa |
Test set built by the community on GitHub, new problems are welcome! |
Maros-Meszaros | maros_meszaros |
Standard set of problems designed to be difficult. |
Maros-Meszaros dense | maros_meszaros_dense |
Subset of the Maros-Meszaros test set restricted to smaller dense problems. |
Metrics
We evaluate QP solvers based on the following metrics:
- Success rate: percentage of problems a solver is able to solve on a given test set.
- Computation time: time a solver takes to solve a given problem.
- Optimality conditions: we evaluate all three optimality conditions:
- Primal residual: maximum error on equality and inequality constraints at the returned solution.
- Dual residual: maximum error on the dual feasibility condition at the returned solution.
- Duality gap: value of the duality gap at the returned solution.
- Cost error: difference between the solution cost and the known optimal cost.
Shifted geometric mean
Each metric (computation time, primal and dual residuals, duality gap) produces a different ranking of solvers for each problem. To aggregate those rankings into a single metric over the whole test set, we use the shifted geometric mean (shm), which is a standard to aggregate computation times in benchmarks for optimization software. This mean has the advantage of being compromised by neither large outliers (as opposed to the arithmetic mean) nor by small outliers (in contrast to the geometric geometric mean). Check out the references below for further details.
Here are some intuitive interpretations:
- A solver with a shifted-geometric-mean runtime of $Y$ is $Y$ times slower than the best solver over the test set.
- A solver with a shifted-geometric-mean primal residual $R$ is $R$ times less accurate on equality and inequality constraints than the best solver over the test set.
Limitations
Here are some known areas of improvement for this benchmark:
- Cold start only: we don't evaluate warm-start performance for now.
Check out the issue tracker for ongoing works and future improvements.
Installation
You can install the benchmark and its dependencies in an isolated environment using conda
:
conda create -f environment.yaml
conda activate qpsolvers_benchmark
Alternatively, you can install the benchmark on your system using pip
:
pip install qpsolvers_benchmark
By default, the benchmark will run all supported solvers it finds.
Running the benchmark
Pick up the keyword corresponding to the desired test set, for instance maros_meszaros
, and pass it to the run
command:
python benchmark.py maros_meszaros run
You can also run a specific solver, problem or set of solver settings:
python benchmark.py maros_meszaros_dense run --solver proxqp --settings default
Check out python benchmark.py --help
for all available commands and arguments.
Contributing
Contributions to improving this benchmark are welcome. You can for instance propose new problems, or share the runtimes you obtain on your machine. Check out the contribution guidelines for details.
See also
References
- How not to lie with statistics: the correct way to summarize benchmark results: why geometric means should always be used to summarize normalized results.
- Optimality conditions and numerical tolerances in QP solvers: note written while figuring out the
high_accuracy
settings of this benchmark.
Other benchmarks
- Benchmarks for optimization software by Hans Mittelmann, which includes reports on the Maros-Meszaros test set.
- jrl-qp/benchmarks: benchmark of QP solvers available in C++.
- osqp_benchmark: benchmark examples for the OSQP solver.
- proxqp_benchmark: benchmark examples for the ProxQP solver.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file qpsolvers_benchmark-0.1.0rc4.tar.gz
.
File metadata
- Download URL: qpsolvers_benchmark-0.1.0rc4.tar.gz
- Upload date:
- Size: 32.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.22.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 267f93a3519f3ebef276343de2fb9d2e5a293ad45b0f6b7817e7d7c62ca97ed8 |
|
MD5 | 1605acb7a57abff34d2396a87c1d87f5 |
|
BLAKE2b-256 | 2ce8e168d4474d34c77b32a78b9eba830057d25b840c55f3e88fe7778cd39b2f |
File details
Details for the file qpsolvers_benchmark-0.1.0rc4-py3-none-any.whl
.
File metadata
- Download URL: qpsolvers_benchmark-0.1.0rc4-py3-none-any.whl
- Upload date:
- Size: 42.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.22.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e5ff6f9cc4830e89c9226168f18433de3c7263cb03e11c82722e1d47a5dd5a88 |
|
MD5 | 973241c57a06f2a43e5572fb8aa384bf |
|
BLAKE2b-256 | 45d32e64b83fe85595dcb3a44952544de9b91a8d1758c5aa6df0281fb48e382f |