Decision Optimization

Decision Optimization

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

 View Only
  • 1.  GAP VALUE in IBM CPLEX ILOG

    Posted Tue January 23, 2024 09:47 AM
    GAP VALUE OF OUTPUT FOR Constraint Programming in IBM CPLEX ILOG

    Hello,

    In IBM cplex ılog, I am working at constraint programming for job shop scheduling. I need GAP values of the output. In IBM , I can get value of GAP . For a example in the picture that ı shared gap value is %0,00. How can this value calculate from the system? and what is the meaning of GAP for IBM CPLEX ILOG terminology. Can you help me with that ?



    ------------------------------
    Berkay Orkun Erkılınç
    ------------------------------


  • 2.  RE: GAP VALUE in IBM CPLEX ILOG

    Posted Tue January 23, 2024 09:53 AM

    same question at https://stackoverflow.com/questions/77867129/ibm-cplex-gap-value-calculation-and-meani/77867176#77867176

    In the documentation you can read

    gap The relative difference between the integer solution found and the proven best possible objective solution value
    

    If the gap is 0 then you have a solution that is proved to be optimal



    ------------------------------
    [Alex] [Fleischer]
    [Data and AI Technical Sales]
    [IBM]
    ------------------------------



  • 3.  RE: GAP VALUE in IBM CPLEX ILOG

    Posted Tue January 23, 2024 10:08 AM

    Dear Mr.Alex thank you for answer. However, I want to  learn how it is calculated in the system . Is there any specific formula for that ?



    ------------------------------
    Berkay Orkun Erkılınç
    ------------------------------



  • 4.  RE: GAP VALUE in IBM CPLEX ILOG

    Posted Tue January 23, 2024 01:57 PM

    In the cplex documentation you can read "When the value |bestbound-bestinteger|/(1e-10+|bestinteger|) falls below the value of this parameter, the mixed integer optimization is stopped

    With the zoo example

    execute
    {
      cplex.intsollim=2;
    }
    
    
    int nbKids=300;
    float costBus40=500;
    float costBus30=400;
     
    dvar int+ nbBus40;
    dvar int+ nbBus30;
     
    minimize
     costBus40*nbBus40  +nbBus30*costBus30;
     
    subject to
    {
     40*nbBus40+nbBus30*30>=nbKids;
    } 
    
    execute
    {
     
      
      writeln(cplex.getBestObjValue());
      
      writeln(cplex.getObjValue());
    }
    

    gives

    3750
    3900
    

    and with constraint programming

    using CP;
    
    execute
    {
      cp.param.SolutionLimit=1;
      cp.param.SearchType=24;
    }
    
    int nbKids=300;
    float costBus40=500;
    float costBus30=400;
     
    dvar int+ nbBus40;
    dvar int+ nbBus30;
     
    minimize
     costBus40*nbBus40  +nbBus30*costBus30;
     
    subject to
    {
     40*nbBus40+nbBus30*30>=nbKids;
    } 
    
    execute
    {
     
      
      writeln(cp.getObjBound());
      
      writeln(cp.getObjValue());
      
      writeln(cp.getObjGap());
    }
    

    gives

    0
    4000
    1
    


    ------------------------------
    [Alex] [Fleischer]
    [Data and AI Technical Sales]
    [IBM]
    ------------------------------