The problem comes probably from the big integer you use for expressing a logical relation while it is hard to see how it would made the model infeasible with the model extract given, probably because of a combination of these and other constraints.
The expression used as argument for min is
b * A + (1-b) * M that is M + (A-M) * b
where
- b is bin_task_var[bin][task]
- A is all_task_interval[task]
- M = 1000000000000
It means that the expression is M when b = 0 and A when b = 1.
The problem when using such a big value for M is because when CPLEX considers that b equals 1, it can be very close to 1 but not necessarily equals to 1.
Assume A = 1000 and b value to be very close to 1 (say 0.99999) one end up with a value of about 10000000. for the expression above. It is far from the expected value A=1000. The bigger M is the larger will be that gap.
A solution is to choose for M the smallest possible value that preserves the logic of the expression. Here it can be set to the biggest value the expression A (all_task_interval[task]) can take. It should be smaller than the current value used.
Note that problems with this formulation are less likely to appear in CP Optimizer because it instantiates b to the integer 1 and uses interval computations to evaluate expressions.
------------------------------
Philippe Refalo
IBM ILOG CP Optimizer
------------------------------