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 multidemensional 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 runs under both Python 2 and Python 3 and supports the following solvers and problem types. To use a solver, you need to seperately 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

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 (the solver GLPK is chosen explicitly for reproducibility):

>>> import picos
>>> P = picos.Problem()
>>> x = picos.IntegerVariable("x", 2)
>>> P.add_constraint(x <= 5.5)
<2×1 Affine Constraint: x ≤ [5.5]>
>>> P.set_objective("max", picos.sum(x))
>>> P.solve(solver="glpk")
<feasible primal solution (claimed optimal) from glpk>
>>> P.value
10.0
>>> print(x)
[ 5.00e+00]
[ 5.00e+00]

Documentation & Source

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

  • The API documentation without the tutorial and examples is also available as a separate PDF.

  • The source code lives on GitLab.

Installation

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

On Arch Linux, there are seperate packages in the AUR for the latest version and the latest release. Both are split packages that ship both Python 2 and Python 3 versions of PICOS.

If you are packaging PICOS for additional systems, please tell us so we can list your package here!

From source

If you are installing PICOS manually, you can choose between a number of development versions and source releases. You will need to have at least the following Python packages installed:

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

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.0.5.tar.gz (236.8 kB view details)

Uploaded Source

File details

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

File metadata

  • Download URL: PICOS-2.0.5.tar.gz
  • Upload date:
  • Size: 236.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.8.2

File hashes

Hashes for PICOS-2.0.5.tar.gz
Algorithm Hash digest
SHA256 c23050ce13db6f7ff5e7fe819046a6fe8eec0b5d976582679a4f39907619f28b
MD5 a7c62fc25ab928a272a9d5963b68b3fe
BLAKE2b-256 893fa54f3eb3ab2846dac2842b732396aaf6a025ddea09e43a0462c069c9dce3

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