Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  Catching the incumbent solution

    Posted 09/18/18 03:53 PM

    Originally posted by: Allexandre


    Hello! 

     

    I have a MILP model which is NP-Hard. I would like to stop it after some execution time or when it reaches some gap (i.e., 5% far from opt). After this, I would like to catch the incumbent solution (basic variables values, o.f. value, etc)

     

    How can I do this?

     

    Thanks!


    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: Catching the incumbent solution

    Posted 09/19/18 04:01 AM
    1. Set the appropriate parameters (CPX_PARAM_TILIM, CPX_PARAM_EPGAP, ...) to allow CPLEX to terminate the solve prematurely.
    2. When the solve returns use the standard functions to query the solution. They will return information for the best solution found so far (aka the incumbent).

    #CPLEXOptimizers
    #DecisionOptimization


  • 3.  Re: Catching the incumbent solution

    Posted 09/19/18 04:27 PM

    Originally posted by: Allexandre


    Hello Daniel!

    Thanks for these first clarifications. I'm programming with C++ and object-oriented (OO).

    1. Then, where and how should I define these two parameters (TILIM and EPGAP)? If I understood right, the CPLEX will check them automatically, right? 
    2. Which commands do I have to use to retrieve the incumbent solution?

    Thanks,

    Allexandre.


    #CPLEXOptimizers
    #DecisionOptimization


  • 4.  Re: Catching the incumbent solution

    Posted 09/21/18 06:58 AM

    Did you check the many examples that ship with CPLEX? They should have answers to all your questions.


    #CPLEXOptimizers
    #DecisionOptimization


  • 5.  Re: Catching the incumbent solution

    Posted 10/15/18 09:40 AM

    Originally posted by: Allexandre


    Hello Daniel,

    Thanks for the explanation. I foud these two commands

    1. setParam(IloCplex::TiLim,5);     //define the time limit 5 seconds
    2. setParam(IloCplex::EpGap, 0.05); //define the gap to 5%

    The second, automatically returns the imcumbent solution.

    Thanks a lot,

    Allexandre.

     


    #CPLEXOptimizers
    #DecisionOptimization