qpbenchmark

Benchmark for quadratic programming solvers available in Python

https://github.com/qpsolvers/qpbenchmark

Science Score: 44.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (12.4%) to scientific vocabulary

Keywords

benchmark optimization quadratic-programming solvers
Last synced: 6 months ago · JSON representation ·

Repository

Benchmark for quadratic programming solvers available in Python

Basic Info
  • Host: GitHub
  • Owner: qpsolvers
  • License: apache-2.0
  • Language: Python
  • Default Branch: main
  • Homepage:
  • Size: 25 MB
Statistics
  • Stars: 152
  • Watchers: 7
  • Forks: 15
  • Open Issues: 8
  • Releases: 15
Topics
benchmark optimization quadratic-programming solvers
Created over 3 years ago · Last pushed 8 months ago
Metadata Files
Readme Changelog Contributing License Citation

README.md

QP solvers benchmark

CI Coverage Conda version PyPI version

Benchmark for quadratic programming (QP) solvers available in Python.

The objective is to compare and select the best QP solvers for given use cases. The benchmarking methodology is open to discussions. Standard and community test sets are available: all of them can be processed using the qpbenchmark command-line tool, resulting in standardized reports evaluating all metrics across all QP solvers available on the test machine.

Test sets

The benchmark comes with standard and community test sets to represent different use cases for QP solvers:

New test sets are welcome! The qpbenchmark tool is designed to make it easy to wrap up a new test set without re-implementing the benchmark methodology. Check out the contribution guidelines to get started.

Solvers

The benchmark includes the following solvers:

| Solver | Keyword | Algorithm | Matrices | License | | ------ | ------- | --------- | -------- | ------- | | Clarabel | clarabel | Interior point | Sparse | Apache-2.0 | | CVXOPT | cvxopt | Interior point | Dense | GPL-3.0 | | DAQP | daqp | Active set | Dense | MIT | | ECOS | ecos | Interior point | Sparse | GPL-3.0 | | Gurobi | gurobi | Interior point | Sparse | Commercial | | HiGHS | highs | Active set | Sparse | MIT | | HPIPM | hpipm | Interior point | Dense | BSD-2-Clause | | jaxopt.OSQP | jaxopt_osqp | Augmented Lagrangian | Dense | Apache-2.0 | | KVXOPT | kvxopt | Interior point | Dense & Sparse | GPL-3.0 | | MOSEK | mosek | Interior point | Sparse | Commercial | | NPPro | nppro | Active set | Dense | Commercial | | OSQP | osqp | Douglas–Rachford | Sparse | Apache-2.0 | | PIQP | piqp | Proximal Interior Point | Dense & Sparse | BSD-2-Clause | | ProxQP | proxqp | Augmented Lagrangian | Dense & Sparse | BSD-2-Clause | | QPALM | qpalm | Augmented Lagrangian | Sparse | LGPL-3.0 | | qpax | qpax | Interior point | Dense | MIT | | 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 |

Solvers are interfaced via qpsolvers and configured in solver_settings.py.

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.

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.

Intuitively, a solver with a shifted-geometric-mean runtime of $Y$ is $Y$ times slower than the best solver over the test set. Similarly, 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.

Results

The outcome from running a test set is a standardized report comparing solvers against the different metrics. Here are the results for the various qpbenchmark test sets:

You can check out results from a variety of machines, and share the reports produced by running the benchmark on your own machine, in the Results category of the discussions forum of each test set.

Limitations

Here are some known areas of improvement for this benchmark:

Check out the issue tracker for ongoing works and future improvements.

Installation

We recommend installing the benchmark in its own environment using conda:

console conda install qpbenchmark

Alternatively, you can install the benchmarking tool individually by pip install qpbenchmark. In that case, the benchmark will run on all supported solvers it can import.

Usage

The benchmark works by running qpbenchmark on a Python script describing the test set. For instance:

console qpbenchmark my_test_set.py run

The test-set script is followed by a benchmark command, such as "run" here. We can add optional arguments to run a specific solver, problem, or solver settings:

console qpbenchmark my_test_set.py run --solver proxqp --settings default

Check out qpbenchmark --help for a list of available commands and arguments.

Plots

The command line ships a plot command to compare solver performances over a test set for a specific metric. For instance, run:

console qpbenchmark maros_meszaros_dense.py plot runtime high_accuracy

To generate the following plot:

image

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.

Citation

If you use qpbenchmark in your works, please cite all its contributors as follows:

bibtex @software{qpbenchmark, title = {{qpbenchmark: Benchmark for quadratic programming solvers available in Python}}, author = {Caron, Stéphane and Zaki, Akram and Otta, Pavel and Arnström, Daniel and Carpentier, Justin and Yang, Fengyu and Leziart, Pierre-Alexandre}, url = {https://github.com/qpsolvers/qpbenchmark}, license = {Apache-2.0}, version = {2.5.0}, year = {2025} }

Don't forget to add yourself to the BibTeX above and to CITATION.cff if you contribute to this repository.

See also

References

Other benchmarks

Owner

  • Name: qpsolvers
  • Login: qpsolvers
  • Kind: organization

Quadratic programming benchmarks and solver interfaces.

Citation (CITATION.cff)

cff-version: 1.2.0
message: "If you find this code helpful, please cite it as below."
title: "qpbenchmark: Benchmark for quadratic programming solvers available in Python"
version: 2.5.0
date-released: 2025-05-07
url: "https://github.com/qpsolvers/qpbenchmark"
license: "Apache-2.0"
authors:
- family-names: "Caron"
  given-names: "Stéphane"
  orcid: "https://orcid.org/0000-0003-2906-692X"
- family-names: "Zaki"
  given-names: "Akram"
- family-names: "Otta"
  given-names: "Pavel"
  orcid: "https://orcid.org/0000-0002-9829-6895"
- family-names: "Arnström"
  given-names: "Daniel"
  orcid: "https://orcid.org/0000-0003-0970-0620"
- family-names: "Carpentier"
  given-names: "Justin"
  orcid: "https://orcid.org/0000-0001-6585-2894"
- family-names: "Yang"
  given-names: "Fengyu"
- family-names: "Leziart"
  given-names: "Pierre-Alexandre"
  orcid: "https://orcid.org/0000-0002-5653-4613"

GitHub Events

Total
  • Create event: 5
  • Release event: 2
  • Issues event: 1
  • Watch event: 36
  • Delete event: 5
  • Issue comment event: 4
  • Push event: 29
  • Pull request event: 7
  • Fork event: 3
Last Year
  • Create event: 5
  • Release event: 2
  • Issues event: 1
  • Watch event: 36
  • Delete event: 5
  • Issue comment event: 4
  • Push event: 29
  • Pull request event: 7
  • Fork event: 3

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 31
  • Total pull requests: 52
  • Average time to close issues: 2 months
  • Average time to close pull requests: 2 days
  • Total issue authors: 5
  • Total pull request authors: 4
  • Average comments per issue: 1.26
  • Average comments per pull request: 0.5
  • Merged pull requests: 51
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 1
  • Pull requests: 6
  • Average time to close issues: about 2 months
  • Average time to close pull requests: about 11 hours
  • Issue authors: 1
  • Pull request authors: 1
  • Average comments per issue: 1.0
  • Average comments per pull request: 1.0
  • Merged pull requests: 6
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • stephane-caron (25)
  • ottapav (2)
  • nim65s (1)
  • 563925743 (1)
  • jcarpent (1)
Pull Request Authors
  • stephane-caron (50)
  • ottapav (2)
  • darnstrom (1)
  • jcarpent (1)
Top Labels
Issue Labels
enhancement (12) bug (3) help wanted (2) good first issue (1) fairness (1) new solver (1)
Pull Request Labels

Packages

  • Total packages: 1
  • Total downloads:
    • pypi 53 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 1
  • Total versions: 11
  • Total maintainers: 1
pypi.org: qpbenchmark

Benchmark for quadratic programming solvers available in Python.

  • Versions: 11
  • Dependent Packages: 0
  • Dependent Repositories: 1
  • Downloads: 53 Last month
Rankings
Stargazers count: 8.3%
Dependent packages count: 10.1%
Forks count: 12.5%
Average: 13.2%
Downloads: 13.4%
Dependent repos count: 21.5%
Maintainers (1)
Last synced: 6 months ago

Dependencies

.github/workflows/ci.yml actions
  • actions/checkout v3 composite
  • actions/setup-python v4 composite
pyproject.toml pypi
  • clarabel >= 0.4.1
  • cvxopt >= 1.3.0
  • daqp >= 0.5.1
  • ecos >= 2.0.10
  • highspy >= 1.5.2
  • matplotlib >= 3.6.2
  • numpy >= 1.25.2
  • osqp >= 0.6.2
  • pandas >= 1.4.3
  • piqp >= 0.2.2
  • proxsuite >= 0.4.1
  • py-cpuinfo *
  • qpsolvers >= 3.4.0
  • quadprog >= 0.1.11
  • scs >= 3.2.2
  • tabulate >= 0.9.0
environment.yaml conda
  • cvxopt >=1.3.0
  • daqp >=0.5.1
  • ecos >=2.0.10
  • ipython
  • matplotlib
  • numpy >=1.25.2
  • osqp >=0.6.2
  • pandas
  • pip
  • piqp >=0.2.2
  • proxsuite >=0.4.1
  • qpoases >=3.2.0
  • qpsolvers >=3.4.0
  • quadprog >=0.1.11
  • tabulate