I am completely new to CPLEX and far from an expert in MIP but I am trying to solve a problem with this technology (CPLEX 12.4). I ahve decided to create the MIP models in an .lp file and give it to CPLEx so I can have a plenty of inputs and test different solvers etc. But I am finding one thing about indicator constraints a bit problematic.
I want something like:
c1: a AND NOT(b)-> i1 - 100 v1 = 0
c2: b AND NOT(a)-> i1 - 120 v1 = 0
c3: a AND b -> i1 - 80 v1 =0
But there is no such thing ans AND
or NOT
in the LP format (I am not even sure if I could do that on the CPX interface, but I am trying to avoid it).
The only workaround I have found is doing:
ca: a_not_b = 1 <-> a - b = 1
cb: b_not_a = 1 <-> a - b = -1
cab: a_and_b = 1 <-> a + b = 2
c1: a_not_b-> i1 - 100 v1 = 0
c2: b_not_a-> i1 - 120 v1 = 0
c3: a_and_b = 1-> i1 - 80 v1 =0
I would be ok with having this, because I am going to be generating this LP with another program, but does this slow down CPLEX? Is there a better way of doing this?
Thanks