Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  Large difference in solving time while using flow control

    Posted 10/16/15 04:51 AM

    Originally posted by: Hihi15


    I use CPLEX to solve a series of inventory routing problems (which basically is a travelling salesman problem extended with an inventory component).

    Each of the problem instances are linked by the fact that that the output (inventory level) of one instance is the input for the next instance (so in fact it is a simulation) All other parameters (and settings) remain the same.  

     

    The problem I encounter is that there is a very large variation in solving time.

    While some instances take a few seconds each, other instances take a few hours each. 

    I understand that there could be some difference in solving time present due to the difference in inventory level, but I think a factor 1000 in solving time is a too large difference.

    Any tips/suggestions/thoughts on what could be the reason for this and how to solve it?

    Basically, the flow control script looks like:


    main { 


    for (var tsim=1; tsim<=tsimlength; tsim+=1){    
        

    var source = new IloOplModelSource(".mod");

    var cplex = new IloCplex();

    var def = new IloOplModelDefinition(source);

    var opl = new IloOplModel(def,cplex);

    var data = new IloOplDataSource(".dat");

    opl.addDataSource(data);

    opl.generate();

    if (cplex.solve()) {

    writeln("OBJ = " + cplex.getObjValue());

    }

    else {

    writeln("No solution");

    }

    opl.end();

    data.end(); 

    def.end(); 

    cplex.end(); 

    source.end(); 

    }

    }


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 2.  Re: Large difference in solving time while using flow control

    Posted 10/16/15 10:14 AM

    Hi,

    what about trying a time limit for the solves ?

    After

    var cplex = new IloCplex();

    you could try

    cplex.tilim=10;

    regards


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 3.  Re: Large difference in solving time while using flow control

    Posted 10/17/15 05:13 AM

    Originally posted by: Hihi15


    Hi Alex, 

    Thank you for your response! I'm aware of setting a time limit to control solving time.

    However, if there is a problem this time limit only masks the problem and does not provide a real solution.

    I was thinking of that my flow control contains errors. Or maybe there is a way to advance solving time by exchanging information on the instances, since they're very similar and thus to prevent repetition.

    By the way, how can you retrieve the current MIP gap if the time limit is applied?


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 4.  Re: Large difference in solving time while using flow control

    Posted 10/17/15 07:14 AM

    Hi,

    you may change your model incrementally with setUB.

    You may use mip start in order to start from previous solution.

    To get the gap you may use getObjValue and getBestObjValue on IloCplex

    regards


    #DecisionOptimization
    #OPLusingCPLEXOptimizer