Learning MAX-SAT from Contextual Examples for Combinatorial Optimisation

Mohit Kumar, Samuel Kolb, Stefano Teso, Luc De Raedt

Introduction

A fundamental bottleneck in artificial intelligence is the difficulty of manually engineering combinatorial optimization models. Whether scheduling hospital shifts or routing delivery trucks, defining the "rules" (hard constraints) and "preferences" (soft constraints) requires immense domain expertise. This paper, presented at AAAI-20, proposes a shift from manual encoding to learning from contextual examples, providing both a theoretical foundation and a practical implementation called HASSLE.

The Problem: Contextual vs. Static Learning

Traditional constraint learning often assumes a static environment. However, in the real world, what constitutes a "good" solution depends on the context. For example, a delivery route that is optimal on a sunny day might be impossible if a specific bridge is closed.

Existing approaches suffer from two main gaps:

  1. Ignoring Context: They don't account for how the feasible region and the optima shift based on external, temporary conditions.
  2. Separated Learning: They usually learn hard constraints (what is legal) and soft constraints (what is preferred) independently. This creates an "attribution problem": if a user rejects a schedule, is it because it's illegal or just suboptimal? Without joint learning, it's hard to tell.

Methodology: The HASSLE Framework

The authors frame the problem using the MAX-SAT formalism. A model consists of a set of Boolean formulas, where some are "hard" (must be satisfied) and others are "soft" (associated with a weight $w$).

Contextual Formalization

They define context $\psi$ as a Boolean formula that restricts the search space. Inference then becomes finding an assignment that satisfies the hard constraints AND the context, while maximizing the weight of satisfied soft constraints.

Illustration of contextual examples where different contexts $\psi$ restrict the feasible assignments of variables $X$.

HASSLE (HArd and Soft conStraint LEarning)

HASSLE is an implementation of Empirical Risk Minimization (ERM) that translates the learning task into a Mixed-Integer Linear Program (MILP). It looks for a set of constraints and weights that make the positive examples in the dataset optimal within their respective contexts, while ensuring negative examples are either infeasible or suboptimal. By learning hard and soft constraints jointly, HASSLE avoids the mistake of assuming every "bad" example is a violation of a hard rule.

Theoretical Foundations

Using Vapnik-Chervonenkis (VC) dimension theory, the authors prove that MAX-SAT models are Probably Approximately Correct (PAC) learnable. This means that with enough examples, an ERM approach will likely find a model with low "regret"—the difference in quality between the learned model's choice and the true optimal choice.

Experimental Evaluation

The authors evaluated HASSLE on synthetic models (varying variables $n=5, 10, 15$) and benchmark "phase-transition" SAT instances from the SATLIB repository.

Key Results

  • High Precision, Low Regret: On synthetic data, HASSLE recovered models with high precision. Even as the number of hard constraints increased, the "regret" (suboptimality) remained below 10%.
  • Data Efficiency: Increasing the number of examples ($s^+, s^-$) significantly improved the model's precision and recall.
  • Benchmark Performance: On complex benchmark instances, HASSLE achieved an average precision of 91.7% in the global context. While precision dropped to 73.5% for random unseen contexts, the average regret stayed low at approximately 5%, suggesting the learned models were still producing very high-quality solutions.
Performance metrics (precision and regret) across varying numbers of hard constraints $m_{hard}$ (left) and training examples $\hat{s}^+, s^-$ (right).

Conclusion and Future Work

HASSLE demonstrates that learning complex optimization models from contextual data is both theoretically sound and practically feasible. While the current MILP-based implementation faces scalability challenges as the number of variables increases, it provides a robust solution to the attribution problem in constraint learning. Future research directions include optimizing the MILP encoding, handling latent contexts, and extending the framework beyond Boolean variables to general Constraint Satisfaction Problems (CSPs).

Summary updated

BibTeX
@inproceedings{kumar2020learning,
  author = {Mohit Kumar and Samuel Kolb and Stefano Teso and Luc De Raedt},
  title = {{Learning MAX-SAT from Contextual Examples for Combinatorial Optimisation}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2020},
  doi = {10.1609/aaai.v34i04.5877},
}
Figure