0
$\begingroup$

I've made a CP Model of an hospital in ILOG CPLEX and I want to test the performance of the CPLEX version of it.

In my CP model, I have the following constraint :

forall(c in Chirurgiens, o1 in Operations, o2 in Operations : o1 != o2){
    (zeta[o1][o2]==1 ) => psi[o1]+TP[o1]+TC[o1]+ max_time >= psi[o2]+TP[o2];}

where zeta is a boolean and all other variable are Integers.

I've tried to linearize it using a big M and it gave me the following thing :

   forall(c in Chirurgiens, o1 in Operations, o2 in Operations : o1 != o2){
    (psi[o1]+TP[o1]+TC[o1]+ max_time) >= psi[o2]+TP[o2] -M*(1-zeta[o1,o2]);}

These two constraint gave me the same result.

But now, I was cleaning my code a little bit and transformed this constraint into the following one :

forall(c in Chirurgiens, o1 in Operations, o2 in Operations : o1 != o2){
    (psi[o1]+TP[o1]+TC[o1]+ max_time) - psi[o2]+TP[o2] >= 0 - M*(1-zeta[o1,o2]);}

But now this give me a different result

The only thing that I've changed is that I've moved the psi[o2]+TP[o2] on the other side of the inequality. Isn't this supposed to be a legal move in math ?

$\endgroup$
2
  • 4
    $\begingroup$ Does the sign for TP[o2] is negative instead of positive? $\endgroup$
    – ytsao
    Commented Mar 5 at 9:52
  • $\begingroup$ omg, the whole problem was that i forgot how to do basic maths ! Thanks for you answer, i was stuck on this for hours ! $\endgroup$ Commented Mar 5 at 10:08

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.