Skip to main content

A numpy-based library for modeling constraint programming problems

Project description

Github Version PyPI version PyPI downloads Tests Licence

CPMpy is a Constraint Programming and Modeling library in Python, based on numpy, with direct solver access.

  • Easy to integrate with machine learning and visualisation libraries, because decision variables are numpy arrays.
  • Solver-independent: transparently translating to CP, MIP, SMT, SAT
  • Incremental solving and direct access to the underlying solvers
  • and much more...

Documentation: https://cpmpy.readthedocs.io/

CPMpy is still in Beta stage, and bugs can occur. If so, please report the issue on Github!

Open Source

CPMpy has the open-source Apache 2.0 license and is run as an open-source project. All discussions happen on Github, even between direct colleagues, and all changes are reviewed through pull requests.

Join us! We welcome any feedback and contributions. You are also free to reuse any parts in your own project. A good starting point to contribute is to add your models to the examples folder.

Are you a solver developer? We are keen to integrate solvers that have a python API on pip. If this is the case for you, or if you want to discuss what it best looks like, do contact us!

Teaching with CPMpy

CPMpy can be a good library for courses and projects on modeling constrained optimisation problems, because its usage is similar to that of other data science libraries, and because it translates to the fundamental languages of SAT, SMT, MIP, and CP transparently.

Contact Prof. Tias Guns if you are interested in, or are going to develop, teaching material using CPMpy. For example we have CPMpy snippets of part of Pierre Flener's excellent "Modelling for Combinatorial Optimisation [M4CO]".

Acknowledgments

Part of the development received funding through Prof. Tias Guns his European Research Council (ERC) Consolidator grant, under the European Union’s Horizon 2020 research and innovation programme (grant agreement No 101002802, CHAT-Opt).

You can cite CPMpy as follows: "Guns, T. (2019). Increasing modeling language convenience with a universal n-dimensional array, CPpy as python-embedded example. The 18th workshop on Constraint Modelling and Reformulation at CP (ModRef 2019).

@inproceedings{guns2019increasing,
    title={Increasing modeling language convenience with a universal n-dimensional array, CPpy as python-embedded example},
    author={Guns, Tias},
    booktitle={Proceedings of the 18th workshop on Constraint Modelling and Reformulation at CP (Modref 2019)},
    volume={19},
    year={2019}
}

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

cpmpy-0.9.23.tar.gz (120.0 kB view details)

Uploaded Source

Built Distribution

cpmpy-0.9.23-py3-none-any.whl (152.0 kB view details)

Uploaded Python 3

File details

Details for the file cpmpy-0.9.23.tar.gz.

File metadata

  • Download URL: cpmpy-0.9.23.tar.gz
  • Upload date:
  • Size: 120.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.20

File hashes

Hashes for cpmpy-0.9.23.tar.gz
Algorithm Hash digest
SHA256 14c51b6a5c717596b033b68599e03b1d073bf7e8708e716317848552f74e9e22
MD5 4175e80030cb2c7350038e70a880a0a2
BLAKE2b-256 70f96a115663a99e312e44c9502c5ca283fe0543a8cafd3d95bbd2f9c3783d46

See more details on using hashes here.

File details

Details for the file cpmpy-0.9.23-py3-none-any.whl.

File metadata

  • Download URL: cpmpy-0.9.23-py3-none-any.whl
  • Upload date:
  • Size: 152.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.20

File hashes

Hashes for cpmpy-0.9.23-py3-none-any.whl
Algorithm Hash digest
SHA256 44cb5f8cf43fc8606a00a0d7c545d9a33eb1b46edc90fe047405b3a248f04cd2
MD5 bc1db4d16d77fffd12cce60dec34f763
BLAKE2b-256 e57df238d09cb84b6bcc81d01b0ba9a7c98bcac40a39d5c6d4e48415f0c89d44

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 Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page