Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  Cplex Time Limit

    Posted 07/31/10 04:18 PM

    Originally posted by: JFCote


    Hello,

    I have a question concerning the parameter TiLim. I'm solving a MIP with Branch-and-Cut. I have a problem with this parameter as it seems Cplex returns way before the time limit. To know the time my algorithm took I'm doing the following :

    double start_exact = clock();
    ...
    Create model
    cplex.setParam(IloCplex::TiLim, 10800); //Set the time limit to 3 hours
    ...

    cplex.solve()
    double total_time = (clock() - start_exact) / (double)CLOCKS_PER_SEC;

    When Cplex is not able to solve the problem inside 3 hours, the total_time value is typically 10600-1070 but sometimes it goes down to 9900.

    Can somebody tell me how I can make Cplex to run nearer to 10800?

    Thank you very much,

    Jean-François
    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: Cplex Time Limit

    Posted 07/31/10 06:13 PM

    Originally posted by: SystemAdmin


    First, when CPLEX returns prematurely, are you sure it is returning due to the time limit and not something else?

    Second, did you change the ClockType parameter from its default setting to CPU time? I'm not sure how CPLEX asserts the time limit when you have parallel threads running, but it's entirely possible that it applies TiLim to the sum of the CPU times if you use CPU clock rather than wall clock. All I could find in the docs was that CPU is the default for single threads (on platforms that support it, which I take to mean "not Windows") and wall clock is the default for parallel threads.

    /Paul

    Mathematicians are like Frenchmen: whenever you say something to them, they translate it into their own language, and at once it is something entirely different. (Goethe)
    #CPLEXOptimizers
    #DecisionOptimization


  • 3.  Re: Cplex Time Limit

    Posted 07/31/10 06:45 PM

    Originally posted by: JFCote


    Thank you Paul,

    I didn't modify the parameter ClockType and Cplex is single threaded.
    However, I'm asking myself if this is not related to the Sungrid environment I'm working in.
    I think that Cplex is probably right.

    Does Cplex provide the duration at the end of the optimization? This way I can know exactly how much time it took when Cplex is able to solve the problem to optimum.
    Thank you very much,

    Jean-François
    #CPLEXOptimizers
    #DecisionOptimization


  • 4.  Re: Cplex Time Limit

    Posted 07/31/10 08:15 PM

    Originally posted by: SystemAdmin


    > JFCote wrote:
    > Does Cplex provide the duration at the end of the optimization? This way I can know exactly how much time it took when Cplex is able to solve the problem to optimum.

    CPLEX writes details of the solution time to its output stream, but there is no API method (that I'm aware of) to get it.

    /Paul
    #CPLEXOptimizers
    #DecisionOptimization


  • 5.  Re: Cplex Time Limit

    Posted 08/16/10 11:34 AM

    Originally posted by: SystemAdmin


    Instead of using clock() you could use cplex.getCplexTime(). This way you will have the same timings as CPLEX.
    #CPLEXOptimizers
    #DecisionOptimization