Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  Cplex : two successive stop criterion

    Posted 07/18/11 08:47 AM

    Originally posted by: biaggi


    Hello everyone,

    I'd like to know if it is possible (and how) to tune Cplex (v 12.1) in order to solve a MIP regarding two successive stop criterion :

    1 - time limit criterion : find the optimum solution for X seconds
    2 - relative MIP gap tolerance criterion : after X seconds, if the optimal solution has not been found, stop the search if a "good" integer solution has been found

    Thanks,
    Olivier Guyon
    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: Cplex : two successive stop criterion

    Posted 07/18/11 10:41 AM

    Originally posted by: John Cui


    It is easy, we have this kind parameters to set time limit and mip gap.
    But we need to know which api are you using?

    John Cui
    #CPLEXOptimizers
    #DecisionOptimization


  • 3.  Re: Cplex : two successive stop criterion

    Posted 07/18/11 11:08 AM

    Originally posted by: biaggi


    I'm running my program under the JRE 1.6.0_24 and I know the two parameters :
    • IloCplex.DoubleParam.TiLim
    • IloCplex.DoubleParam.EpGap

    but I think that I cannot set their values directly because I believe it will not work for my program.

    I mean, if I directly set the EpGap parameter to a specific value, the process will stop as soon as a "good" solution is found but I don't want this.

    I want that: if a "good" solution has been found but the time limit is not reached, keep on looking for the optimal solution. But as soon as a time limit has been reached, keep on searching for a "good" solution (regarding a predefined EpGap value).

    I think (but I'm not sure...) that the only way to do that is to solve my MIP model two times ; once by setting the "TiLim" parameter to a defined value. When the problem is solved or the time limit is reached, I check if it is the optimal solution or if it is a "good" solution. If it is not, I set the EpGap parameter to a precise value and I solve the model a second time.

    Olivier Guyon
    #CPLEXOptimizers
    #DecisionOptimization


  • 4.  Re: Cplex : two successive stop criterion

    Posted 07/18/11 11:22 AM

    Originally posted by: SystemAdmin


    I see two solutions:
    • Use a callback. In a callback (for example MIPCallback or InfoCallback) you can check the elapsed time as well as the quality of the current solution. If your stopping criterion is met then stop optimization from the callback (call abort()). Any kind of complex stopping criterion can be implemented in a callback.
    • Solve the model twice (as you already suggested). First set the time limit and call IloCplex.solve(). When that returns check the quality of the solution. If you want to continue then delete the time limit, change the gap parameter and call IloCplex.solve() again. NOTE: If you don't change the model but only change the parameters then the second solve should start where the first solve stopped. In other words, the solve should just continue with different parameter settings.

    #CPLEXOptimizers
    #DecisionOptimization


  • 5.  Re: Cplex : two successive stop criterion

    Posted 07/19/11 03:03 AM

    Originally posted by: biaggi


    Thank you Daniel, it's perfectly clear!
    #CPLEXOptimizers
    #DecisionOptimization