Decomposition and Preprocessing of Ternary Constraint Networks
Pierre Talbot
TL;DR
This work addresses decomposing general constraint networks into ternary constraint networks (TCNs) to enable regular data layouts for GPU-based propagation. It formalizes a decomposition function $\mathrm{tcn}(d, C)$ that rewrites constraints into ternary form using reification variables, accompanied by a recursive $\mathrm{tc}$ procedure and a $\mathit{booleanize}$ mechanism to handle logical constructs, with a proven equivalence $\mathit{sol}(d, C) = \mathit{sol}(\mathrm{tcn}(d, C))|_X$ and a bijection between solution counts. To cope with the potential blow-up in size, the paper introduces a preprocessing pipeline that merges equivalent variables via an equivalence partition $E$ and applies seven reductions (propagation, algebraic simplification, common subexpression elimination, merging domains, entailed constraint elimination, variable renaming, and useless variable elimination) within a greatest fixpoint framework. Empirical results on MiniZinc instances show that while decomposition inflates problem size, preprocessing significantly mitigates this growth and yields a representation dominated by a small set of operators, supporting efficient GPU execution and educational use. Overall, the work provides a self-contained formal basis and practical pipeline for converting and simplifying constraint networks into GPU-friendly ternary forms, with quantified trade-offs demonstrated across a substantial benchmark suite.
Abstract
Constraint programming is a general and exact method based on constraint propagation and backtracking search. We provide a function decomposing a constraint network into a ternary constraint network (TCN) with a reduced number of operators. TCNs are not new and have been used since the inception of constraint programming, notably in constraint logic programming systems. This work aims to specify formally the decomposition function of discrete constraint network into TCN and its preprocessing. We aim to be self-contained and descriptive enough to serve as the basis of an implementation. Our primary usage of TCN is to obtain a regular data layout of constraints to efficiently execute propagators on graphics processing unit (GPU) hardware.
