Decision Optimization

Decision Optimization

Delivers prescriptive analytics capabilities and decision intelligence to improve decision-making.

 View Only
  • 1.  Ensuring Mixed Integer Solutions in CPLEX Generated Cutting Planes

    Posted Mon March 17, 2025 03:58 AM
    Edited by Eliza Hu Mon March 17, 2025 03:58 AM

    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
    ------------------------------



  • 2.  RE: Ensuring Mixed Integer Solutions in CPLEX Generated Cutting Planes

    Posted Mon March 17, 2025 12:12 PM

    The model exported with the CPXgetcallbacknodelp function (https://www.ibm.com/docs/en/icos/22.1.2?topic=g-cpxxgetcallbacknodelp-cpxgetcallbacknodelp ) is the internal LP solved by CPLEX. It is the relaxed LP of the original MIP. It contains continuous variables only. Original integer variables have been converted to continuous ones in this node LP.  You can see this by exporting/converting the file to a .lp (the most human-readable format), there is no section Binaries or Generals that declares integer variables.
    The observation that the objective value of that node LP is close to the MIP optimal value is probably due to the cutting planes added by CPLEX that improves the lower bound enough in your case so that is gets close  (and maybe sometimes equal) to the optimal objective value. 

    Regards

    Philippe