Originally posted by: SystemAdmin
[Didier Vidal said:]
Anthony,
If your problem contains only discrete variables (no continuous variable), you can run it with CP Optimizer as is.
But in general, you need to change the formulation to get the best of CP Optimizer.
For MILP, modelers often use boolean variables. In CP, modelers tend to use integer variables with the full domain instead.
Here is an example:
Classical assignment MIP
var int xm[L,R] in 0..1;
forall (k in L) sum (r in R) x[k,r] = 1
forall (r in R)
sum (k in L) x[k,r] = 1
Classical assignment CP
var R xc[L];
alldifferent(xc);
Assign many to few MIP
var int xm[L,R] in 0..1;
forall (k in L) sum (r in R) x[k,r] = 1
forall (r in R)
sum (k in L) x[k,r] = Rsizes[r]
Assign many to few CP
var R xc[L];
forall(r in R)
count(xc, r) == Rsizes[r];
Hope this helps,
Didier.
#ConstraintProgramming-General#DecisionOptimization