A Python interface to conic optimization solvers.
Project description
A Python Interface to Conic Optimization Solvers
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:
Solver | Interface | LP | SOCP | SDP | QP | QCQP | GP | EXP | MIP | License | Note |
---|---|---|---|---|---|---|---|---|---|---|---|
CPLEX | included | Yes | Yes | Yes | Yes | Yes | Commercial | ||||
CVXOPT | not needed | Yes | Yes | Yes | Yes | Yes | Yes | Open Source | |||
ECOS | ecos-python | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Open Source | WIP | |
GLPK | swiglpk | Yes | Yes | Open Source | WIP | ||||||
Gurobi | included | Yes | Yes | Yes | Yes | Yes | Commercial | ||||
MOSEK | included | Yes | Yes | Yes | Yes | Yes | Yes | Commercial | |||
SMCP | not needed | Yes | Yes | Yes | Yes | Yes | Open Source | ||||
SCIP | PySCIPOpt | Yes | Yes | Yes | Yes | Yes | Noncommercial | WIP |
To use a solver, you need to seperately install it along with the (low-level) Python interface listed here.
Example
This is what it looks like to solve a multidimensional mixed integer program with PICOS:
>>> import picos
>>> P = picos.Problem()
>>> x = P.add_variable("x", 2, vtype="integer")
>>> C = P.add_constraint(x <= 5.5)
>>> P.set_objective("max", 1|x) # 1|x is the sum over x
>>> solution = P.solve(verbose = 0)
>>> print(solution["status"])
'integer optimal solution'
>>> print(P.obj_value())
10.0
>>> print(x)
[ 5.00e+00]
[ 5.00e+00]
>>> print(C.slack)
[ 5.00e-01]
[ 5.00e-01]
Documentation
The full documentation can be found here.
Installation
Via pip
If you are using pip you can run
pip install picos
to get the latest release.
Via Anaconda
If you are using Anaconda you can run
conda install -c picos picos
to get the latest release.
Via your system's package manager
On Arch Linux, there are seperate packages in the AUR for Python 2 and Python 3.
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
- Guillaume Sagnol is PICOS' initial author and primary developer since 2012.
- Maximilian Stahlberg is extending and maintaining PICOS since 2017.
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
File details
Details for the file PICOS-1.1.2.post116.tar.gz
.
File metadata
- Download URL: PICOS-1.1.2.post116.tar.gz
- Upload date:
- Size: 131.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.4.1 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.7.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e5b020dd0aeff911294222e50e88d8e7b023f4dd1c37bd90bae0f7c94aff6614 |
|
MD5 | 08021b0626f5f9c08d5034cbfec4d91c |
|
BLAKE2b-256 | 3c88672239970c8dd97f6c19d34a12ceb988d696e7119229bbaa0c8f6a43a11e |