Originally posted by: Khronum
I have noticed that as soon as I define my model on a CPLEX object in MATLAB, CPLEX re-defines this model with extra variables and changes constraints in a way that I don't understand. This happens before I try to solve the problem (and with the pre-solver and aggregator deactivated).
For example, if I define a binary linear programming problem as follows:
cplex_obj.Model.obj = f; cplex_obj.Model.A = A ; cplex_obj.Model.lhs = lhs; cplex_obj.Model.rhs = rhs;
where A is 1x4000 with:
A(1,1) = 1; A(1,300) = 1;
and:
lhs = 0; rhs = 1;
The first constraint should be:
Subject to: c1: 0 <= x1 + x300 <= 1
with
Bounds 0 <= x1 <= 1 ... 0 <= x300 <= 1 ...
and
Binaries x1 .... x300 ... x4000
But instead if I print the model, i.e.:
cplex_obj.writeModel(
'my_model.lp')
I get:
c1: x1 + x300 - x4001 = 0
where the variable x4001 has regular 0<= x4001 <=1 bounds.
With this, my questions are:
1) What is the role of x4001? Where is it defined and why is this model equivalent to the original model?
2) Is there a way to ask cplex to preserve the original constraints as they were originally defined?
The above is with: Latest MATLAB version on 64 bit with CPLEX 12.3.
#CPLEXOptimizers#DecisionOptimization