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, very much like YALMIP or CVX under MATLAB.

PICOS allows you to enter a mathematical 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

included

Yes

Yes

Yes

non-free

MOSEK

included

Yes

Yes

Yes

WIP

Yes

non-free

OSQP

native

Yes

QP

Apache-2.0

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 the tutorial for more examples.

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 release

Latest version

Arch Linux

python-picos

python-picos-git

If you are packaging PICOS for additional systems, 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, you can refer to the old contributors page on GitHub as well.

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.3.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.3.1.tar.gz (332.8 kB view details)

Uploaded Source

File details

Details for the file PICOS-2.3.1.tar.gz.

File metadata

  • Download URL: PICOS-2.3.1.tar.gz
  • Upload date:
  • Size: 332.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

File hashes

Hashes for PICOS-2.3.1.tar.gz
Algorithm Hash digest
SHA256 37890f8537d16448648efd8df5f056f2defb3a336becf24b228268c4c8038440
MD5 494344a59d964ef612321d84cf9d45c3
BLAKE2b-256 dfc701ff0497a17841329f99eb91a4f0de08040fd717d362b8345571305a0b72

See more details on using hashes here.

Supported by

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