CPMpy: Constraint Programming and Modeling in Python ==================================================== Source code and issue tracker: https://github.com/CPMpy/cpmpy CPMpy is ideal for solving combinatorial problems like assignment problems or covering, packing and scheduling problems. Problems that require searching over discrete decision variables. .. toctree:: :maxdepth: 1 :caption: Getting started: modeling summary .. _supported-solvers: Supported solvers ----------------- .. list-table:: :header-rows: 1 * - **Solver** - **Technology** - **Capabilities** - **Installation** - **Notes** * - :doc:`OR-Tools ` - CP (LCG) - SAT ASAT ALLSAT - OPT - PAR - pip - The default solver * - :doc:`Pumpkin ` - CP (LCG) - SAT ASAT ALLSAT - OPT - PROOF - local install (maturin) - * - :doc:`GCS ` - CP - SAT ISAT ALLSAT - OPT - PROOF - pip - * - :doc:`Choco ` - CP - SAT ISAT ALLSAT - OPT - pip - * - :doc:`CP Optimizer ` - CP - SAT - OPT - PAR - pip + local + (aca.) license - * - :doc:`MiniZinc ` - CP - SAT - OPT - pip + local install - Communicates through textfiles * - :doc:`Z3 ` - SMT - SAT ASAT ISAT - OPT - pip - * - :doc:`Hexaly ` - Global Opt. - SAT ISAT ALLSAT - OPT IOPT - pip + local + (aca.) licence - * - :doc:`Gurobi ` - ILP - SAT ISAT - OPT IOPT - PAR - pip + (aca.) license - * - :doc:`CPLEX ` - ILP - SAT - OPT IOPT - PAR - pip + local + (aca.) license - No * - :doc:`Exact ` - Pseudo-Boolean - SAT ASAT ISAT ALLSAT - OPT IOPT - PROOF - pip >3.10 (Linux, Win) - Manual installation on Mac possible * - :doc:`RC2 ` - MaxSAT - OPT - pip - * - :doc:`Pindakaas ` - SAT - SAT ASAT ISAT - pip - Automatically encodes PB to SAT * - :doc:`PySAT ` - SAT - SAT ASAT ISAT - pip - * - :doc:`PySDD ` - Decis. Diagram - SAT ISAT ALLSAT - KC - pip - only Boolean variables (CPMpy transformation incomplete) Native capability abbreviations: * SAT: Satisfaction, ASAT: Satisfaction under Assumptions+core extraction, ISAT: Incremental Satisfaction, ALLSAT: All solution enumeration * OPT: Optimisation, IOPT: Incremental optimisation * PAR: Parallel solving, PROOF: Proof logging, KC: Knowledge Compilation Different solvers excel at different problems. `Try multiple! `_ **CPMpy’s transformations** selectively rewrite only those constraint expressions that a solver does not support. While solvers can use any transformation they need, lower-level solvers largely reuse those of higher-level ones, creating a waterfall pattern: .. image:: waterfall.png :width: 480 :alt: Waterfall from model to solvers .. toctree:: :maxdepth: 1 :caption: Advanced guides: how_to_debug multiple_solutions unsat_core_extraction developers adding_solver testing Open Source ----------- CPMpy is open source (`Apache 2.0 license `_) and the development process is open too: 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! .. toctree:: :maxdepth: 1 :caption: API documentation: api/model api/expressions api/transformations api/solvers api/tools