We want to use the C API of CPLEX to generate and record cutting planes when solving a Mixed Integer Linear Program (MILP). Currently, we obtain cuts from CPLEX using the CPXgetcallbacknodelp function (we use the code provided by IBM Support: Sample C Program to Retrieve Cuts Added by CPLEX During MIP Optimization).
This code takes the original MILP model file as input, and outputs a model file ("cutting.mps") that includes all cuts. We are now solving a 0-1 knapsack problem, so the model file generated by this code, i.e., "cutting.mps", should always lead to Boolean solutions. However, we found that "cutting.mps" sometimes leads to floating-point solutions.
The difference between the optimal objective values of the original MILP model and "cutting.mps" is approximately 0.003, so we suspected that the cause of these floating-point solutions may be the default MIP gap in CPLEX. However, even after setting:
status = CPXsetdblparam(env, CPXPARAM_MIP_Tolerances_AbsMIPGap, 1e-10);
status = CPXsetdblparam(env, CPXPARAM_MIP_Tolerances_MIPGap, 1e-10);
we still encounter instances where "cutting.mps" leads to floating-point solutions.
Why might "cutting.mps" result in floating-point solutions? Is it possible to obtain models that consistently lead to Boolean solutions? If so, how can we achieve this?
Thank you!
------------------------------
Eliza Hu
------------------------------