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.5.0.tar.gz (1.4 MB view details)

Uploaded Source

Built Distributions

pyscipopt-5.5.0-cp313-cp313-win_amd64.whl (56.8 MB view details)

Uploaded CPython 3.13Windows x86-64

pyscipopt-5.5.0-cp313-cp313-manylinux_2_28_x86_64.whl (15.4 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.28+ x86-64

pyscipopt-5.5.0-cp313-cp313-macosx_14_0_arm64.whl (7.1 MB view details)

Uploaded CPython 3.13macOS 14.0+ ARM64

pyscipopt-5.5.0-cp313-cp313-macosx_13_0_x86_64.whl (10.3 MB view details)

Uploaded CPython 3.13macOS 13.0+ x86-64

pyscipopt-5.5.0-cp312-cp312-win_amd64.whl (56.8 MB view details)

Uploaded CPython 3.12Windows x86-64

pyscipopt-5.5.0-cp312-cp312-manylinux_2_28_x86_64.whl (15.4 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.28+ x86-64

pyscipopt-5.5.0-cp312-cp312-macosx_14_0_arm64.whl (7.1 MB view details)

Uploaded CPython 3.12macOS 14.0+ ARM64

pyscipopt-5.5.0-cp312-cp312-macosx_13_0_x86_64.whl (10.3 MB view details)

Uploaded CPython 3.12macOS 13.0+ x86-64

pyscipopt-5.5.0-cp311-cp311-win_amd64.whl (56.9 MB view details)

Uploaded CPython 3.11Windows x86-64

pyscipopt-5.5.0-cp311-cp311-manylinux_2_28_x86_64.whl (16.0 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.28+ x86-64

pyscipopt-5.5.0-cp311-cp311-macosx_14_0_arm64.whl (7.1 MB view details)

Uploaded CPython 3.11macOS 14.0+ ARM64

pyscipopt-5.5.0-cp311-cp311-macosx_13_0_x86_64.whl (10.4 MB view details)

Uploaded CPython 3.11macOS 13.0+ x86-64

pyscipopt-5.5.0-cp310-cp310-win_amd64.whl (56.9 MB view details)

Uploaded CPython 3.10Windows x86-64

pyscipopt-5.5.0-cp310-cp310-manylinux_2_28_x86_64.whl (15.5 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.28+ x86-64

pyscipopt-5.5.0-cp310-cp310-macosx_14_0_arm64.whl (7.1 MB view details)

Uploaded CPython 3.10macOS 14.0+ ARM64

pyscipopt-5.5.0-cp310-cp310-macosx_13_0_x86_64.whl (10.4 MB view details)

Uploaded CPython 3.10macOS 13.0+ x86-64

pyscipopt-5.5.0-cp39-cp39-win_amd64.whl (56.9 MB view details)

Uploaded CPython 3.9Windows x86-64

pyscipopt-5.5.0-cp39-cp39-manylinux_2_28_x86_64.whl (15.4 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.28+ x86-64

pyscipopt-5.5.0-cp39-cp39-macosx_14_0_arm64.whl (7.1 MB view details)

Uploaded CPython 3.9macOS 14.0+ ARM64

pyscipopt-5.5.0-cp39-cp39-macosx_13_0_x86_64.whl (10.4 MB view details)

Uploaded CPython 3.9macOS 13.0+ x86-64

pyscipopt-5.5.0-cp38-cp38-win_amd64.whl (56.9 MB view details)

Uploaded CPython 3.8Windows x86-64

pyscipopt-5.5.0-cp38-cp38-manylinux_2_28_x86_64.whl (15.6 MB view details)

Uploaded CPython 3.8manylinux: glibc 2.28+ x86-64

pyscipopt-5.5.0-cp38-cp38-macosx_14_0_arm64.whl (7.1 MB view details)

Uploaded CPython 3.8macOS 14.0+ ARM64

pyscipopt-5.5.0-cp38-cp38-macosx_13_0_x86_64.whl (10.4 MB view details)

Uploaded CPython 3.8macOS 13.0+ x86-64

File details

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

File metadata

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

File hashes

Hashes for pyscipopt-5.5.0.tar.gz
Algorithm Hash digest
SHA256 306facfa0ccef06b7323ad01f4d829683abf5287bbc972b960545ac0c5cb76ea
MD5 f0f5272909995f193b5dfd9da1a4e525
BLAKE2b-256 b711a2d7d41a1373ecd8be7a33c6db659f6af27cd0fd8cc2f7b5a5b295550ef9

See more details on using hashes here.

File details

Details for the file pyscipopt-5.5.0-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: pyscipopt-5.5.0-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 56.8 MB
  • Tags: CPython 3.13, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for pyscipopt-5.5.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 5a13a3802fec1363d038b274f41380b4af2ce8e779576fd174889bdf617148a1
MD5 c69dd519a7fed25eaa968f9a1f0bb0f3
BLAKE2b-256 449d98928670729876cbcf6d34581a0706769d7ee9df4bb3ca6c51bc4e5becc4

See more details on using hashes here.

File details

Details for the file pyscipopt-5.5.0-cp313-cp313-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pyscipopt-5.5.0-cp313-cp313-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 b5855312736f489a12db969dbc719676ae0047a4879fe2df9d0a90842813a08c
MD5 52a991dfb9131e6695df40ab2bc56589
BLAKE2b-256 1419b51b2b9747170b21a40417e39e2357377a1c417815561353f2c5741ba0e9

See more details on using hashes here.

File details

Details for the file pyscipopt-5.5.0-cp313-cp313-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for pyscipopt-5.5.0-cp313-cp313-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 282acd996b03dfe40e7aca68373a5ca5c43f698abad636176f4861d1240cb0c4
MD5 6ee545bd1cc5a07bf915539c01c23761
BLAKE2b-256 3b37bca13d271c797f5cd23845c94cd467b56bec086d9b5e71a0a9d3bbe31e27

See more details on using hashes here.

File details

Details for the file pyscipopt-5.5.0-cp313-cp313-macosx_13_0_x86_64.whl.

File metadata

File hashes

Hashes for pyscipopt-5.5.0-cp313-cp313-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 64b07c1c245ea84e83b50ba40ce37a288ebb925d809ddc03cd5bba17c5473474
MD5 9d57d5f81b389c71e80e50de3abf0331
BLAKE2b-256 4f3a8c7e9ce9813da64fa727d87ac3f7531297a0008ef31a1b1348f7700955ac

See more details on using hashes here.

File details

Details for the file pyscipopt-5.5.0-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: pyscipopt-5.5.0-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 56.8 MB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for pyscipopt-5.5.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 cff2972f16a635d99d17952dd98866a8ce9bdeb0d650d0012f8405cf72d66be2
MD5 b13ed6fc3a4c4b1795dd4c11d3f84443
BLAKE2b-256 5742eb359cb88e65e421f7078446a4d56083d667659a2662b9ea2c2f55b5a902

See more details on using hashes here.

File details

Details for the file pyscipopt-5.5.0-cp312-cp312-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pyscipopt-5.5.0-cp312-cp312-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 57e8545aa67bd627a49c2985e3314bd4347e60d07904255e5ddb30345e303382
MD5 0564db28a014d3f6a5e0b22e6856fbee
BLAKE2b-256 30ac7e2389e65da4cc30ef42a00a894b5a6fb40efc69f1371c2f38a4ebdf4ff2

See more details on using hashes here.

File details

Details for the file pyscipopt-5.5.0-cp312-cp312-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for pyscipopt-5.5.0-cp312-cp312-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 686102921ce6626f54b366b4eeefd4b387d4a2de0ab46bdf6227e0cf60490995
MD5 0212065dbe703ca05474d903d989ef84
BLAKE2b-256 7be14a87fc9c6924a78eaaef2d539201ad9d3e1b9a874ac0ccfda33ef6ef4b59

See more details on using hashes here.

File details

Details for the file pyscipopt-5.5.0-cp312-cp312-macosx_13_0_x86_64.whl.

File metadata

File hashes

Hashes for pyscipopt-5.5.0-cp312-cp312-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 7f6c3aad6cb35ec4a6acc6ed4b9c40df2e4dfa93e4b359a42c66bcb5f2a250fb
MD5 2d4082f349a2b8c52ee4c4a074966169
BLAKE2b-256 1816d4fbc4cf16a0743cb74d2b8fb5d2b885a8cc3912b475fcad2647f0717e3e

See more details on using hashes here.

File details

Details for the file pyscipopt-5.5.0-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: pyscipopt-5.5.0-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 56.9 MB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for pyscipopt-5.5.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 f7bc0ee34ba8630f0576338eae9e3a76c450f2ba699331c04f18149ecb9b1426
MD5 251985690dc4df9ec26f858973027e30
BLAKE2b-256 c040296581e0095fa6788f14dc9e3b33b2743b71a9161345d76fc2bcfc3f81fb

See more details on using hashes here.

File details

Details for the file pyscipopt-5.5.0-cp311-cp311-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pyscipopt-5.5.0-cp311-cp311-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 cb36db61c1d395323c96cd9f14feb4570e4ca82438f7c49308db1f7a0ea88718
MD5 a8cfe098efa9ae22516c2f622ed23fed
BLAKE2b-256 ad28b304e4d20a80cedf6b8a70df07bc9e95186b3c989c6324f65dad673dd1ff

See more details on using hashes here.

File details

Details for the file pyscipopt-5.5.0-cp311-cp311-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for pyscipopt-5.5.0-cp311-cp311-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 699ac820c4b07a4e08094b379fea6934a5bc03714a091a430bcdf81cd9841fec
MD5 54e91e32c5fd8cc5b9571ca988c1d076
BLAKE2b-256 619700ce865ef40f4a8a8f71e1a49293ef12b456983a0fbb1b2b73fce0b83f2c

See more details on using hashes here.

File details

Details for the file pyscipopt-5.5.0-cp311-cp311-macosx_13_0_x86_64.whl.

File metadata

File hashes

Hashes for pyscipopt-5.5.0-cp311-cp311-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 738b5cc50fd57f91ba98f947273e781d88e0efec441e49d105d2fcc31e5b47a0
MD5 e3ee7ff6d1dc8e501669c4aa0ff6bf99
BLAKE2b-256 412b6a76917752f55fd8430d0890b21ac0fec3f2e83cd0a9fb1ae8345ff16863

See more details on using hashes here.

File details

Details for the file pyscipopt-5.5.0-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: pyscipopt-5.5.0-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 56.9 MB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for pyscipopt-5.5.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 012d8d90226653e29130156124d3d6a02800e6499cd926de532bbd827b2dcb91
MD5 4fba9b53143d2b975ea8aebde922e2a1
BLAKE2b-256 beaed98b33ed68ac1b22cca33d31884c365faeb8ce670a9284edac9fc627d7ed

See more details on using hashes here.

File details

Details for the file pyscipopt-5.5.0-cp310-cp310-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pyscipopt-5.5.0-cp310-cp310-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 f9f806e39fb7880323175a9a17acc2f2054211c4d141290c38d1456ff4ab3cb2
MD5 b48962b2fa7bc38b10c42aa985e47c81
BLAKE2b-256 f21f9719e88e7d062e0c030133a1adf635cbbb06cf862a75c65d858d0a0c22ae

See more details on using hashes here.

File details

Details for the file pyscipopt-5.5.0-cp310-cp310-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for pyscipopt-5.5.0-cp310-cp310-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 e1d54d45476da5f8f148dabb52e5a7bd4854468230acf9f13d6fb09992d64deb
MD5 6f6c078bf97f5cb536f56e0445f5005c
BLAKE2b-256 7aa40511ff88ec5626bfceacb52c98c207ff2cd0c76c208a39b8bd79f4fc400c

See more details on using hashes here.

File details

Details for the file pyscipopt-5.5.0-cp310-cp310-macosx_13_0_x86_64.whl.

File metadata

File hashes

Hashes for pyscipopt-5.5.0-cp310-cp310-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 056b5619e35e202b815cbd9a22d0c92af2b424e2a51999fe44b50cdb467cd584
MD5 2af0d03c9d0db41e490b1a47e040ea9c
BLAKE2b-256 7f0bc1c08fa1ee3c8f637e80cd004c97cd08ee3770b5c0d29b9d3038f7e3af7b

See more details on using hashes here.

File details

Details for the file pyscipopt-5.5.0-cp39-cp39-win_amd64.whl.

File metadata

  • Download URL: pyscipopt-5.5.0-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 56.9 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.5.0-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 5f973d79184950bab46a1072ff558d5b1d2cdb8fe4ad1d6c80f5d19f3c2a22bf
MD5 070c3e7a158ef8ec804f7e1ef477808f
BLAKE2b-256 f8c684b35013b4112f869d7440e168aaf92c2d5df86641b8f35684a854b50f2b

See more details on using hashes here.

File details

Details for the file pyscipopt-5.5.0-cp39-cp39-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pyscipopt-5.5.0-cp39-cp39-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 3d8b70de9ace278cf7379cf98cc7937f3ccd5381dd3d4b97eec09df416bb1994
MD5 c04f98c49ad58e8c3062fb17a55ca6e8
BLAKE2b-256 5adfe58381fb6372d02d5cd09d8007bea839facc242acaedb7af677a7d7ea2e5

See more details on using hashes here.

File details

Details for the file pyscipopt-5.5.0-cp39-cp39-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for pyscipopt-5.5.0-cp39-cp39-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 4b75490fe376fe7472231cceb8671bd3f99363d6d41fd62393b82106faf206cd
MD5 f501a806d58447a40cfa240aa9caf0b9
BLAKE2b-256 e96192af8303da37fadbe387a3d0285a3b2f7b1e55993a41d6515988bbd07d0f

See more details on using hashes here.

File details

Details for the file pyscipopt-5.5.0-cp39-cp39-macosx_13_0_x86_64.whl.

File metadata

File hashes

Hashes for pyscipopt-5.5.0-cp39-cp39-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 ab45952e5f5061c59e1b00ba1cbd5ca9804c449223b6a255a93bd1f2648ec7ea
MD5 17aaed98f8722f5fe67adf341efa9198
BLAKE2b-256 34383831b1bfd43140cf8537721e1849a8173c0c123a135c8bc2524bdb1906b6

See more details on using hashes here.

File details

Details for the file pyscipopt-5.5.0-cp38-cp38-win_amd64.whl.

File metadata

  • Download URL: pyscipopt-5.5.0-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 56.9 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.5.0-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 9c34d19c127ecb248aa5d89420d60cfe138b16ffd41d9817bac857d50efe36d0
MD5 c71e6ba57b588568e28648abbc98b885
BLAKE2b-256 eab5658c2cd37f57105c70edcf2173d2ee779f0aaf84a620055f73e77918eb3c

See more details on using hashes here.

File details

Details for the file pyscipopt-5.5.0-cp38-cp38-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pyscipopt-5.5.0-cp38-cp38-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 513fd065f54157e54859b09fca8672014ab28807030c09447f46647526f9e9e7
MD5 05cdb86b5e17f6c6568b8b7fe73f206d
BLAKE2b-256 1fb96ec291c3fc329df85b0ebf0267b835379b21a73c06d64549222d96a0d525

See more details on using hashes here.

File details

Details for the file pyscipopt-5.5.0-cp38-cp38-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for pyscipopt-5.5.0-cp38-cp38-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 e5b3863bca2b5397d6106dfa0ee40f48b8e2fa6f4e185d0ab89919268a8189ff
MD5 0261247ded3d80ea0f639b3b2cbe3669
BLAKE2b-256 e106425e178b59463b544ddbb1bf980bd9f7aaf5d14a8b065fd40984c8c95151

See more details on using hashes here.

File details

Details for the file pyscipopt-5.5.0-cp38-cp38-macosx_13_0_x86_64.whl.

File metadata

File hashes

Hashes for pyscipopt-5.5.0-cp38-cp38-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 abaf7219daba9e55037ce659be12f976c94ed577b71ce03c6a39d154703f2a0a
MD5 0776c7ee68706ca8a1c0f6c3895cad2c
BLAKE2b-256 127becd42470694f3d055b71f6f4ad66580913fc3d4aea6974897d05d5677d43

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