Originally posted by: SystemAdmin
Yes, max is an issue for MIP models, and incidator constraints are certainly a good option to deal with it if you do not have tight bounds for the involved variables (if you have, a standard big-M formulation, which you tried, can sometimes be better than indicator constraints).
In C, the method to add indicator constraints is called CPXaddindconstr(). Since the various interfaces are pretty similar in the naming scheme, you need to search the docs for a C# method of a similar name. I don't have the docs in front of me at the moment, but I guess the method should be called something like cplex.addIndConstr().
Big-M formulations are terrible in terms of numerics because you can easily satisfy a big-M constraint by introducing a tiny non-zero value to the variable. For example, the constraint
(1) x - 1000000000y <= 0
with a continuous variable x and binary y can be easily satisfied by almost integral solutions like (x=10,y=1e-8). The 1e-8 is so small that CPLEX treats this as an integral value. Additionally, a mix of big and small numbers can be very harmful to the LU factoriziation code. Assume that there is another constraint
(2) 0.33333z - y = 0,
and the factorization decides to eliminate y. Then we need to multiply (2) with 1e+9 and subtract it from (1). The result is
(1)-1e+9*(2) x - 333330000z <= 0.
As you can see, imprecise input data (the 0.33333 probably should actually be 1/3) and round-off errors in previous calculations can be scaled up to a significant error if the factorization needs to use large row weights to eliminate non-zeros.
Indicator constraints help for both of these issues. The first one is addressed, because we deal with indicator constraints by branching: after branching on y=0 x is forced to be exactly 0. The second issue is addressed because indicator constraints do not appear in the coefficient matrix and thus do not hurt the LU factorization.
#CPLEXOptimizers#DecisionOptimization