3

I have been studying about optimization algorithms and I came across some questions that I couldn't found answer.

a) Is CP faster than LP? And how is it compared to MILP?
b) CP and MILP would provide the same objective function value?
c) When should I use CP instead MILP? (if I have a mixed-integer linear problem)

Thank you.

rapha123
  • 179
  • 9
  • 3
    SO is probably not the right place to ask this (not really about programming; very broad; heavily opinionated). This is a very complex question and every answer starts with "it depends", which is not surprising, due to most problems being tackled by both approaches, being np-hard. There are some general things one could argue with (in regards to their proof-system, their local/global view), but without a broad context, this is not much more than a comment without much merrit.I recommend grabbing `Hybrid Optimization` by van Hentenryck / Milano. Imho it's *indirectly* answering this question – sascha Jul 07 '20 at 22:32
  • 2
    As the previous commenter writes, it really depends and thus it is impossible to answer. In particular, it is not just about the problem to solve and the technique used to solve it, but also depends on how well the formulation used works for the particular technique. Models done for MIP are typically not great when transplanted directly to CP. I would recommend looking into MiniZinc for writing a high-level model (not MIP-style), that can be translated automatically to CP and MIP. – Zayenz Jul 08 '20 at 06:06
  • 1
    CP is usually not an alternative for continuous LPs. Many CP and SAT solvers work only (or work best) with only discrete variables. So if the problem is 100% discrete, CP and MIP are direct "competitors" (although the best MIP formulation may be very different from the best CP formulation). If the model is a combination of discrete and continuous variables, depending on the situation, a MIP may be more straightforward (although sometimes we discretize to make a model more amenable for CP and SAT solvers). – Erwin Kalvelagen Jul 09 '20 at 08:49

1 Answers1

2

Having worked with both CP and LP/MILP, maybe I can offer some insights on your queries. The only thing CP and LP have in common is the word "Programming".

  • The type of variables is different (CP=discrete integer values/LP=continous values/MILP=some are discrete and other variables are continous).
  • The type of constraintes handled is different (CP involve non-linear, LP are of course linear in the variables used).

a) Is CP faster than LP ? in most cases I would consider that CP is slower, because there is no explicit algorithm in CP. It relies on search. However, CP models tend to need lesser variables. With only linear constraints, more variables are needed to model (e.g. using large M equations).

b) CP and MILP give the same objective function value - if the constraints are all linear, and all the variables are integer, then it would not be interesting to use CP to solve the problem because it would be less performant.

c) We should use CP when the problem constraints are well expressed in CP equations, and/or poorly expressed in linear (big M) equations where convergence towards optimum is bad or slow.

Check this question. Some research work to integrate both approaches result in open source software like CLP(r).

peter.cyc
  • 1,763
  • 1
  • 12
  • 19