Python interface and modeling environment for SCIP
Project description
PySCIPOpt
This project provides an interface from Python to the SCIP Optimization Suite. Starting from v8.0.3, SCIP uses the Apache2.0 license. If you plan to use an earlier version of SCIP, please review SCIP's license restrictions.
Documentation
Please consult the online documentation or use the help()
function directly in Python or ?
in IPython/Jupyter.
The old documentation, which we are in the process of migrating from, is still more complete w.r.t. the API, and can be found here
See CHANGELOG.md for added, removed or fixed functionality.
Installation
The recommended installation method is via PyPI
pip install pyscipopt
For information on specific versions, installation via Conda, and guides for building from source, please see the online documentation.
Building and solving a model
There are several examples and tutorials. These display some functionality of the interface and can serve as an entry point for writing more complex code. Some of the common usecases are also available in the recipes sub-package. You might also want to have a look at this article about PySCIPOpt: https://opus4.kobv.de/opus4-zib/frontdoor/index/index/docId/6045. The following steps are always required when using the interface:
- It is necessary to import python-scip in your code. This is achieved by including the line
from pyscipopt import Model
- Create a solver instance.
model = Model("Example") # model name is optional
- Access the methods in the
scip.pxi
file using the solver/model instancemodel
, e.g.:
x = model.addVar("x")
y = model.addVar("y", vtype="INTEGER")
model.setObjective(x + y)
model.addCons(2*x - y*y >= 0)
model.optimize()
sol = model.getBestSol()
print("x: {}".format(sol[x]))
print("y: {}".format(sol[y]))
Writing new plugins
The Python interface can be used to define custom plugins to extend the
functionality of SCIP. You may write a pricer, heuristic or even
constraint handler using pure Python code and SCIP can call their
methods using the callback system. Every available plugin has a base
class that you need to extend, overwriting the predefined but empty
callbacks. Please see test_pricer.py
and test_heur.py
for two simple
examples.
Please notice that in most cases one needs to use a dictionary
to
specify the return values needed by SCIP.
Citing PySCIPOpt
Please cite this paper
@incollection{MaherMiltenbergerPedrosoRehfeldtSchwarzSerrano2016,
author = {Stephen Maher and Matthias Miltenberger and Jo{\~{a}}o Pedro Pedroso and Daniel Rehfeldt and Robert Schwarz and Felipe Serrano},
title = {{PySCIPOpt}: Mathematical Programming in Python with the {SCIP} Optimization Suite},
booktitle = {Mathematical Software {\textendash} {ICMS} 2016},
publisher = {Springer International Publishing},
pages = {301--307},
year = {2016},
doi = {10.1007/978-3-319-42432-3_37},
}
as well as the corresponding SCIP Optimization Suite report when you use this tool for a publication or other scientific work.
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
Built Distributions
File details
Details for the file pyscipopt-5.2.1.tar.gz
.
File metadata
- Download URL: pyscipopt-5.2.1.tar.gz
- Upload date:
- Size: 1.2 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | efbe902ae220b5a79719cd44f5c7fb320334ef8499d6c297db97b595d366c09b |
|
MD5 | ad5af0c0bf6a52cf7bd2f8c151177d83 |
|
BLAKE2b-256 | 6eec1d5f0b488e305940ae5b8331e1f458f08c52cf479e83661339978a4e1ba2 |
File details
Details for the file PySCIPOpt-5.2.1-cp313-cp313-win_amd64.whl
.
File metadata
- Download URL: PySCIPOpt-5.2.1-cp313-cp313-win_amd64.whl
- Upload date:
- Size: 56.3 MB
- Tags: CPython 3.13, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e9bc26ec5248e7000aea4040a36279ee2eb03ffaac9f25c60e10d0c9533344a9 |
|
MD5 | 8aa5d26803980ee360a1216a3a7c8cb4 |
|
BLAKE2b-256 | c30daaf7108a65961607716f0c83b5f90913dfc337261a24017f25a12fa873b9 |
File details
Details for the file PySCIPOpt-5.2.1-cp313-cp313-manylinux_2_28_x86_64.whl
.
File metadata
- Download URL: PySCIPOpt-5.2.1-cp313-cp313-manylinux_2_28_x86_64.whl
- Upload date:
- Size: 15.4 MB
- Tags: CPython 3.13, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8750a0e3ccf11df9a3d15db247db2de5c5ff0b9ca5cd43d66254039798d5881c |
|
MD5 | cacbc3c398172b4cda9a799dd1023e75 |
|
BLAKE2b-256 | c01f29e0098b2f66f5c7db99e81d4b5e471e14a87256bac01d8268fd87baf5f2 |
File details
Details for the file PySCIPOpt-5.2.1-cp313-cp313-macosx_14_0_arm64.whl
.
File metadata
- Download URL: PySCIPOpt-5.2.1-cp313-cp313-macosx_14_0_arm64.whl
- Upload date:
- Size: 7.8 MB
- Tags: CPython 3.13, macOS 14.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 16cbc17beae15d1e18523adb04dbb3f6991667ae57ac1da55b9065cbfed37b31 |
|
MD5 | 6aa3f5a08e84accdcd9917211b625a36 |
|
BLAKE2b-256 | 3fc0497b514bacbc15e2402b056cccc3c16e0e000beecee6e2b225b3c77917ee |
File details
Details for the file PySCIPOpt-5.2.1-cp313-cp313-macosx_13_0_x86_64.whl
.
File metadata
- Download URL: PySCIPOpt-5.2.1-cp313-cp313-macosx_13_0_x86_64.whl
- Upload date:
- Size: 11.3 MB
- Tags: CPython 3.13, macOS 13.0+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 00061b02da0839e8420b5585beebef631360341a47b19a9bd12e1bc9d8b1e657 |
|
MD5 | c9bd2f77ebbf6637b71512c54af85246 |
|
BLAKE2b-256 | c78f86360c004e9997982c6cd0f861d2d7e4f8390f54970f6d26d02de3249650 |
File details
Details for the file PySCIPOpt-5.2.1-cp312-cp312-win_amd64.whl
.
File metadata
- Download URL: PySCIPOpt-5.2.1-cp312-cp312-win_amd64.whl
- Upload date:
- Size: 56.3 MB
- Tags: CPython 3.12, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 17ba9e0ff864859263dbb9ae67e1724b470566b99cbeaf4b64eef61f825c3a30 |
|
MD5 | 2f0327a1516d73b55c0c5e7751b847b5 |
|
BLAKE2b-256 | b56d09ab8cd8ff03cc01ef9e00e0f56845e1d1c81e1d1713ab38588e8b00d329 |
File details
Details for the file PySCIPOpt-5.2.1-cp312-cp312-manylinux_2_28_x86_64.whl
.
File metadata
- Download URL: PySCIPOpt-5.2.1-cp312-cp312-manylinux_2_28_x86_64.whl
- Upload date:
- Size: 15.4 MB
- Tags: CPython 3.12, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 51179c91189a5e9673ded74e3359f8dcfe1b29eb43ba1a46f66e4b0465fe4389 |
|
MD5 | 2a86f261f701546898879ec3fd2bbd01 |
|
BLAKE2b-256 | 4f418cc1eac9d8561991edf02373ac3ac0961f8a86bfd5d62d8ca11a3b643a49 |
File details
Details for the file PySCIPOpt-5.2.1-cp312-cp312-macosx_14_0_arm64.whl
.
File metadata
- Download URL: PySCIPOpt-5.2.1-cp312-cp312-macosx_14_0_arm64.whl
- Upload date:
- Size: 7.8 MB
- Tags: CPython 3.12, macOS 14.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 999b7cbf6867f97a2da8d7b7761ff89be8387868568acc5442afae6c148423b5 |
|
MD5 | 143d0348758e899c91cbd3ab937d121c |
|
BLAKE2b-256 | b8bde5955aac1a41bbcd21150b2dd2cdbc26dc0c02fe31808a4bcc7526cb6597 |
File details
Details for the file PySCIPOpt-5.2.1-cp312-cp312-macosx_13_0_x86_64.whl
.
File metadata
- Download URL: PySCIPOpt-5.2.1-cp312-cp312-macosx_13_0_x86_64.whl
- Upload date:
- Size: 11.3 MB
- Tags: CPython 3.12, macOS 13.0+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 59558009eaa19bcee82606df4d5ee92046304f8d3c6aeed08138f90106bd752e |
|
MD5 | ce525459105fffb619e7c7f7f1e403a2 |
|
BLAKE2b-256 | 93ce71f0db390d9a5c206fc1589a5dff8edda53c98139c798f5b16b707713d03 |
File details
Details for the file PySCIPOpt-5.2.1-cp311-cp311-win_amd64.whl
.
File metadata
- Download URL: PySCIPOpt-5.2.1-cp311-cp311-win_amd64.whl
- Upload date:
- Size: 56.4 MB
- Tags: CPython 3.11, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4afa5f562ebf124f57db451a6c11c1267df1090e04a96be3e223fd50fe980601 |
|
MD5 | 049f5b86a26f11b10ebb3e2ef7cbbb71 |
|
BLAKE2b-256 | fca3ff1c6ddc1d1ff1552e77abc47189ab7155c4594c74b6fae0df22bfbad95d |
File details
Details for the file PySCIPOpt-5.2.1-cp311-cp311-manylinux_2_28_x86_64.whl
.
File metadata
- Download URL: PySCIPOpt-5.2.1-cp311-cp311-manylinux_2_28_x86_64.whl
- Upload date:
- Size: 15.5 MB
- Tags: CPython 3.11, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3e9db80456f4c0c50ea9d45d988ec67ec0adbb713e64c36bc75db28937f17ea7 |
|
MD5 | 2896d474dc2b9c01232e8f978a34b507 |
|
BLAKE2b-256 | f73f2761e544561cba4a5012c089168e6d5e3cf4758546df121dd0f9544b7bdf |
File details
Details for the file PySCIPOpt-5.2.1-cp311-cp311-macosx_14_0_arm64.whl
.
File metadata
- Download URL: PySCIPOpt-5.2.1-cp311-cp311-macosx_14_0_arm64.whl
- Upload date:
- Size: 7.8 MB
- Tags: CPython 3.11, macOS 14.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 45bd08aed9dde38a33921a0ef9b85ec14fda311c7d3d6f7e7660b9768ed66b3e |
|
MD5 | bd80a2e6265554d8d60eafe9b4e45e55 |
|
BLAKE2b-256 | 2d8ab78f7f1b0cfd783401bb305212a4d259729034757476ff96b08228afceed |
File details
Details for the file PySCIPOpt-5.2.1-cp311-cp311-macosx_13_0_x86_64.whl
.
File metadata
- Download URL: PySCIPOpt-5.2.1-cp311-cp311-macosx_13_0_x86_64.whl
- Upload date:
- Size: 11.3 MB
- Tags: CPython 3.11, macOS 13.0+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | aa9a7603ca94253d85295ca29994a34629da433465eccf0fa26810914bd6ec3b |
|
MD5 | 4db21adeaec5fc9959ed1fea8e688f82 |
|
BLAKE2b-256 | e704bb4ae9e86c7cbc6944b5fe63aee84c87450ec4161f72ffded628beacd607 |
File details
Details for the file PySCIPOpt-5.2.1-cp310-cp310-win_amd64.whl
.
File metadata
- Download URL: PySCIPOpt-5.2.1-cp310-cp310-win_amd64.whl
- Upload date:
- Size: 56.4 MB
- Tags: CPython 3.10, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6ca3abdb5e7e703aa9cfd741ebc36971609dd54acaa4aa1b8748edf094b2ef08 |
|
MD5 | d2f784d146ada0c3ad0966d3fd42f7f7 |
|
BLAKE2b-256 | 92ff48511ffc317c28747b8ab8710f4e0774d79bbc2d4e30eeb0a2dd8adefeee |
File details
Details for the file PySCIPOpt-5.2.1-cp310-cp310-manylinux_2_28_x86_64.whl
.
File metadata
- Download URL: PySCIPOpt-5.2.1-cp310-cp310-manylinux_2_28_x86_64.whl
- Upload date:
- Size: 14.9 MB
- Tags: CPython 3.10, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 207c6c2a3531fb7dc4d8abb033ce8c7fa92176c3a3f4d85143a5f728eebc485b |
|
MD5 | f18d6474bfb6ef768cbca4bdb5a2bbb7 |
|
BLAKE2b-256 | 8642564a16abe6facf159281c108bc1720857079dbfb053024ff4b81689650e2 |
File details
Details for the file PySCIPOpt-5.2.1-cp310-cp310-macosx_14_0_arm64.whl
.
File metadata
- Download URL: PySCIPOpt-5.2.1-cp310-cp310-macosx_14_0_arm64.whl
- Upload date:
- Size: 7.8 MB
- Tags: CPython 3.10, macOS 14.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 599be94cde551971a8ec3d200d4187697243d598abc8994ce3a815d9f0ab5762 |
|
MD5 | 7f1fcc2d54f2b1844cf0a00e729b6f3e |
|
BLAKE2b-256 | fbfa8908005a5b40787cc7a04b89f441733fbb228ecffc707ca282c57535c871 |
File details
Details for the file PySCIPOpt-5.2.1-cp310-cp310-macosx_13_0_x86_64.whl
.
File metadata
- Download URL: PySCIPOpt-5.2.1-cp310-cp310-macosx_13_0_x86_64.whl
- Upload date:
- Size: 11.3 MB
- Tags: CPython 3.10, macOS 13.0+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e9d184bccd7aa1c3d6b9b500a3d33a9b8b2812f833eb72826f5ac79111fc7610 |
|
MD5 | 1d8ffcc641407e1441134e3c8ffdb9fa |
|
BLAKE2b-256 | df938c9a053a870ee336a0adc9378455a43e3bd507dd2f7e67b362488cc501cf |
File details
Details for the file PySCIPOpt-5.2.1-cp39-cp39-win_amd64.whl
.
File metadata
- Download URL: PySCIPOpt-5.2.1-cp39-cp39-win_amd64.whl
- Upload date:
- Size: 56.4 MB
- Tags: CPython 3.9, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3c060932d4ae2abe06901d59db65751ffefaddd957e4a43c342ed4fe8cc83c04 |
|
MD5 | d3a37ae8578c388b67c8159e461351af |
|
BLAKE2b-256 | 621e3c7ebe2f6a42868a7f80148bcb6355c9b2a210dce77a224195894eb191b8 |
File details
Details for the file PySCIPOpt-5.2.1-cp39-cp39-manylinux_2_28_x86_64.whl
.
File metadata
- Download URL: PySCIPOpt-5.2.1-cp39-cp39-manylinux_2_28_x86_64.whl
- Upload date:
- Size: 14.9 MB
- Tags: CPython 3.9, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 83b8820fafce06aa208fb38735e92ca3b54a7632cb75d6e67dd239c7f848d464 |
|
MD5 | 384dc59752f55e4060c0db50c8492ea9 |
|
BLAKE2b-256 | 05f99b1158bc3d3ba2228024df897f11e4178ac268bdc17821fd8f18d9d1b1bc |
File details
Details for the file PySCIPOpt-5.2.1-cp39-cp39-macosx_14_0_arm64.whl
.
File metadata
- Download URL: PySCIPOpt-5.2.1-cp39-cp39-macosx_14_0_arm64.whl
- Upload date:
- Size: 7.8 MB
- Tags: CPython 3.9, macOS 14.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 903b1fc37c07b1d3a28fdecc785521d9391bd2fa51b0b58ce142392e157d5be9 |
|
MD5 | 93cc3f5b937e33bf4540064147e7e5d9 |
|
BLAKE2b-256 | 8c0f31319e5edefb46a733788de63edf648f9f9134a7cc7da01f485beaef92b4 |
File details
Details for the file PySCIPOpt-5.2.1-cp39-cp39-macosx_13_0_x86_64.whl
.
File metadata
- Download URL: PySCIPOpt-5.2.1-cp39-cp39-macosx_13_0_x86_64.whl
- Upload date:
- Size: 11.3 MB
- Tags: CPython 3.9, macOS 13.0+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 71999e7a27bc998fce74a56bf1b2bd02e707b66e50289686c9179e9eeb886a40 |
|
MD5 | fff148a95dc5db6e78d41556a5b6a51d |
|
BLAKE2b-256 | 4f5dfcf001293be4276412a09f5bdfe13dbb34a535edf723537a45c841d87870 |
File details
Details for the file PySCIPOpt-5.2.1-cp38-cp38-win_amd64.whl
.
File metadata
- Download URL: PySCIPOpt-5.2.1-cp38-cp38-win_amd64.whl
- Upload date:
- Size: 56.4 MB
- Tags: CPython 3.8, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 120182612d0dd869421363b8603046f4414a158095250b36ac8cba00cdaec164 |
|
MD5 | 50226cab23fa65ba802e1b259ce5e161 |
|
BLAKE2b-256 | 14671bd6bbb329760caf364ec0cf68e29c45c33a5278b5f15e1c0687afc9185a |
File details
Details for the file PySCIPOpt-5.2.1-cp38-cp38-manylinux_2_28_x86_64.whl
.
File metadata
- Download URL: PySCIPOpt-5.2.1-cp38-cp38-manylinux_2_28_x86_64.whl
- Upload date:
- Size: 15.1 MB
- Tags: CPython 3.8, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | db515062ddd6c38da2b2dbd88a52f1efbfd05890e954c0501973fa1e366c83e2 |
|
MD5 | f58102e6c52dc016ba6331c1b0a955a1 |
|
BLAKE2b-256 | 453bd4f5c4472773c24afc1bc9c56f4c46d9eb338b559b0003b7888cc9abac96 |
File details
Details for the file PySCIPOpt-5.2.1-cp38-cp38-macosx_14_0_arm64.whl
.
File metadata
- Download URL: PySCIPOpt-5.2.1-cp38-cp38-macosx_14_0_arm64.whl
- Upload date:
- Size: 7.8 MB
- Tags: CPython 3.8, macOS 14.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | dc80b10cad4043053962f0ee7a15c585f63b0387d916eca56a70c713313982d3 |
|
MD5 | f0f734d4e263a2bbdaad0813eb6491d0 |
|
BLAKE2b-256 | 784e478a78da385663fa5eadea5b9eabf7f5af96d182a1371732e09f84dec372 |
File details
Details for the file PySCIPOpt-5.2.1-cp38-cp38-macosx_13_0_x86_64.whl
.
File metadata
- Download URL: PySCIPOpt-5.2.1-cp38-cp38-macosx_13_0_x86_64.whl
- Upload date:
- Size: 11.3 MB
- Tags: CPython 3.8, macOS 13.0+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a76b51109a94beb0a798efe86e6e0da5a760bac8ef33e948abffc60d2621a025 |
|
MD5 | 976db150c60212597019070f99512525 |
|
BLAKE2b-256 | 909bfedb350d0d3769dd21df3c711d75e63649fe1670959e9b108fb04a89221d |