Introduction

Some models have structures that are particularly well-understood by the user. It is possible to help CP Optimizer exploit these structures during the search and achieve much better solving times. In these cases, it is possible to adjust the automatic search in CP Optimizer using search phases in order to use the problem structures.

For instance, assume we have a model over two groups of variables x1, x2, x3, x4, x5 and y1, y2, y3. The following search section:


search {
  searchPhase([x1, x2, x3, x4, x5]);
  searchPhase([y1, y2, y3]);
}

specifies that the variables x1, x2, x3, x4 and x5 will be fixed before the variables y1, y2 and y3, although the fixing order among the x variables and y variables is not specified here.

The order of the search phases is important. The variables will be fixed phase by phase in the order in which they appear. It is not necessary for the variables in the search phases cover all the variables of the problem. If any variables remain unfixed after all of the phases have been executed, then CP Optimizer's automatic search will continue to attempt to fix the remainder.