cs.AIOct 9, 2026

Learning Size Independent Constraint Models from Input Data and Positive and Negative Example Solutions

Authors: Helmut Simonis

Organizations: School of Computer Science and Information Technology, University College Cork, Ireland

Abstract

In this paper we describe a Constraint Acquisition Tool that generates size independent constraint programs from input data and positive and negative example solutions of multiple problem instances. The system finds size specific models based on typical constraint patterns over global and binary constraints, then generalizes the models to a size independent model that can be run on unseen input data. The system produces MiniZinc code as well as a textual description of the model. We evaluate the tool on the example problems of the PTHG21 Challenge and show the feasibility of the approach.

Figures & tables

Explore similar work

May 25, 2026

MPMMine: Better Benchmarks for Constraint Acquisition

Constraint Acquisition (CA) and related research on the validation and enhancement of Mathematical Programming (MP) models using domain knowledge artifacts are currently limited by inadequate benchmarks. The existing benchmarks are loosely organized, provide inconsistent types and formats of artifacts for individual problems, are designed for benchmarking solvers rather than CA algorithms, include narrow classes of problems, or omit crucial details for the reproducibility of experiments and fair comparison of CA methods. We develop a benchmark dataset, a supporting software package, and a benchmarking tool crafted for the consistent, systematic, and comprehensive assessment of CA algorithms, bridging the gap in algorithmic development and experimental infrastructure. This work presents MPMMine, a benchmark suite designed to assess algorithms that discover, validate, and enhance MP models using diverse artifacts. The development of MPMMine is guided by design rules supporting consistency, standardization, completeness, extensibility, openness, and version control. It adopts a uniform structure and relies on open formats. It provides alternative formulations of MP models per problem, tens of parameter instantiations per MP model, and thousands of exemplary solutions and non-solutions in discrete, continuous, and mixed domains, alongside natural-language descriptions to support text-to-model methods. The mpmmine-py Python package provides an application programming interface for accessing the dataset artifacts. The MPMMine Leaderboard is a~tool that systematically evaluates existing CA algorithms using MPMMine under consistent conditions. It leverages open source implementations, runs them in isolated containers adapting input/output to their needs to build an extensive, interactive scoreboard.
Sep 1, 2020

PyCSP3: Modeling Combinatorial Constrained Problems in Python

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

Improving Constraint Models with LLM Agents

The runtime of Constraint Programming (CP) solvers is highly sensitive to modeling choices, such as symmetry breaking, implied constraints, global constraints, constraint reformulation, and variable representation. Improving these constraint models has traditionally required human expertise, and existing automated reformulation systems are restricted to a predefined library of hand-crafted transformation rules. We introduce an agentic framework that instead reformulates a constraint model from an open-ended space and establishes correctness empirically rather than by construction: a Large Language Model (LLM) agent, given a model and three training instances, proposes alternative formulations, validates each by injecting its solution back into the original model, and diagnoses and repairs failures, returning the best variant it finds in a median of about fifteen minutes. The models are expressed in the CPMpy modeling library, and each proposed model is evaluated on three larger test instances. Across nine combinatorial optimization problems, the generated models outperform the originals on 21 of 27 test instances, and on some problems solve more than two orders of magnitude faster. A comparison against non-agentic baselines that reuse the same validation and selection tools indicates that the gains stem from the agent's iterative diagnosis and repair, not merely from sampling several candidates. These results demonstrate that autonomous agentic methods can support the improvement of constraint models.