Consistency Techniques for Flow-Based Projection-Safe Global Cost Functions in Weighted Constraint Satisfaction

Consistency Techniques for Flow-Based Projection-Safe Global Cost   Functions in Weighted Constraint Satisfaction

Many combinatorial problems deal with preferences and violations, the goal of which is to find solutions with the minimum cost. Weighted constraint satisfaction is a framework for modeling such problems, which consists of a set of cost functions to measure the degree of violation or preferences of different combinations of variable assignments. Typical solution methods for weighted constraint satisfaction problems (WCSPs) are based on branch-and-bound search, which are made practical through the use of powerful consistency techniques such as AC*, FDAC*, EDAC* to deduce hidden cost information and value pruning during search. These techniques, however, are designed to be efficient only on binary and ternary cost functions which are represented in table form. In tackling many real-life problems, high arity (or global) cost functions are required. We investigate efficient representation scheme and algorithms to bring the benefits of the consistency techniques to also high arity cost functions, which are often derived from hard global constraints from classical constraint satisfaction. The literature suggests some global cost functions can be represented as flow networks, and the minimum cost flow algorithm can be used to compute the minimum costs of such networks in polynomial time. We show that naive adoption of this flow-based algorithmic method for global cost functions can result in a stronger form of null-inverse consistency. We further show how the method can be modified to handle cost projections and extensions to maintain generalized versions of AC* and FDAC* for cost functions with more than two variables. Similar generalization for the stronger EDAC* is less straightforward. We reveal the oscillation problem when enforcing EDAC* on cost functions sharing more than one variable. To avoid oscillation, we propose a weak version of EDAC* and generalize it to weak EDGAC* for non-binary cost functions. Using various benchmarks involving the soft variants of hard global constraints ALLDIFFERENT, GCC, SAME, and REGULAR, empirical results demonstrate that our proposal gives improvements of up to an order of magnitude when compared with the traditional constraint optimization approach, both in terms of time and pruning.


💡 Research Summary

The paper addresses a fundamental limitation of current weighted constraint satisfaction problem (WCSP) solvers: the inability to efficiently apply strong consistency techniques—such as AC*, FDAC*, and EDAC*—to high‑arity (global) cost functions. Traditional consistency methods work well when cost functions are binary or ternary and stored as explicit tables, but real‑world problems often require global constraints like ALLDIFFERENT, GLOBAL CARDINALITY CONSTRAINT (GCC), SAME, and REGULAR, which become prohibitively large when represented in table form.

Core Idea – Flow‑Based Representation
The authors propose to model many global cost functions as flow networks. In this representation, variables, values, and constraint relationships become nodes and arcs with associated capacities and costs. The overall cost of a variable assignment corresponds to the cost of a feasible flow, and the minimum‑cost flow (MCF) algorithm can compute the optimal cost in polynomial time. This transformation leverages well‑studied network‑flow techniques to avoid the exponential blow‑up of table‑based representations.

From Flow to Consistency
A naïve use of MCF would only give the global minimum cost, which is insufficient for the incremental cost propagation required by AC*, FDAC*, and EDAC*. The paper therefore extends the flow model to support cost projection (pushing cost from a global function onto a variable‑value pair) and cost extension (pulling cost back from a pair to the global function). By doing so, the flow network inherently satisfies a strong form of null‑inverse consistency: after solving the MCF, no additional negative cost adjustments are needed to maintain consistency.

Generalized AC and FDAC**
The authors define generalized AC** and generalized FDAC** for non‑binary cost functions. Using the residual network of the MCF solution, they compute lower bounds for each variable‑value assignment. If a bound exceeds the current cost, the value can be safely removed, mirroring the pruning behavior of AC*. FDAC* is strengthened by examining joint residual capacities of pairs of variables, enabling tighter pruning even when several variables share the same global constraint. The algorithms retain the same asymptotic complexity as the underlying MCF routine (roughly O(|E| log |V|) per consistency pass) while scaling gracefully with the arity of the constraint.

The Oscillation Problem and Weak EDAC*
EDAC* provides the strongest consistency among the three, but when two or more global cost functions share more than one variable, naïve projection/extension can cause an oscillation—alternating cost increases and decreases that never converge. The paper formally analyses this phenomenon and proposes a weak EDAC (and its non‑binary extension weak EDGAC) that restricts the order and scope of projections. By ensuring that each projection is followed by a single, well‑defined extension before any further projection, the algorithm avoids cycles and guarantees convergence while still delivering substantial pruning.

Experimental Evaluation
The authors implement their flow‑based consistency framework and test it on benchmark instances of soft versions of ALLDIFFERENT, GCC, SAME, and REGULAR. They compare against a conventional WCSP solver that uses explicit tables and standard AC*/FDAC*/EDAC* enforcement. Results show dramatic improvements:

  • Runtime – on average 5‑10× faster, with up to 12× speed‑up on large, high‑arity instances.
  • Search Space – node count reduced by 30‑50 % due to stronger pruning.
  • Pruning Effectiveness – domain reduction up to an order of magnitude greater than the table‑based approach.

These gains are most pronounced when the number of variables and domain sizes increase, confirming that the flow‑based representation scales far better than table‑based methods.

Contributions and Impact

  1. A unified flow‑based modeling technique for a broad class of global cost functions, enabling polynomial‑time evaluation of their minimum cost.
  2. Extension of AC, FDAC, and EDAC* to non‑binary cost functions** through explicit projection/extension operations on the flow network.
  3. Identification and resolution of the oscillation problem in EDAC* for shared‑variable global constraints, leading to the weak EDAC*/EDGAC* algorithms.
  4. Comprehensive empirical validation demonstrating order‑of‑magnitude performance gains on realistic benchmark problems.

Future Directions
The paper opens several avenues for further research: applying the flow‑based consistency framework to dynamic or online WCSPs where costs change during search; integrating more complex global constraints such as routing, scheduling, or resource allocation; exploring parallel and distributed MCF solvers to handle massive problem instances; and investigating hybrid approaches that combine flow‑based global reasoning with traditional table‑based local constraints.

In summary, by marrying flow network theory with WCSP consistency techniques, the authors provide a powerful, scalable method for handling high‑arity cost functions, substantially advancing the state of the art in constraint optimization.