Introduction
In the field of Constraint Programming (CP), the primary challenge often lies not in solving a problem, but in accurately modeling it. Defining the mathematical constraints for complex real-world scenarios—such as industrial scheduling or frequency assignment—requires significant expertise that many end-users lack. This "modeling bottleneck" has led to the development of constraint acquisition techniques, where a system learns the underlying rules of a problem through interaction with a user. This paper discusses QuAcq2 (Quick Acquisition, version 2), an advanced algorithm that utilizes partial queries to transform constraint acquisition from an exponential task into a polynomial one.
Methodology: From Full to Partial Queries
Traditional active learning approaches in CP relied on membership queries, asking users to validate complete solutions. For a problem with $n$ variables, this approach often results in exponential query complexity and high cognitive load for the user. QuAcq2 addresses these issues by employing partial queries, asking users to classify small subsets of variables as "allowed" or "forbidden."
Core Algorithmic Components
QuAcq2 operates within a predefined "bias"—a library of potential constraint relations. The learning process is driven by two primary sub-procedures:
- FindScope: When a user rejects a partial assignment, this procedure uses a recursive, logarithmic search (inspired by the QuickXplain algorithm) to isolate the specific subset of variables (the scope) responsible for the violation.
- FindC: Once the scope is identified, this procedure determines which specific constraint relation from the bias (e.g., $x \neq y$ or $x > y$) applies to those variables.
Ensuring Interactivity
Generating informative queries is an NP-hard task, which can lead to "stalls" in human-in-the-loop systems. QuAcq2 introduces a time-cutoff mechanism. If the algorithm cannot generate an optimal query within a specified time limit, it defaults to a simpler partial query. This ensures the system remains responsive, maintaining user engagement during interactive sessions.
Empirical Evaluation
The effectiveness of QuAcq2 was evaluated across a diverse range of benchmarks, including logic puzzles (Purdey’s problem, the Zebra puzzle, Jigsaw Sudoku), combinatorial problems (Golomb Ruler), and real-world proxies like the Radio Link Frequency Assignment Problem (RLFAP) and an Exam Time-tabling case study from the University of Western Macedonia.
Key Findings
- Complexity Reduction: The algorithm achieves a theoretical query complexity of $O(m \log n + b)$, where $m$ is the number of target constraints and $b$ is the size of the bias. This represents a shift from exponential to polynomial complexity.
- Informative Negatives: A "no" response to a partial query provides significantly more information than a "no" to a full solution, allowing the algorithm to rapidly "zoom in" on conflicts using binary search-like logic.
- Interactivity Gains: In complex tests like RLFAP, the cutoff version reduced wait times from minutes to under one second, with only a marginal increase in the total number of queries required for convergence.
- Background Knowledge: Incorporating even basic domain knowledge (e.g., "no two exams in the same room simultaneously") significantly reduces the learning curve and total query count.
Discussion and Future Directions
While QuAcq2 represents a significant leap in efficiency, it remains dependent on the initial bias; it cannot learn constraints that are not represented in its library. Furthermore, the current model assumes an "ideal" user (an oracle). Future research is needed to address human factors, such as fatigue during long query sessions and the handling of "noisy" or incorrect user feedback. Despite these limitations, QuAcq2 demonstrates that partial queries are a powerful tool for making constraint modeling accessible to non-experts by providing a mathematically sound and interactive framework for automated learning.
Summary updated