Skip to main content

A Python interface to conic optimization solvers.

Project description

PICOS is a user friendly Python API to several conic and integer programming solvers, designed to be used by both application developers and researchers as well as instructors teaching courses on mathematical optimization. It allows you to enter an optimization problem as a high level model, with painless support for (complex) vector and matrix variables and multidimensional algebra. Your model will be transformed to the standard form understood by an appropriate solver that is available at runtime. This makes your application portable as users have the choice between several commercial and open source solvers.

Features

PICOS supports the following solvers and problem types. To use a solver, you need to separately install it along with the Python interface listed here.

Solver

Python
interface




License

CPLEX

included

Yes

Yes

Yes

non-free

CVXOPT

native

Yes

Yes

Yes

GP

GPL-3

ECOS

ecos-python

Yes

Yes

Yes

Yes

GPL-3

GLPK

swiglpk

Yes

Yes

GPL-3

Gurobi

gurobipy

Yes

Yes

Yes

non-free

MOSEK

included

Yes

Yes

Yes

Yes

non-free

OSQP

native

Yes

QP

Apache-2.0

QICS

native

Yes

Yes

Yes

Yes

Yes

MIT

SCIP

PySCIPOpt

Yes

Yes

Yes

ZIB/MIT

SMCP

native

Yes

GPL-3

Example

This is what it looks like to solve a multidimensional mixed integer program with PICOS:

>>> import picos as pc
>>> P = pc.Problem()
>>> x = pc.IntegerVariable("x", 2)
>>> P += 2*x <= 11
>>> P.maximize = pc.sum(x)
>>> P.solve(solver="glpk")  # Optional: Use GLPK as backend.
<feasible primal solution (claimed optimal) from glpk>
>>> P.value
10.0
>>> print(x)
[ 5.00e+00]
[ 5.00e+00]

You can head to our quick examples or the tutorial for more.

Installation

As of release 2.2, PICOS requires Python 3.4 or later.

Via pip

If you are using pip you can run pip install picos to get the latest version.

Via Anaconda

If you are using Anaconda you can run conda install -c picos picos to get the latest version.

Via your system’s package manager

Distribution

Latest major version

Latest version

Arch Linux

python-picos

python-picos-git

If you are packaging PICOS for additional platforms, please let us know.

From source

The PICOS source code can be found on GitLab. There are only two dependencies:

Documentation

The full documentation can be browsed online or downloaded in PDF form.

Credits

Developers

Contributors

For an up-to-date list of all code contributors, please refer to the contributors page. Should a reference from before 2019 be unclear, see also the old contributors page on GitHub.

Citing

The preferred way to cite PICOS in your research is our JOSS paper:

@article{PICOS,
  author  = {Guillaume Sagnol and Maximilian Stahlberg},
  journal = {Journal of Open Source Software},
  title   = {{PICOS}: A {Python} interface to conic optimization solvers},
  year    = {2022},
  issn    = {2475-9066},
  month   = feb,
  number  = {70},
  pages   = {3915},
  volume  = {7},
  doi     = {10.21105/joss.03915},
}

If citing a specific version of PICOS is necessary, then we offer also source deposits on Zenodo.

License

PICOS is free and open source software and available to you under the terms of the GNU GPL v3.

Project details


Release history Release notifications | RSS feed

This version

2.5.1

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

picos-2.5.1.tar.gz (536.5 kB view details)

Uploaded Source

File details

Details for the file picos-2.5.1.tar.gz.

File metadata

  • Download URL: picos-2.5.1.tar.gz
  • Upload date:
  • Size: 536.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.12.7

File hashes

Hashes for picos-2.5.1.tar.gz
Algorithm Hash digest
SHA256 666b7385f7aed055112bba420c9ec0b1973a12565faedef7ad51f783c3a4902b
MD5 965ef0b76e014b6e5671dce8866621f5
BLAKE2b-256 37b75d03a0474e25ce97efc489adb8f9759b001b6ac6c080023b6e1420a31424

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page