Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
Expand all | Collapse all

Terminating CPLEX when relative gap remains unchanged for a while

  • 1.  Terminating CPLEX when relative gap remains unchanged for a while

    Posted 01/21/15 02:46 PM

    Originally posted by: saeedmarvi


    Hi all,

    I am using opl and CPLEX to solve an MIP problem. I was wondering if it is possible to ask CPLEX to stop and return the current incumbent solution if the relative MIP gap has not been improved for a specific amount of time or number of iterations? I want CPLEX to stop automatically when this stopping rule is met.

     

    Thanks!


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 2.  Re: Terminating CPLEX when relative gap remains unchanged for a while

    Posted 01/22/15 02:09 AM

    Hi

    yes you can:

    execute

    {

    cplex.nodelim=100;

    cplex.epgap=0.05;

    }

    regards


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 3.  Re: Terminating CPLEX when relative gap remains unchanged for a while

    Posted 01/22/15 10:52 AM

    Originally posted by: saeedmarvi


    Hi Alex,

    Thanks for your response. I know that I can limit the run time, or number of nodes, or number of solutions. But this is not exactly what I want. So I do not want to limit the TOTAL number of nodes. nodelim limits the total number of nodes. I would like CPLEX to stop if for the relative gap has not changed for the LAST n nodes or for the last t seconds regardless of the total number of nodes we have had from time zero.

    Thanks!


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 4.  Re: Terminating CPLEX when relative gap remains unchanged for a while

    Posted 01/23/15 03:19 AM

    Hi

    then I suggest you to write this in a main. (flow control)

    You will write a loop that will call cplex.solve(); with a timelimit and after the solve you check whether the situation improved enough, if yes, go on, if no stop

    regards


    #DecisionOptimization
    #OPLusingCPLEXOptimizer