|
Mathematical Programming (MP) and Constraint Programming (CP) are two technologies critical to solving complex planning and scheduling problems. At ILOG, we've found that knowing both technologies is important in addressing some of the most difficult optimization problems. To make the most of each, it is important to understand their similarities and differences.
General model structure
A constraint programming (CP) optimization model has the same structure as a mathematical programming (MP) model: a set of decision variables, an objective function to maximize or minimize, and a set of constraints.
Modeling differences:
- A CP model natively supports logical constraints as well as a full range of arithmetic expressions, including modulo, integer division, minimum, maximum, or an expression which indexes an array of values by a decision variable
.
- A CP model can also use specialized constraints, such as the "all-different" constraint, that can accelerate searches for frequently used patterns.
- A CP model has no limitation on the arithmetic constraints that can be set on decision variables, while an MP engine is specific to a class of problems whose formulation satisfies certain mathematical properties. View an ILOG CPLEX list.
- A CP model has only discrete decision variables (integer or Boolean), while an MP model supports either discrete or continuous decision variables.
Optimization engine differences:
- A CP engine makes decisions on variables and values and, after each decision, performs a set of logical inferences to reduce the available options for the remaining variables' domains. In contrast, an MP engine, in the context of discrete optimization, uses a combination of relaxations (strengthened by cutting-planes) and "branch and bound."
- A CP engine proves optimality by showing that no better solution than the current one can be found, while an MP engine uses a lower bound proof provided by cuts and linear relaxation.
- A CP engine doesn't make assumptions on the mathematical properties of the solution space (convexity, linearity etc.), while an MP engine requires that the model falls in a well-defined mathematical category (for instance Mixed Integer Quadratic Programming (MIQP).
MP/CP Comparison Table
| |
MP |
CP |
| Relaxation |
 |
|
| Lower bound and optimality gap measure |
 |
|
| Optimality proof |
 |
 |
| Modeler support |
 |

(With ILOG CP Optimizer) |
| Model-and-run |
 |

(With ILOG CP Optimizer) |
|
Modeling limitations |
Restricted to linear and quadratic problems |
Restricted to discrete problems |
| Specialized constraints |
|
 |
| Logical constraints |
 |
 |
| Theoretical basis |
Algebra |
Logical inferences |
|
|