Skip to main content

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.

Gitter PySCIPOpt on PyPI Integration test coverage AppVeyor Status

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:

  1. It is necessary to import python-scip in your code. This is achieved by including the line
from pyscipopt import Model
  1. Create a solver instance.
model = Model("Example")  # model name is optional
  1. Access the methods in the scip.pxi file using the solver/model instance model, 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.

Using PySCIPOpt?

If your project or company is using PySCIPOpt, consider letting us know at scip@zib.de. We are always interested in knowing how PySCIPOpt is being used, and, given permission, would also appreciate adding your company's logo to our website.

If you are creating models with some degree of complexity which don't take too long to solve, also consider sharing them with us. We might want to add them to tests/helpers/utils.py to help make our tests more robust, or add them to our examples.

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


Download files

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

Source Distribution

pyscipopt-5.4.0.tar.gz (1.3 MB view details)

Uploaded Source

Built Distributions

PySCIPOpt-5.4.0-cp313-cp313-win_amd64.whl (56.9 MB view details)

Uploaded CPython 3.13 Windows x86-64

PySCIPOpt-5.4.0-cp313-cp313-manylinux_2_28_x86_64.whl (15.7 MB view details)

Uploaded CPython 3.13 manylinux: glibc 2.28+ x86-64

PySCIPOpt-5.4.0-cp313-cp313-macosx_14_0_arm64.whl (7.2 MB view details)

Uploaded CPython 3.13 macOS 14.0+ ARM64

PySCIPOpt-5.4.0-cp313-cp313-macosx_13_0_x86_64.whl (10.5 MB view details)

Uploaded CPython 3.13 macOS 13.0+ x86-64

PySCIPOpt-5.4.0-cp312-cp312-win_amd64.whl (56.9 MB view details)

Uploaded CPython 3.12 Windows x86-64

PySCIPOpt-5.4.0-cp312-cp312-manylinux_2_28_x86_64.whl (15.6 MB view details)

Uploaded CPython 3.12 manylinux: glibc 2.28+ x86-64

PySCIPOpt-5.4.0-cp312-cp312-macosx_14_0_arm64.whl (7.2 MB view details)

Uploaded CPython 3.12 macOS 14.0+ ARM64

PySCIPOpt-5.4.0-cp312-cp312-macosx_13_0_x86_64.whl (10.5 MB view details)

Uploaded CPython 3.12 macOS 13.0+ x86-64

PySCIPOpt-5.4.0-cp311-cp311-win_amd64.whl (57.0 MB view details)

Uploaded CPython 3.11 Windows x86-64

PySCIPOpt-5.4.0-cp311-cp311-manylinux_2_28_x86_64.whl (15.9 MB view details)

Uploaded CPython 3.11 manylinux: glibc 2.28+ x86-64

PySCIPOpt-5.4.0-cp311-cp311-macosx_14_0_arm64.whl (7.3 MB view details)

Uploaded CPython 3.11 macOS 14.0+ ARM64

PySCIPOpt-5.4.0-cp311-cp311-macosx_13_0_x86_64.whl (10.5 MB view details)

Uploaded CPython 3.11 macOS 13.0+ x86-64

PySCIPOpt-5.4.0-cp310-cp310-win_amd64.whl (57.0 MB view details)

Uploaded CPython 3.10 Windows x86-64

PySCIPOpt-5.4.0-cp310-cp310-manylinux_2_28_x86_64.whl (15.2 MB view details)

Uploaded CPython 3.10 manylinux: glibc 2.28+ x86-64

PySCIPOpt-5.4.0-cp310-cp310-macosx_14_0_arm64.whl (7.2 MB view details)

Uploaded CPython 3.10 macOS 14.0+ ARM64

PySCIPOpt-5.4.0-cp310-cp310-macosx_13_0_x86_64.whl (10.5 MB view details)

Uploaded CPython 3.10 macOS 13.0+ x86-64

PySCIPOpt-5.4.0-cp39-cp39-win_amd64.whl (57.0 MB view details)

Uploaded CPython 3.9 Windows x86-64

PySCIPOpt-5.4.0-cp39-cp39-manylinux_2_28_x86_64.whl (15.2 MB view details)

Uploaded CPython 3.9 manylinux: glibc 2.28+ x86-64

PySCIPOpt-5.4.0-cp39-cp39-macosx_14_0_arm64.whl (7.2 MB view details)

Uploaded CPython 3.9 macOS 14.0+ ARM64

PySCIPOpt-5.4.0-cp39-cp39-macosx_13_0_x86_64.whl (10.5 MB view details)

Uploaded CPython 3.9 macOS 13.0+ x86-64

PySCIPOpt-5.4.0-cp38-cp38-win_amd64.whl (57.0 MB view details)

Uploaded CPython 3.8 Windows x86-64

PySCIPOpt-5.4.0-cp38-cp38-manylinux_2_28_x86_64.whl (15.4 MB view details)

Uploaded CPython 3.8 manylinux: glibc 2.28+ x86-64

PySCIPOpt-5.4.0-cp38-cp38-macosx_14_0_arm64.whl (7.2 MB view details)

Uploaded CPython 3.8 macOS 14.0+ ARM64

PySCIPOpt-5.4.0-cp38-cp38-macosx_13_0_x86_64.whl (10.5 MB view details)

Uploaded CPython 3.8 macOS 13.0+ x86-64

File details

Details for the file pyscipopt-5.4.0.tar.gz.

File metadata

  • Download URL: pyscipopt-5.4.0.tar.gz
  • Upload date:
  • Size: 1.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for pyscipopt-5.4.0.tar.gz
Algorithm Hash digest
SHA256 aca70a8058e443809fae1dddef61fe0d12856b4b2241f3bb6796ce89f9ad0ecd
MD5 b4dd72a3d569fd1ce05327d05aeefd05
BLAKE2b-256 d105dc9f116384d7fde7960f522c6e4aa4019658b9f995c3ea4c15bbb99111e8

See more details on using hashes here.

File details

Details for the file PySCIPOpt-5.4.0-cp313-cp313-win_amd64.whl.

File metadata

File hashes

Hashes for PySCIPOpt-5.4.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 cf16c8f8a1a16aa7119391b02a00e6e8eb192ff926d097e20a571acfcae32432
MD5 e991fa4c1f57b659705818d99301ec81
BLAKE2b-256 923182195837a71c14e712af3e8e3c4008abfb8594bd3990035eff397ccaac80

See more details on using hashes here.

File details

Details for the file PySCIPOpt-5.4.0-cp313-cp313-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for PySCIPOpt-5.4.0-cp313-cp313-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 4d27b0ade455209fa4d87eceaa1cefa1d4a863882c60824c6ef3d10fc1afd6aa
MD5 dd4ed179cd5c0aed05efa6527cbd9b24
BLAKE2b-256 c9c8c5f550b5e51677c50643cdcbe3720c691c0ea12cfed67e74c66ea298080d

See more details on using hashes here.

File details

Details for the file PySCIPOpt-5.4.0-cp313-cp313-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for PySCIPOpt-5.4.0-cp313-cp313-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 970c9a42b82b2523e9879adecae33c3671ae049156a47408f8319746a174bb33
MD5 e09dc5803661b828821b10cc5f3cdeab
BLAKE2b-256 9d9b537bf5a5d831a6e29d1059412fc9ad806baf38952ecf01baf1e7a37d28e6

See more details on using hashes here.

File details

Details for the file PySCIPOpt-5.4.0-cp313-cp313-macosx_13_0_x86_64.whl.

File metadata

File hashes

Hashes for PySCIPOpt-5.4.0-cp313-cp313-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 0a31cb9785f3ac5673ae02da2e10c3f169fe8092a8372a08725e48b4a744ac3e
MD5 a1486782a13ea110a90aedb988bc087b
BLAKE2b-256 f0441940bd1958d0267d2195797cec317b4a76a6aadcf81a64586bf5af4932eb

See more details on using hashes here.

File details

Details for the file PySCIPOpt-5.4.0-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for PySCIPOpt-5.4.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 06a5e9e2a1bf2a449bda535b2cb61e347806c0715bdf13e8bf9d71e23ae6d013
MD5 06c6a5e851a4634a989ef92c9e45b4c6
BLAKE2b-256 c641b9119433bb9133350ea650ed44b1f6d00406140ab61159f0bde4b5991080

See more details on using hashes here.

File details

Details for the file PySCIPOpt-5.4.0-cp312-cp312-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for PySCIPOpt-5.4.0-cp312-cp312-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 5bf22f63a3b31c6a5195fedc50e56a624500dae7a51196278d60062c233f95ef
MD5 37656fef4ec3366081d7847219884df5
BLAKE2b-256 73952fe9a28cc67d9295a682d96a0329d010503dbc3e7bb7de94ea7f158bc90c

See more details on using hashes here.

File details

Details for the file PySCIPOpt-5.4.0-cp312-cp312-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for PySCIPOpt-5.4.0-cp312-cp312-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 1d14269a63ada53f7eb9554a76c17b7bb7257d7c399abe2d8b6e0ff9d97b14a5
MD5 5be451f220c345b097b6887f3c304b96
BLAKE2b-256 3ba4a2d931ac93dc006c14a3c69008a7dff3917d94b3995c9aeb056f5fe2c6be

See more details on using hashes here.

File details

Details for the file PySCIPOpt-5.4.0-cp312-cp312-macosx_13_0_x86_64.whl.

File metadata

File hashes

Hashes for PySCIPOpt-5.4.0-cp312-cp312-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 1ea7db25716c2f6a89105db3f9eb996080a9b55a4fe6bb3526ba0d2299694857
MD5 d5c19a28e97520c3b9fb01ac3fb3a5bb
BLAKE2b-256 ef917ad14a5fafd3625e509458e8bb7c67bb900be61ac88956197f99b43c5bcf

See more details on using hashes here.

File details

Details for the file PySCIPOpt-5.4.0-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for PySCIPOpt-5.4.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 e98c944306979d714551559d04da50cf9406c44e6288e2b2c4e1cdf000ef77da
MD5 359fcdea34d9533b2846eedd01fdca27
BLAKE2b-256 bc54deee33639327639de1a307b4053a92aa0c789cc02a2063822832f7330dbb

See more details on using hashes here.

File details

Details for the file PySCIPOpt-5.4.0-cp311-cp311-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for PySCIPOpt-5.4.0-cp311-cp311-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 4aa4e5ecb511f4fd6744ca561c519665ce71fb5d30046a5dba96db3912188dd7
MD5 d5038cb7b0518588ea68d7b259c8b139
BLAKE2b-256 f0ab9a9a53013ed4377a221664d15f966832423be8dc682ebcbd1ae3358f1358

See more details on using hashes here.

File details

Details for the file PySCIPOpt-5.4.0-cp311-cp311-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for PySCIPOpt-5.4.0-cp311-cp311-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 65a7fef0e688cc144116a530db4317922ae7237689ca7ce976bc43f898628b1d
MD5 2d4f8f481c5ffbe309cffc1ef5395ec0
BLAKE2b-256 cfc59b2b94f40d46372a5df664e3fe6ce8a2881440d6192f76d6aebc7792ac8b

See more details on using hashes here.

File details

Details for the file PySCIPOpt-5.4.0-cp311-cp311-macosx_13_0_x86_64.whl.

File metadata

File hashes

Hashes for PySCIPOpt-5.4.0-cp311-cp311-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 48a7e9331858844db9b6239364ff57cc791339a1334d784a24ad98d7e0b0dae8
MD5 f55ffe4e9bd2dfac9cf283133da7bb67
BLAKE2b-256 8669424a8a6dc6a4b61034b4302616e64b73202d9f50b386f2d3fa996f01a599

See more details on using hashes here.

File details

Details for the file PySCIPOpt-5.4.0-cp310-cp310-win_amd64.whl.

File metadata

File hashes

Hashes for PySCIPOpt-5.4.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 858f82ac9feb75c676174ac3606ae43e1ef45f382e40dac86c0ab343076d57f9
MD5 f1ed935813720b121349b19d0ba1ac99
BLAKE2b-256 ec023033432b9b7a39110ec50023a1a3db09e86e25bf7b1e01f24dac9a5da5f3

See more details on using hashes here.

File details

Details for the file PySCIPOpt-5.4.0-cp310-cp310-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for PySCIPOpt-5.4.0-cp310-cp310-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 5b66ee51158c2959cfd8ec72c7848bd5f8a7d9faaf1cf9129746d96bf0764484
MD5 beaec39e5ea7d0b4d8ede34b093886d3
BLAKE2b-256 3ad2b83c6cb28d8a106039f6bf5ab0f4dd6e399cbe4d0363429f2810ca1be8ac

See more details on using hashes here.

File details

Details for the file PySCIPOpt-5.4.0-cp310-cp310-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for PySCIPOpt-5.4.0-cp310-cp310-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 19edf9c74cbfb96e0412995aede6d8bce9f20e3fd41a5a255615630c6fc1d13a
MD5 8775dc8c96dc6dee5f6f290fd43347ef
BLAKE2b-256 7dd55973ceaf0dd1135cb844d8e26913221d9079ae4f57e372cab19286f4622b

See more details on using hashes here.

File details

Details for the file PySCIPOpt-5.4.0-cp310-cp310-macosx_13_0_x86_64.whl.

File metadata

File hashes

Hashes for PySCIPOpt-5.4.0-cp310-cp310-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 81457352fcfd887b2c7019853f0a44474525b5a9d91979784b3c9ceb8a57dfee
MD5 25328e8e2151d0131cbe397041c75efa
BLAKE2b-256 06d38f2414fa52eb0b836aa8d0d66cfdb71bd7a52ffbfded4a8bb4bf534d49e2

See more details on using hashes here.

File details

Details for the file PySCIPOpt-5.4.0-cp39-cp39-win_amd64.whl.

File metadata

  • Download URL: PySCIPOpt-5.4.0-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 57.0 MB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for PySCIPOpt-5.4.0-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 0c5381b1ee7cb2e07c4347439ea214aa48418731782438c70b76923e67bc4992
MD5 7da210000d200af417aa07abc1bbdce9
BLAKE2b-256 d2e6d9399a8653bf515e056dfda731acdebe919915d2177180d53eb9787d7273

See more details on using hashes here.

File details

Details for the file PySCIPOpt-5.4.0-cp39-cp39-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for PySCIPOpt-5.4.0-cp39-cp39-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 e1c0ddd6a7463de085f59dc2a656412673344e864082f490343916a8d0d3ec99
MD5 c86484fcd93497881a206a3750b10c73
BLAKE2b-256 286427f231cabf708b58941a5cf8bb76af10fdb4ca32ef28e46f14d02757a04f

See more details on using hashes here.

File details

Details for the file PySCIPOpt-5.4.0-cp39-cp39-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for PySCIPOpt-5.4.0-cp39-cp39-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 5cf96f37b0d83a99385de7c955fea8ad36fb32ebe7cb89cdade97650b3a5e412
MD5 dcb5ebb55a7f404d81a0f25fcce334a9
BLAKE2b-256 3de1ee4e3cfe8c4686938c241fefa9ed6f7a061b4a2835087f3e11a59d33bca9

See more details on using hashes here.

File details

Details for the file PySCIPOpt-5.4.0-cp39-cp39-macosx_13_0_x86_64.whl.

File metadata

File hashes

Hashes for PySCIPOpt-5.4.0-cp39-cp39-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 dbdf4570a5337c3257a44c1b99fad191dfcb505c486f46d220e4f14f2a3efc9c
MD5 268021701ab278dff9be7ad51e156168
BLAKE2b-256 0bb3b9034f53aaf15a48cffbee2783c68d7888cb8f78df206e3daaea58c41055

See more details on using hashes here.

File details

Details for the file PySCIPOpt-5.4.0-cp38-cp38-win_amd64.whl.

File metadata

  • Download URL: PySCIPOpt-5.4.0-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 57.0 MB
  • Tags: CPython 3.8, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for PySCIPOpt-5.4.0-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 3ae102f98928275a8a12420447d6ac554769a20b03bec8bb989b7bce083717aa
MD5 e67d104508aed7972ed1661fdf26631a
BLAKE2b-256 7c975ab013ec88dbf25fde0c7d4f8970d86babeac9f84f0dbc4b17a6cb7849e4

See more details on using hashes here.

File details

Details for the file PySCIPOpt-5.4.0-cp38-cp38-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for PySCIPOpt-5.4.0-cp38-cp38-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 fb1bf02e1c594f00fcadb41e67205ca3bca57d5aaf8eb734b2d4c9f33bbee300
MD5 67f2a80bb5f2845b7691d3eb5d01bf9a
BLAKE2b-256 e434fa771be714da1213a9b7a776d8f1008243e94757c14cbcfc5f3b541519da

See more details on using hashes here.

File details

Details for the file PySCIPOpt-5.4.0-cp38-cp38-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for PySCIPOpt-5.4.0-cp38-cp38-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 6f1bcddeebe491e926793046a11f0c3397650b6a58e7fa503cfd64bc7408473c
MD5 b8b317baa534291553292ed490affcff
BLAKE2b-256 d6fea0eb5103f0096ebe23602603d66a70c25ffc90bc7986ac44c211ad92f5c0

See more details on using hashes here.

File details

Details for the file PySCIPOpt-5.4.0-cp38-cp38-macosx_13_0_x86_64.whl.

File metadata

File hashes

Hashes for PySCIPOpt-5.4.0-cp38-cp38-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 19a6bbc8de1f0d91777978d25ab1fb9f22778a6d388b287b6036079cb92081d5
MD5 24eb50832c901f25358d71ff419cb3ef
BLAKE2b-256 ad5e22bc0938d6a9be5cbb9ba54969155639932867df5cf137058f6a43fedcc8

See more details on using hashes here.

Supported by

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