I am quite new to CPLEX and I am writing a very simple model that CPLEX does not want to satisfy. I know my model is "verbose" as I have variables that simply equal other variables, but it is my first step to a more complicated model so I want it this way. I don't see why would this upset CPLEX.
The model I have is:
Minimize
obj: v1
Subject To
l1: i_AB1 + i_AC1 - i_AB2 - i_AC3 = 1
l2: - i_AB1 + I_BB = 0
l3: I_CA + I_CC = 0
e5: i_AB2 + i_BD2 - I_BB = 0
e8: - i_AC1 - I_CA = 0
e9: i_AC3 + i_CD3 - I_CC = 0
\Indicator constraints
\For each connection XY
c1: bAB = 1-> i_AB1 - 1 v1 = 0
c2: bAB = 1-> i_AB2 - 1 v2 = 0
c5: bAC = 1-> i_AC1 - 1 v1 = 0
c6: bAC = 1-> i_AC3 - 1 v3 = 0
c9: bBD = 1-> i_BD2 - 1 v2 = 0
c13: bCD = 1-> i_CD3 - 1 v3 = 0
c15: bAB = 1
c16: bAC = 1
c17: bBD = 1
c18: bCD = 1
Bounds
0 <= v1 <= 1000
-1000 <= v2 <= 1000
-1000 <= v3 <= 1000
General
Binaries
bAB bAC bBD bCD
End
This, apparently does not have a solution (it does, or at least that is my intention, but CPLEX says no!).
But then I substitute the equation e8
into l3
and I get the solution I wanted!
Here is the code:
Minimize
obj: v1
Subject To
\budget:
l1: i_AB1 + i_AC1 - i_AB2 - i_AC3 = 1
l2: - i_AB1 + I_BB = 0
l3: - i_AC1 + I_CC = 0
e5: i_AB2 + i_BD2 - I_BB = 0
\Row C
\e8: - i_AC1 - I_CA = 0
e9: i_AC3 + i_CD3 - I_CC = 0
\Indicator constraints
\For each connection XY
c1: bAB = 1-> i_AB1 - 1 v1 = 0
c2: bAB = 1-> i_AB2 - 1 v2 = 0
c5: bAC = 1-> i_AC1 - 1 v1 = 0
c6: bAC = 1-> i_AC3 - 1 v3 = 0
c9: bBD = 1-> i_BD2 - 1 v2 = 0
c13: bCD = 1-> i_CD3 - 1 v3 = 0
c15: bAB = 1
c16: bAC = 1
c17: bBD = 1
c18: bCD = 1
Bounds
0 <= v1 <= 1000
-1000 <= v2 <= 1000
-1000 <= v3 <= 1000
General
Binaries
bAB bAC bBD bCD
End
Both are, to my eyes, the exact same model. What am I doing wrong so that the first model does not have a solution even though it seems equivalent to the second which does have a solution?
Btw, the solution is:
Populate: phase I
Tried aggregator 2 times.
MIP Presolve eliminated 4 rows and 4 columns.
Aggregator did 11 substitutions.
All rows and columns eliminated.
Presolve time = 0.00 sec.
Populate: phase II
Solution status: 129.
Objective value of the incumbent: 1
Incumbent: Column v1: Value = 1
Incumbent: Column i_AB1: Value = 1
Incumbent: Column i_AC1: Value = 1
Incumbent: Column i_AB2: Value = 0.5
Incumbent: Column i_AC3: Value = 0.5
Incumbent: Column I_BB: Value = 1
Incumbent: Column I_CC: Value = 1
Incumbent: Column i_BD2: Value = 0.5
Incumbent: Column i_CD3: Value = 0.5
Incumbent: Column bAB: Value = 1
Incumbent: Column v2: Value = 0.5
Incumbent: Column bAC: Value = 1
Incumbent: Column v3: Value = 0.5
Incumbent: Column bBD: Value = 1
Incumbent: Column bCD: Value = 1
The solution pool contains 1 solutions.
0 solutions were removed due to the solution pool relative gap parameter.
In total, 1 solutions were generated.
The average objective value of the solutions is 1.
Solution Objective Number of variables
value that differ compared to
the incumbent
p1 1 0 / 15
The problem itself is not even a MIP (because I fixed my booleans in this initial version, but it will be a proper MIP). Does this change something? I really don't see what the issue is.
Thanks