Differences with mathematical programming
Describes what is required by constraint programming, in contrast with math programming.
In contrast with math programming, constraint programming requires:
Explicit modeling for max, min, abs
More memory usage per decision variable
and supports:
Only discrete decision variables
No gap measure
Explicit modeling for max, min, abs
Since constraint programming does not have linear relaxation
to optimize a relaxed problem after each decision on integer variables,
the MP way of modeling constraints such as max, min, cannot be used directly for CP.
For instance, the following MP linearization would put the maximum
value of x[i] in m.
minimize m + …;
subject to {
forall(i in 1..10) m >= x[i];
….
}
In CP, it is safer and more efficient to write:
minimize …;
subject to {
m == max(i in 1..10) x[i];
…
}
More memory usage per decision variable
For an MP engine, a decision variable is stored as one more column in a matrix. For a CP engine, it may require much more memory, because the CP engine stores domain information in the variable. Therefore, a CP engine scales apparently less than an MP engine, in term of the number of variables and of constraints. However, since the set of constraints of a CP engine enables often a more compact formulation of a problem, there is no direct connection between this property and the size of problems that either engine can address.
Only discrete decision variables
IBM ILOG CP Optimizer engine handles only discrete decision variables. You can use continuous expressions to define costs or intermediate expressions, but these continuous expressions must be computed only from discrete decision variables.
No gap measure
Because the CP Optimizer engine addresses problems that are potentially non convex or too irregular for mathematical optimization, it cannot compute valuable relaxed solutions of a problem, and does not have gap information between the best found solution and a theoretical bound that an MP engine can provide for a linear problem.