PyCSP3: Modeling Combinatorial Constrained Problems in Python

Christophe Lecoutre, Nicolas Szczepanski
9/1/2020
29 citations
cs.AI

Official code: xcsp3team/pycsp3 (89 stars, Python, MIT, last commit 2026-11-10). 1 more implementation below.

Abstract

In this document, we introduce PyCSP$3$, a Python library that allows us to write models of combinatorial constrained problems in a declarative manner. Currently, with PyCSP$3$, you can write models of constraint satisfaction and optimization problems.

Show full abstract

More specifically, you can build CSP (Constraint Satisfaction Problem) and COP (Constraint Optimization Problem) models. Importantly, there is a complete separation between the modeling and solving phases: you write a model, you compile it (while providing some data) in order to generate an XCSP$3$ instance (file), and you solve that problem instance by means of a constraint solver. You can also directly pilot the solving procedure in PyCSP$3$, possibly conducting an incremental solving strategy. In this document, you will find all that you need to know about PyCSP$3$, with more than 50 illustrative models.

View on arXivView PDF

Code Implementations(2)

Code implementations of this paper
RepositoryTypeStarsLanguageLicenseLast commit
xcsp3team/pycsp3Official89PythonMIT2026-11-10
xcsp3team/XCSP3-Java-ToolsOfficial27JavaMIT2026-09-10
xcsp3team/pycsp3Official100%
MIT

A Python Library for modeling combinatorial constrained problems

8912Python, Jupyter NotebookDec 14, 20193 weeks agoMIT
combinatorial-optimizationconstrained-optimizationconstraint-based-modelingconstraint-programmingconstraint-satisfaction-problem+12 more
MIT

XCSP3 Tools in Java

275JavaMay 30, 20162 months agoMIT
constraint-programmingconstraintsjavaparserparsing-library+2 more

Similar Papers

Cite this paper

@article{lecoutre2020pycsp,
  title  = {PyCSP3: Modeling Combinatorial Constrained Problems in Python},
  author = {Christophe Lecoutre and Nicolas Szczepanski},
  year   = {2020},
  eprint = {2009.00326},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2009.00326}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2009.00326.svg)](https://codeofpaper.com/paper/2009.00326)

Discussion