Decision Optimization

Decision Optimization

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


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

Run Time Discrepancy between the Interactive Solver and Concert Technology

  • 1.  Run Time Discrepancy between the Interactive Solver and Concert Technology

    Posted 05/27/10 05:13 PM

    Originally posted by: Billyswang


    I am using CPLEX Concert Technology Version 11 for C++ to write and solve some MIP modeles and found something very interesting about its performance.

    In one instance, my model was solved in about 80 seconds in Concert Technology and I thought it was quick. But when I ran the same model in the Interactive solver (version 11 of course), it only took 2 seconds.

    So I threw a bigger problem in Concert Technology, which didn't find an optimal solution in 20 minutes while the Interactive solver only took two minutes to get the optimal solution.

    This comparsion was done in the context that the CPLEX parameter settings are the same in Concert Technology and in the Interactive solver.

    I am just very curious about the reasons for this difference? And how can I improve the run time performance in Concert Technology to the extent that the Interactive solver can? would appreciate if any ideas on this would be shared.

    Thanks,

    Billy
    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: Run Time Discrepancy between the Interactive Solver and Concert Technology

    Posted 05/28/10 02:54 AM

    Originally posted by: RWunderling


    Billy,

    this looks suspicious. As a first step, I suggest you turn on logging for both runs and compare the
    resulting logs. This may help you detecting where the difference comes from. If that is inconclusive,
    could you generate an .xml file of your concert model and share it?

    Roland
    #CPLEXOptimizers
    #DecisionOptimization


  • 3.  Re: Run Time Discrepancy between the Interactive Solver and Concert Technology

    Posted 06/01/10 10:42 AM

    Originally posted by: Billyswang


    Roland,

    I checked the log file and it seems that the discrepancy starts after root relaxation, in working on the first node (Node 0) in particular.

    I can export the model to .sav file or .lp file and share. Do you think these files would provide the same information for you to look into as a .xml file, or it has to be a .xml file?

    Let me know,

    Thanks,

    Billy
    #CPLEXOptimizers
    #DecisionOptimization


  • 4.  Re: Run Time Discrepancy between the Interactive Solver and Concert Technology

    Posted 06/08/10 02:50 AM

    Originally posted by: RWunderling


    Billy,

    I'm afraid we need to take a look at the .xml file to understand what may be going wrong. Is it possible provide this file? You can create it with the following code:
    IloModel model(env);
     
          IloXmlContext xml(env);
          if ( !xml.readModel(model, "tmp.xml") ) {
             env.error() << "Failed to read model" << endl;
             throw(-2);
          }
          xml.end();
    


    Thanks,

    Roland
    #CPLEXOptimizers
    #DecisionOptimization


  • 5.  Re: Run Time Discrepancy between the Interactive Solver and Concert Technology

    Posted 06/08/10 05:31 AM

    Originally posted by: RWunderling


    Sorry, wrong copy/paste: Make that
    xml.writeModle(model, "tmp.xml");
    


    Roland
    #CPLEXOptimizers
    #DecisionOptimization


  • 6.  Re: Run Time Discrepancy between the Interactive Solver and Concert Technology

    Posted 05/28/10 04:37 AM

    Originally posted by: SystemAdmin


    How exactly did you export your model and load into the CPLEX interactive optimizer? Note that exporting to an .lp or .mps file will potentially change the order of columns and rows when loaded back into CPLEX. Permuting columns and/or rows can have a significant random effect on the solving time on individual models.

    If possible, could you please try this exercise to compare Concert vs. CPLEX interactive on a larger number of models? If you see that Concert is consistently or almost consistently slower on, say, 10 models than there must be something strange going on. If you find out that half of the models solve faster and the other half solves slower in Concert, this would point to random variation due to the reordering of columns and rows.
    Tobias
    #CPLEXOptimizers
    #DecisionOptimization


  • 7.  Re: Run Time Discrepancy between the Interactive Solver and Concert Technology

    Posted 06/01/10 10:36 AM

    Originally posted by: Billyswang


    Tobias,

    I exported the model to a .lp file using the cplex.exportModel method and then let the Interactive read in the .lp file.

    Your point makes a lot of sense. But is there any way for me to export the model to Interactive without re-permuting the columns and rows? And, if the orders of a model's columns and rows have an impact on the solver's runtime, then does CPLEX provide a capability for a modeler to optimize/fine-tune these orders?

    Thanks,

    Billy
    #CPLEXOptimizers
    #DecisionOptimization


  • 8.  Re: Run Time Discrepancy between the Interactive Solver and Concert Technology

    Posted 06/01/10 10:46 AM

    Originally posted by: SystemAdmin


    Hi Billy,

    just use the .sav format instead of the .lp format. This is a binary file format (i.e., it is not human readable), and it stores the problem data exactly bit by bit. So you are not implicitly reordering columns and rows, and you are also not losing any precision in the floating point numbers (which you do with .lp and .mps formats).

    The order of rows and columns makes a difference in the solver's runtime, but it has a pretty random effect. Therefore, there is no algorithm to find a "best" order for a given model. The reason why the order affects the performance is subtle: many decisions in CPLEX are heuristics that rely on results of floating point calculations. For example, the variable selection for branching is something like this:

    double bestscore = 0.0;
    int bestj = -1;
    for (j = 0; j < cols; j++) {
       double score = calcBranchScore (j);
       if ( score > bestscore ) {
          bestj = j;
          bestscore = score;
       }
    }
    


    It happens very often that variables look identical to such a score function and calcBrancScore(j) returns the same value for multiple columns j. Thus, in this loop one would choose the first column j with maximal score. As a consequence, the order of the column affects the branching choice. And if only a single branching is different, then the number of nodes that need to be processed can change dramatically.
    Tobias
    #CPLEXOptimizers
    #DecisionOptimization


  • 9.  Re: Run Time Discrepancy between the Interactive Solver and Concert Technology

    Posted 06/02/10 11:24 AM

    Originally posted by: Billyswang


    Tobias,

    I exported the model to a .sav file, but it didn't eliminate the performance gap between Concert and Interactive. I am afraid that there may be other reasons. Would memory usage be a possible reason? What I can think of is that CPLEX Concert shares the memory usage with the main application where it is called, while Interactive doesn't. So the memory availablity to Concert would be much less than it to the Interactive. This would make some difference for large-size models, wouldn't it?

    -Billy
    #CPLEXOptimizers
    #DecisionOptimization


  • 10.  Re: Run Time Discrepancy between the Interactive Solver and Concert Technology

    Posted 06/07/10 12:41 PM

    Originally posted by: SystemAdmin


    Did you check that the .sav file gives you the exact same model (apart from permutations) as the Concert model?
    Note that some concert constructs (like min/max functions) cannot be stored in .lp or .sav files. Therefore, it could be that when solving the .sav file, you are actually solving a much simpler version of your model, namely one that does not include the non-linear constraints that you have modeled in concert.

    As a quick check you could verify that the objective values (initial root node objective value, final optimal objective value) are identical.
    Tobias
    #CPLEXOptimizers
    #DecisionOptimization


  • 11.  Re: Run Time Discrepancy between the Interactive Solver and Concert Technology

    Posted 06/10/10 10:37 AM

    Originally posted by: Billyswang


    I checked both log files and it appears that the solving process between concert and interactive is identical, i.e. they explore the same nodes, generate the same cuts and reach the same objective value. The only difference is that Concert takes longer to do the same thing. It remains a mystery why this would happen. However, after I upgraded CPLEX from v11.1 to v12.1, I haven't observed the same situation so far and I am ready to move on and pass this issue.
    #CPLEXOptimizers
    #DecisionOptimization


  • 12.  Re: Run Time Discrepancy between the Interactive Solver and Concert Technology

    Posted 09/27/10 02:00 PM

    Originally posted by: bistra


    Hi, Tobias

    In the previous post you talk about the branch scoring used in CPLEX.

    Is there any API that will allow the direct access to the branch scores computed by CPLEX? (I don't need to know how they are computed, but I want to be able to ask calcBranchScore (j) as in your pseudocode)
    Thanks for your help,
    Bistra
    #CPLEXOptimizers
    #DecisionOptimization


  • 13.  Re: Run Time Discrepancy between the Interactive Solver and Concert Technology

    Posted 09/27/10 07:44 PM

    Originally posted by: SystemAdmin


    No, sorry. There is no way to access the branching scores of the variables.

    Tobias
    #CPLEXOptimizers
    #DecisionOptimization