# PyCSP3: Modeling Combinatorial Constrained Problems in Python

arXiv: https://arxiv.org/abs/2009.00326 · HTML: https://mlsanity.com/paper/2009.00326/

## Key facts

- Cited by 9 papers in the map (data through 14 Oct 2026).
- First posted on arXiv 1 Sep 2020.

## Built on by (most cited first, 9 of 9)

- [ConstraintLLM: A Neuro-Symbolic Framework for Industrial-Level Constraint Programming](https://mlsanity.com/paper/2510.05774/) (2025)
- [DCP-Bench-Open: Evaluating LLMs for Constraint Modelling of Discrete Combinatorial Problems](https://mlsanity.com/paper/2506.06052/) (2025)
- [ACE, a generic constraint solver](https://mlsanity.com/paper/2302.05405/) (2023)
- [Proceedings of the 2022 XCSP3 Competition](https://mlsanity.com/paper/2209.00917/) (2022)
- [Formalize, Don't Optimize: The Heuristic Trap in LLM-Generated Combinatorial Solvers](https://mlsanity.com/paper/2605.12421/) (2026)
- [Proceedings of the 2023 XCSP3 Competition](https://mlsanity.com/paper/2312.05877/) (2023)
- [Solving the Kidney-Exchange Problem via Graph Neural Networks with No Supervision](https://mlsanity.com/paper/2304.09975/) (2023)
- [MathConstraint: Automated Generation of Verified Combinatorial Reasoning Instances for LLMs](https://mlsanity.com/paper/2605.08498/) (2026)
- [PyCSP3-Scheduling: A Scheduling Extension for PyCSP3](https://mlsanity.com/paper/2605.14559/) (2026)

## Abstract (arXiv)

In this document, we introduce PyCSP3, a Python library that allows us to write models of combinatorial constrained problems in a declarative manner. Currently, with PyCSP3, you can write models of constraint satisfaction and optimization problems. 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 XCSP3 instance (file), and you solve that problem instance by means of a constraint solver. You can also directly pilot the solving procedure in PyCSP3, possibly conducting an incremental solving strategy. In this document, you will find all that you need to know about PyCSP3, with more than 50 illustrative models.
