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

Uploaded Source

Built Distributions

pyscipopt-5.4.1-cp313-cp313-win_amd64.whl (56.9 MB view details)

Uploaded CPython 3.13 Windows x86-64

pyscipopt-5.4.1-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.1-cp313-cp313-macosx_14_0_arm64.whl (7.2 MB view details)

Uploaded CPython 3.13 macOS 14.0+ ARM64

pyscipopt-5.4.1-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.1-cp312-cp312-win_amd64.whl (56.9 MB view details)

Uploaded CPython 3.12 Windows x86-64

pyscipopt-5.4.1-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.1-cp312-cp312-macosx_14_0_arm64.whl (7.2 MB view details)

Uploaded CPython 3.12 macOS 14.0+ ARM64

pyscipopt-5.4.1-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.1-cp311-cp311-win_amd64.whl (57.0 MB view details)

Uploaded CPython 3.11 Windows x86-64

pyscipopt-5.4.1-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.1-cp311-cp311-macosx_14_0_arm64.whl (7.3 MB view details)

Uploaded CPython 3.11 macOS 14.0+ ARM64

pyscipopt-5.4.1-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.1-cp310-cp310-win_amd64.whl (57.0 MB view details)

Uploaded CPython 3.10 Windows x86-64

pyscipopt-5.4.1-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.1-cp310-cp310-macosx_14_0_arm64.whl (7.2 MB view details)

Uploaded CPython 3.10 macOS 14.0+ ARM64

pyscipopt-5.4.1-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.1-cp39-cp39-win_amd64.whl (57.0 MB view details)

Uploaded CPython 3.9 Windows x86-64

pyscipopt-5.4.1-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.1-cp39-cp39-macosx_14_0_arm64.whl (7.2 MB view details)

Uploaded CPython 3.9 macOS 14.0+ ARM64

pyscipopt-5.4.1-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.1-cp38-cp38-win_amd64.whl (57.0 MB view details)

Uploaded CPython 3.8 Windows x86-64

PySCIPOpt-5.4.1-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.1-cp38-cp38-macosx_14_0_arm64.whl (7.2 MB view details)

Uploaded CPython 3.8 macOS 14.0+ ARM64

PySCIPOpt-5.4.1-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.1.tar.gz.

File metadata

  • Download URL: pyscipopt-5.4.1.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.1.tar.gz
Algorithm Hash digest
SHA256 fdd2a6ca1c1f6c6e2dc28dea659e2e9368644839b2f656b2263839de71d16d5b
MD5 d37ef18be6f76087dcfed97d4852863b
BLAKE2b-256 3b3971689ae641f23763acd56243a8e8a995db467d1e5a53e9f3583e27e0837d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyscipopt-5.4.1-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 bd351c90186f6637cecaa92166c9bd8ef57d4c94875ca7157ca45944dfa5524d
MD5 0498e6a9cd1d7e211990243c01e0039a
BLAKE2b-256 fd00d796f1ef7b4c493628fc8fffdac981bd5d385d9cfdb2dff172c0b58b4342

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyscipopt-5.4.1-cp313-cp313-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 66c0c8625837255f55cc4fe2509f69baf58d5881ce91c19c97c38984641b58e7
MD5 da1bd66913136f58789edc4b0e2a0ca6
BLAKE2b-256 70460686cffa472277a990b3fa0428ccb4c596f587836c0627fb1d2228809a00

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyscipopt-5.4.1-cp313-cp313-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 c0318f841394b75037684ee8c798ddfee666b3dd648ec95ac9da04b24308ef98
MD5 51ead1df5b02a755ca639b632ff0a678
BLAKE2b-256 28f801529888a563c93990486374b3f004ae529494965b3463b66bce4688dc7d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyscipopt-5.4.1-cp313-cp313-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 8d33d3d56d4d31b96b986a704016c453914f6def7ced6614be86cd9de2f92e7b
MD5 c2eb65b6aab0859dfe789c0c836cd8df
BLAKE2b-256 97e96802079019a764cdcd87e0759ed549e6d95ef58d2946f13e24e3580027af

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyscipopt-5.4.1-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 6e6f19a49d7d36669305a2b190243002c49f28aac9b4a566f160e39f49d84c0e
MD5 f74871e6f9a07b5867d99356c93987a0
BLAKE2b-256 cabd9bd216ee0acd12d92fc61b7fafe2e1a223bcad1c87fe09405eb4b98921d1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyscipopt-5.4.1-cp312-cp312-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 ec3fc4863a5bf5f69302608caae7b2978088705170f5b5b4610969c1113f8f7a
MD5 cecfef57438b2cd16010e0848f245f9e
BLAKE2b-256 00b02193f1b828e89437299a24a7c46c4744130728397ea09f8fa66683d28bff

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyscipopt-5.4.1-cp312-cp312-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 a88d97996e1fe455c6e59273fb9617703f2d0f4728a338e7beec33ba1ee040f5
MD5 f74e7312e02d859dd8e9f583429fcc73
BLAKE2b-256 3113f1ca9cf18d82efb7ad6dbb2ab88762deebe5e53df85b8565d6bff0553293

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyscipopt-5.4.1-cp312-cp312-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 03ee8548b8e5266c04c7f4b0de6669ace9770784a02440c337efc04d2619fd29
MD5 5186b9fe848ac33ce9fc40ff123c9b54
BLAKE2b-256 864d7cb443852d4ecab437542bbc0e37daa6c385c583204bded51f5e3bcb276c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyscipopt-5.4.1-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 04fdfe46538bab3252c1744d452c86158416aaab9d0b814baee4085fb3930af5
MD5 0f638cb07e8426808d1ffbdf52ff73c9
BLAKE2b-256 36d7bbf4d42971b9aedec177f037267c4bfa4af86fc587172163233ee784254e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyscipopt-5.4.1-cp311-cp311-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 e3a97cb35e4841c741f96050260951d2992c84528afb4caa533dbef2fd68041c
MD5 7d3e2f9d3e7b398de3a8def424cc41ba
BLAKE2b-256 420fec4b56d0a78aaab15eda5ed1863ea6f7bcbd1376dd1ae6313221538975b5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyscipopt-5.4.1-cp311-cp311-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 b9901fc657b232bf2ceea1b3a2a2a2a749eadff823d2d7bfd468f50cfc9e95f7
MD5 c4b59549fdbf1dc64e31c320d69fe231
BLAKE2b-256 043058622ae58940b8328c5ee21b843b7f51d489ea16bf4b4214c1313b361a52

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyscipopt-5.4.1-cp311-cp311-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 5f6a99f7f51e2843f17938571b18c1ac83c943aab93d0898c6a8e7d6e6d18ce9
MD5 673488a34575b4f466dad144d40d9d9c
BLAKE2b-256 c400a680ab4037898dc5cbe679b4f9d7386bc759554721d30e1f5d703067308d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyscipopt-5.4.1-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 5d4b32984b959dfa86f5b416bf75c6c4d80ce69ecc3f10c8d49ec1662d9bc62f
MD5 d009ed733b18e08cf1e69263550ec558
BLAKE2b-256 d494343eaa3dc46dfdf06b727da33f7a0c8dc75ac3c126f6e8a94be8003fb64e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyscipopt-5.4.1-cp310-cp310-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 2cdc0e432d4f40cb64961158529fecdfe4e244a8afe892cd2098ae30e9b9c300
MD5 919e0d99d805647c435a5e48675a5fe0
BLAKE2b-256 2f3ca0f733a5c9c02814fd74e45dd0905802763f4fcf2ce1cfdac8219af51536

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyscipopt-5.4.1-cp310-cp310-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 2db6bf296158135a86b0311e35bfc8ae6ab10090d58a9d4b241d0515e679f1d3
MD5 7d833c704f63c9fc6e61dae7c09a529d
BLAKE2b-256 9d4785a08286803f646eec2a2dab4290f9a56feb6e6cc9d3ba921ba278ef6d1a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyscipopt-5.4.1-cp310-cp310-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 88b3f7a6d4a30986b921ed8f013fe0786d6c0f8023ba45f172eff657de465a02
MD5 f3e4d1525e4ce1b2fd16a6ee1b52329c
BLAKE2b-256 c1a102496d0355bb04c2e36dd54b762bc4626d32da3a48a36d54a4d5827897a0

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyscipopt-5.4.1-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.1-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 360a9786e0dffc7b904e07c13c74dab98901a4bf62375f2bb77782e7a0ef8384
MD5 93ebfab4c8598c249bf916cf583c894f
BLAKE2b-256 e89c6380259b99604bb20313b6b96b4afd4d12958c21e6ebb6a20fbd7cb81e40

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyscipopt-5.4.1-cp39-cp39-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 96c8361f2715d39392e7af06a3c82a5fb9fab8dd32608e6a4348ec606a1de76d
MD5 475f3eebd8fbb2d7223627475955374f
BLAKE2b-256 6685aef7e044f886485f42cc1de358fe45dafa276af40738bf7d9e6d6e16564a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyscipopt-5.4.1-cp39-cp39-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 1601641ccbc170fe10507622a61e459903794d712883a005764fac5642e4ee76
MD5 b47de3b14af6df978215a910a43a0659
BLAKE2b-256 17cf71b291d47fb975e991c86d7574a8b2dbf7f8be8dfd35c075a1f94f10af88

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyscipopt-5.4.1-cp39-cp39-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 8d183d117fe934129d67d99bd725cdb8ce7de75b885b94df319cc5b640183cbb
MD5 130497bc2149d3cd418866788eeb9382
BLAKE2b-256 3300e5a19d509bd4fac59b0ebde5722711db15439e1021404b957aa9bba7af15

See more details on using hashes here.

File details

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

File metadata

  • Download URL: PySCIPOpt-5.4.1-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.1-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 3207a061ce08d069d23ff9629f0100e6a9e20dc98ad8b403dafd231a0070fd7e
MD5 3684a0bebb4c791e359b7d6a63f54061
BLAKE2b-256 8ecd01724b962769e23a458d871c27fa5b7dd7f9ddac0786e1cf5aa128923483

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for PySCIPOpt-5.4.1-cp38-cp38-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 89c0d6469d5d1fb7be30dc41abc6be902330c0dee60ff496ac3a900942001ba2
MD5 9622e8c3645c6e7aaaa9bfe656c02940
BLAKE2b-256 b0768edfe7b3b72bc5a29f325f5d1bdd04c528bc189cf9f29f8dd1a1e8f8718f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for PySCIPOpt-5.4.1-cp38-cp38-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 bc3920c908244ab1cd4de5976b7fdb58cc7877bc2c0a10b71049de9a0fd139d6
MD5 e227daae6e64c8a2bd24858974b296e3
BLAKE2b-256 5c2478dc3eb72e7f19ac2ff7342b8c6ced7464125ac1d8d96a4b47a01ae48a68

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for PySCIPOpt-5.4.1-cp38-cp38-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 08c0b3c7505aa8a678409ba6d33b8fa66a056373c130005e17e17211591151c5
MD5 7477b7f330e81944e8d87a58c59d7cae
BLAKE2b-256 082d45b677f6c1e2c00256a0d577090b0c8478ab4e23bd8a0b0055e836c5f0cb

See more details on using hashes here.

Supported by

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