3.5 A Tailoring Example
4.1.1 Optimisation Techniques in Constraint Programming
There exists a set of automated techniques that aim at generating an effective problem instance in Constraint Programming which we summarise in this section. Note, that we only considerstaticenhancement techniques, i.e. techniques that alter the problem model, as opposed to dynamictechniques that are performed during search, when the instance is solved. After giving a brief description of each technique’s aims and possible approaches, we discuss the benefits and its applicability during tailoring.
Adding Implied Constraints
A constraint is called implied if the solutions of a constraint instance are the same with or without the constraint [77]. We strengthen this definition with the following requi- site: adding an implied constraint has to result in additional propagation (i.e. an implied constraint reduces search). In summary, adding an implied constraint to an instance is beneficial. However, inferring an implied constraint and proving that it enhances propaga- tion is costly and difficult. Several approaches have been proposed on how to add implied constraints to instances.
Charnley et al [18] automatically infer implied constraints by setting up an architecture consisting of a theorem prover, a constraint solver and an automated theory formation sys- tem: given a constraint class and parameter values, some solutions are generated by the solver which are passed to the theory formation system that generates conjectures related to the constraints in the instances. Each conjecture is passed to the theorem prover in an attempt to proof that the conjecture is implied from the constraint instance. If there is a proof, the conjecture is added as additional constraint to the instances which are solved again. If the constraint improves the solving performance, it is kept in the problem model. Note, that this enhancement technique improves both problem instances and classes. Bessiereet al [13] introduce a generic framework to learn impliedglobalconstraints, in particular the global ‘gcc’ constraint in their implementation. A brute-force learning al- gorithm is used to determine the tightest set of parameters for a gcc constraint that is an implied constraint (which is tested in the constraint solver Choco [19]). Specific heuris- tics that exploit constraint properties reduce the computational effort. The empirical eval- uation (that was performed on instances for which implied constraints could be found), demonstrates that the learning effort pays off for the solving time reduction obtained by the implied constraints. However, the study does not consider instances for which implied constraints cannotbe found and therefore does not analyse the potentialpenaltyone might have to pay for attempting to enhance an instance.
Both Charnleyet al[18] and Bessiereet al[13] propose interesting optimisation techniques that effectively enhance particular problem instances. However, we have not include them into tailoring for two main reasons. First, both techniques require solutions of instances in order to prove the constraints to be implied. This is not useful in the context of tailoring,
since solutions can only be obtained by first tailoring the instance to a solver, i.e. it would require to tailor twice. Second, both techniques cannot be integrated into any necessary tailoring step, and hence have to be addedon topof tailoring. However, since these tech- niques fire only for a limited number of constraints instances, but would be performed for
everyinstance that is tailored, this is expected to add overhead to tailoring.
Therefore, we conclude that the techniques from above would be most successfully applied as an extension to tailoring, to particular instances that have a high potential of benefit (e.g. learning implied gcc constraints for particular scheduling problems before/after tai- loring). Formulating heuristics of when these techniques fire on a particular instance is an interesting item for future work.
Adding Symmetry Breaking Constraints
Many constraint instances containsymmetriesthat are mainly introduced during modelling, when entities that are indistinguishable in the original problem are represented by distinct values or variables. For instance, in then-queens problem [57], it does not matter which of thenqueen figures is placed into the first row of the chessboard, however, many models assign a variable to each queen. This results insymmetricsolutions, that are permutations of another and all represent the same setting in the actual problem. If a constraint solver searches for all solutions of a problem, then looking for symmetric solutions can add sig- nificant overhead. Therefore, one can add symmetry breaking constraints that eliminate
symmetries in the problem and hence reduce the search space. For more details on sym- metries and symmetry breaking in Constraint Programming, consult [35].
Symmetry breaking is an important component of efficient modelling, which is subject to active research in Constraint Programming [35]. Unfortunately, including symmetry breaking into tailoring is out of scope of this thesis, but an interesting candidate for future work.
TheCGRASSSystem
The CGRASSsystem [28] takes a low-level constraint instance as input and returns an au- tomatically enhanced instance, by help of a proof planner. The instance enhancements include ordering and evaluation by normalisation, the removal of particular redundant con- straints, domain and bounds propagation, adding inequalities that break symmetries and a simple form of common subexpression elimination. Its structure was inspired by proof planning [17].
CGRASS is a successful tool from which we have drawn inspiration, such as performing extensive normalisation of expressions during preprocessing (Sec. 3.3.1). However, many optimisation techniques in CGRASS have limitations: first, since CGRASS is restricted to flat constraint instances, all optimisation techniques are tailored to simple expressions and
do not exploit high-level constructs such as quantifications. Furthermore, the enhance- ment techniques are not particularly cheap: the authors give no concrete translation times, but note that the time invested into enhancement often exceeds the solving time reduc- tion gained from the enhancements. In fact, the authors argue that the input format is too low-level to perform enhancements effectively and that transformations on more abstract formulations (involving e.g. quantifications) would be more beneficial. Therefore, we fo- cus on more general enhancement rules to be included during tailoring.
Constraint Representation and Propagator Selection
Harveyet al[40] present efficient representations of linear constraints to improve propaga- tion. In particular, they investigate equivalent representations of several linear constraints by comparing them in terms of bounds and domain propagation. This study has been very inspirational and given us important insights on how to map linear constraint expressions to efficient but cheap propagators, which we have applied (to a certain extent) in the imple- mentation of TAILOR.
Schulte and Stuckey [72] investigate when expensive domain propagators can be replaced by cheaper bounds propagators while resulting in the same amount of propagation. These cases can be statically determined, as the authors show. Furthermore, in [73] the authors extend their work to an even more effective dynamic approach. This work shows important results that are easily integrable into tailoring to improve the propagator selection, which we have, to an extend applied. Note however, that these results cannot be directly applied for every solver, since some solvers do not allow to state the propagator type (bounds or domains) explicitly. For instance, in solver Minion [32], thevariable typedetermines the type of propagation (bounds or domains), while in solver Gecode [80], the propagation type is explicitly set within the constraint specification. Therefore, replacing an expensive domain propagator with a cheap bounds propagator in Minion cannot be achieved as easily as in Gecode, since it requires a change of the variable type, which can have consequences on the propagation behaviour of other constraints and possibly impair the model.
Automated Modelling Systems
There exist several automated modelling systems that aim at generating efficient constraint instances, typically from a rather intuitive (or naive) input. This is an important step that is typicallyindependentof a particular target solver and therefore constitutes the automated modelling step which is performedbeforetailoring.