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.22.tar.gz (118.0 kB view details)

Uploaded Source

Built Distribution

cpmpy-0.9.22-py3-none-any.whl (149.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: cpmpy-0.9.22.tar.gz
  • Upload date:
  • Size: 118.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.22.tar.gz
Algorithm Hash digest
SHA256 a4efd78b6781fd98e8181e9a6d67f8933a821ae95e9703d9e11028751572ce9c
MD5 8cf62f44e923113495d2d7eb82ed1dbf
BLAKE2b-256 f64d5b7773524f47a9b4ed71154792d4b78e97d9f3fa5bf286b2a8ce1adba785

See more details on using hashes here.

File details

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

File metadata

  • Download URL: cpmpy-0.9.22-py3-none-any.whl
  • Upload date:
  • Size: 149.4 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.22-py3-none-any.whl
Algorithm Hash digest
SHA256 bc5a91af91943892dbc498b1dfaa174ddcb24f89618c31624863ee67afd6cce1
MD5 eea25f57ab1fe537dacc0fc9c122169d
BLAKE2b-256 c11951ee4467773cca5f0387e422076663de1a562072ec6a7f59b4c28a408f72

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