Code Monkey home page Code Monkey logo

osqp_benchmarks's Introduction

Benchmark examples for the OSQP solver

These are the scripts to compare the following Quadratic Program (QP) solvers

  • OSQP
  • GUROBI
  • MOSEK
  • ECOS (through CVXPY)
  • qpOASES

The detailed description of these tests is available in this paper. To run these scripts you need pandas and cvxpy installed.

All the scripts (apart from the parametric examples) come with options (default to False)

  • --parallel for parallel execution across instances
  • --verbose for verbose solvers output (they can be slower than necessary while printing)
  • --high_accuracy for high accuracy eps=1e-05 solver settings + optimality checks (default is eps=1e-03)

Benchmark problems

The problems are all randomly generated as described in the OSQP paper. They produce a benchmark library of 1400 problems with nonzeros ranging from 100 to 10'000'000. Problem instances include

  • Random QP
  • Equality constrained QP
  • Portfolio
  • Lasso
  • Huber fitting
  • Support vector machines (SVM)
  • Constrained optimal control

We generate the problems using the scripts in the problem_classes folder.

To execute these tests run

python run_benchmark_problems.py

Results

The resulting shifted geometric means are

OSQP GUROBI MOSEK ECOS qpOASES
1.0 4.28 2.52 28.85 149.93

Maros Meszaros problems

These are the hard problems from the Maros Meszaros testset converted using CUTEst and the scripts in the maros_meszaros_data/ folder. In these benchmarks we compare OSQP with GUROBI and MOSEK.

To execute these tests run

python run_maros_meszaros_problems.py

Results

The resulting shifted geometric means are

OSQP GUROBI MOSEK
1.46 1.0 6.12

SuiteSparse Matrix Lasso and Huber Fitting problems

These are Lasso and Huber fitting problems generated from Least-Squares linear systems Ax ~ b from the SuiteSparse Matrix Collection. They are downloaded and converted to mat using the download.jl script. They are a total of 60 problems (30 Lasso and 30 Huber fitting).

To execute these tests run

python run_suitesparse_problems.py

Results

The resulting shifted geometric means are

OSQP GUROBI MOSEK
1.0 1.63 1.74

Parametric problems

These tests apply only to the OSQP solver with and without warm-starting for three parametric examples of

  • Portfolio
  • Lasso
  • Constrained optimal control (MPC)

The problem construction is the same as for the same categories in the Benchmark Problems.

To execute these tests run

python run_parametric_problems.py

Citing

If you are using these benchmarks for your work, please cite the OSQP paper.

osqp_benchmarks's People

Contributors

bstellato avatar gbanjac avatar jcarpent avatar goulart-paul avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.