Decision Optimization

Decision Optimization

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

 View Only
Expand all | Collapse all

Execution stop before timelimit without proving optimality

Archive User

Archive UserWed January 15, 2014 03:36 AM

  • 1.  Execution stop before timelimit without proving optimality

    Posted Wed January 15, 2014 03:36 AM

    Originally posted by: yokito


    Hello,

     

    I have modelled an knapsack problem. I specified a timelimit of 7200 seconds, but CPLEX stops the execution before reaching the time limite and without proving optimality of the solution.

     

    Elapsed real time = 6863.42 sec. (tree size = 992.69 MB, solutions = 13)
    Nodefile size = 292.79 MB
     921000 745523    98438.9301    18    98428.0000    98446.9649  8920066    0.02%
     922000 746510    98446.9489    18    98428.0000    98446.9646  8930632    0.02%
     923000 747502    98446.8391    18    98428.0000    98446.9643  8941306    0.02%
    *923905+648191                        98438.0000    98446.9642  8947758    0.01%

    Cover cuts applied:  5
    Gomory fractional cuts applied:  3

    Root node processing (before b&c):
      Real time             =    1.50
    Sequential b&c:
      Real time             = 6872.95
                              -------
    Total (root+branch&cut) = 6874.45 sec.

      Cplex_Total_time_program = 6874.625000
      Total_time_program_of_all = 6874.625000

     

    Any help? Gap= 0.000091

     

    Although the UB are floats, since we use integer for parameters it should be integer too. Any CPLEX option to take this into account for improving the execution?

     

    Thanks in advance.


    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: Execution stop before timelimit without proving optimality

    Posted Wed January 15, 2014 04:24 PM

    Did you change the convergence tolerances? The defaults will stop CPLEX if the absolute difference between best node and incumbent is less than 1e-6 or the relative difference (absolute difference divided by absolute value of the integer incumbent) is less than 1e-4. Your relative gap appears to have dropped below 1e-4, which would cause CPLEX to declare victory if you are using the default relative gap.

    "Although the UB are floats, since we use integer for parameters it should be integer too. Any CPLEX option to take this into account for improving the execution?" I'm not sure what you are asking here (specifically, what you mean by "parameters"). Do you mean that the variables are declared integer-valued? Or that the variables are declared integer and the objective coefficients are integer, which means the objective function must be integer?

    Paul

     


    #CPLEXOptimizers
    #DecisionOptimization


  • 3.  Re: Execution stop before timelimit without proving optimality

    Posted Wed January 15, 2014 05:20 PM

    Originally posted by: yokito


    Thanks for your answer.

    With "parameters" I meant the data of the problem. The problem instance are all integers and since it is a knapsack problem the objective value is all interger too.

    Or that the variables are declared integer and the objective coefficients are integer, which means the objective function must be integer?

    Yes, I meant that.

    Are there any option for considering taking advance of this feature and include it to CPLEX?


    #CPLEXOptimizers
    #DecisionOptimization


  • 4.  Re: Execution stop before timelimit without proving optimality

    Posted Wed January 15, 2014 05:27 PM

    I think I read someplace that CPLEX has some intrinsic ability to recognize an integer-valued objective function in a MIP model, but I won't swear to that.

    In any case, there is a parameter called the "absolute objective difference cutoff" (ObjDif in the C++, Java and .NET APIs) that will do what you want. It essentially says that any new incumbent must have an objective value better than the current incumbent's objective value by at least ObjDif. The default is zero, but if you set it to something like 0.99, then a new integer-feasible solution with objective value 98438 will let CPLEX prune any node whose bound is not at least 98438.99.


    #CPLEXOptimizers
    #DecisionOptimization


  • 5.  Re: Execution stop before timelimit without proving optimality

    Posted Thu January 16, 2014 01:45 PM

    Originally posted by: yokito


    Thanks!

    Also, I am having the problem of "There may be further error information in the clone logs." 

    cplex.exportModel("model.lp");
       cplex.setParam(IloCplex::TiLim, 7200);    // 2 horas de límite
    cplex.setParam(IloCplex::EpGap,0.000000001); 
     
    cplex.setParam(IloCplex::MIPDisplay,2);    // display every MIPInterval nodes
    cplex.setParam(IloCplex::MIPInterval,1000); // display interval
    cplex.setParam(IloCplex::WorkMem,700);    // set working memory to 1.5GB
    cplex.setParam(IloCplex::VarSel,3);        // use strong branching
    cplex.setParam(IloCplex::NodeFileInd,2); 
    cplex.setParam(IloCplex::ParallelMode,-1); // use parallel '-1: opportunistic' mode. 0: authomatic
    cplex.setParam(IloCplex::MIPEmphasis, IloCplex::MIPEmphasisOptimality);
     

    cplex.solve();

     

    Any idea why?

     

    Thanks in advance


    #CPLEXOptimizers
    #DecisionOptimization


  • 6.  Re: Execution stop before timelimit without proving optimality

    Posted Thu January 16, 2014 03:37 PM

    Not a clue. Is CPLEX throwing an exception?


    #CPLEXOptimizers
    #DecisionOptimization


  • 7.  Re: Execution stop before timelimit without proving optimality

    Posted Sat January 18, 2014 05:35 AM

    Originally posted by: yokito


    I have seen the windows dos windows and I have a out of memory message. Thats why there is a problem with clone logs. I do not understand why, because I tested in two computers and monitored the RAM memory reaching at most 1.5GB of RAM

    Computer 1: Windows 7, 16GB of RAM, 500GB of disk and CPU i7

    Computer 2: Windows xp, 4GB of RAM, 500GB of disk and CPU i3.

     

    The CPLEX program is compiled in C++ under the computer with windows 7 with 4GB (my laptop).

     

    Do I should include another further option?

    Thanks


    #CPLEXOptimizers
    #DecisionOptimization


  • 8.  Re: Execution stop before timelimit without proving optimality

    Posted Sat January 18, 2014 10:19 AM

    C++ is infamous for memory leaks (among other evils). Also, bear in mind that Windows caps the amount of memory allocated to any process. On Computer 2, I'm pretty sure that means that your program is limited to at most 2GB of RAM. I'm not sure what the limit on Computer 1 is, but I imagine that with some effort (and some help from Google) you can find out.

    Assuming that this is not a memory leak (and, again, with C++ that's a bold assumption), you can try turning on the CPLEX memory emphasis parameter (MemoryEmphasis) and see if that helps. On Computer 1, at least, you can try increasing the working memory CPLEX uses (WorkMem parameter, default 2 GB) and/or have CPLEX write the node file to disk (set the NodeFileInd parameter to 2 or 3).

    Paul


    #CPLEXOptimizers
    #DecisionOptimization


  • 9.  Re: Execution stop before timelimit without proving optimality

    Posted Fri January 17, 2014 07:51 AM

    What does cplex.getStatus() and cplex.getCPLEXStatus() return in this case?

    Also, did you check the clone logs? They are called cloneXX.log where XX is a number. If you don't get any clone logs then try setting parameter IloCplex::CloneLog to 1.


    #CPLEXOptimizers
    #DecisionOptimization


  • 10.  Re: Execution stop before timelimit without proving optimality

    Posted Fri January 17, 2014 06:17 PM

    Originally posted by: yokito


    Thanks for your answer. With  IloCplex::CloneLog to 1. CPLEX creates two clone logs. And they are almost empties.

     

     
    Log for 'IloCplex' Clone_0 (V12.3.0.0) Fri Jan 17 22:56:53 2014
     
    Began writing nodes to disk (directory ./cpxa00756 created)

     

    Log for 'IloCplex' Clone_1 (V12.3.0.0) Fri Jan 17 22:56:53 2014

     

    The CPLEX run last 740 secs.

     

    Same problem "There may be further error information in the clone logs." Right now I am running CPLEX with these parameters:

    cplex.exportModel("model.lp");
       cplex.setParam(IloCplex::TiLim, 7200);  
    cplex.setParam(IloCplex::EpGap,0.000000001); 
    cplex.setParam(IloCplex::MIPDisplay,2);    
    cplex.setParam(IloCplex::MIPInterval,1000);
    cplex.setParam(IloCplex::NodeFileInd,2); 
    cplex.setParam(IloCplex::CloneLog,1);
    cplex.setParam(IloCplex::WorkMem,700); 

     

    I have tested in two different computers; i7 16GB of RAM and i3 4GB of RAM. Also I monitored the task manager and at most it uses 1400MB of RAM. For the first computer it last longer than for the second.

    Any idea?

     

    Edit: An output of an instance

    Elapsed real time = 1710.34 sec. (tree size = 927.88 MB, solutions = 16)
     1471000 870490    86099.2184    18    86090.0000    86099.5000  6624058    0.01%
     1472000 871054    86097.8247    18    86090.0000    86099.5000  6627407    0.01%
     1473000 871575    86097.3924    18    86090.0000    86099.5000  6630987    0.01%
     1474000 872110    86096.6553    18    86090.0000    86099.5000  6633980    0.01%
     1475000 872618    86095.0103    18    86090.0000    86099.5000  6637327    0.01%
     1476000 873145    86095.1012    18    86090.0000    86099.5000  6640347    0.01%
     1477000 873696    86093.4791    18    86090.0000    86099.5000  6643680    0.01%
     1478000 874257    86095.7732    18    86090.0000    86099.5000  6646800    0.01%
     1479000 874761        cutoff          86090.0000    86099.5000  6650184    0.01%
     1480000 875306    86094.7186    18    86090.0000    86099.5000  6653284    0.01%
    Elapsed real time = 1720.83 sec. (tree size = 935.34 MB, solutions = 16)
     1481000 875857    86092.9557    18    86090.0000    86099.5000  6656778    0.01%
     1482000 876385    86092.7489    18    86090.0000    86099.5000  6659803    0.01%
     1483000 876891    86097.1146    18    86090.0000    86099.5000  6663341    0.01%
     1484000 877442    86097.5438    17    86090.0000    86099.5000  6666470    0.01%
     1485000 877985    86098.8071    18    86090.0000    86099.5000  6669419    0.01%

    There may be further error information in the clone logs.

     

    In this case the UB is always the same, but for other problem instances stops with clone log problem and the UB are not the same. Like here:

     3241000 2093423    73792.2040    18    73778.0000    73796.4387 14163093    0.02%
     3242000 2093986    73792.5562    18    73778.0000    73796.4385 14167457    0.02%
     3243000 2094540        cutoff          73778.0000    73796.4385 14171989    0.02%
     3244000 2095127    73794.9918    17    73778.0000    73796.4383 14176025    0.02%
     3245000 2095686    73790.9990    18    73778.0000    73796.4380 14180594    0.02%
     3246000 2096261    73793.7854    18    73778.0000    73796.4380 14184540    0.02%
     3247000 2096814    73790.1448    18    73778.0000    73796.4378 14189048    0.02%
     3248000 2097401    73793.9386    18    73778.0000    73796.4376 14193096    0.02%
     3249000 2097965    73790.1295    18    73778.0000    73796.4375 14197362    0.02%
     3250000 2098528    73794.5709    18    73778.0000    73796.4374 14201354    0.02%
    Elapsed real time = 3168.53 sec. (tree size = 1867.40 MB, solutions = 12)
    Nodefile size = 913.52 MB
     3251000 2099068    73789.3718    18    73778.0000    73796.4372 14205658    0.02%
     3252000 2099631    73793.4042    18    73778.0000    73796.4370 14209805    0.02%
     3253000 2100180    73787.3710    18    73778.0000    73796.4370 14214126    0.02%
     3254000 2100755    73793.3620    18    73778.0000    73796.4368 14218320    0.02%

    There may be further error information in the clone logs.


    #CPLEXOptimizers
    #DecisionOptimization


  • 11.  Re: Execution stop before timelimit without proving optimality

    Posted Sat January 18, 2014 05:35 AM

    Originally posted by: yokito


    I have seen the windows dos windows and I have a out of memory message. Thats why there is a problem with clone logs. I do not understand why, because I tested in two computers and monitored the RAM memory reaching at most 1.5GB of RAM

    Computer 1: Windows 7, 16GB of RAM, 500GB of disk and CPU i7

    Computer 2: Windows xp, 4GB of RAM, 500GB of disk and CPU i3.

     

    The CPLEX program is compiled in C++ under the computer with windows 7 with 4GB (my laptop).

     

    Do I should include another further option?

    Thanks


    #CPLEXOptimizers
    #DecisionOptimization


  • 12.  Re: Execution stop before timelimit without proving optimality

    Posted Mon January 20, 2014 09:16 AM

    Setting WorkMem to 700 MB should start swapping nodes to disk well before you hit any memory limit. Are you running your program as 32bit or 64bit application? Are you using any callbacks or is anything else going on in parallel to the IloCplex::solve() call?

    About that out of memory message in the DOS window: How does that message look like? Does it come from CPLEX or from the runtime system?


    #CPLEXOptimizers
    #DecisionOptimization


  • 13.  Re: Execution stop before timelimit without proving optimality

    Posted Fri January 17, 2014 07:48 AM

    Paul, you are right. CPLEX should recognize that the objective function is integral and use that information in order to cut off nodes. So there should be no need to set any parameter to take advantage of the fact that the objective function is integer.


    #CPLEXOptimizers
    #DecisionOptimization