Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  Binary files

    Posted 05/30/13 03:13 PM

    Originally posted by: gangulo


    Hello,

    I have a question regarding binary files (.sav). I generated an MIP in C++ with integral data (matrix, objective, rhs, bounds). The problem should be very easy to solve (<2 sec), but it was taking too long (>100 sec). When I export it in a sav file and read it in the interactive optimizer, that behavior persists, but exporting an lp file makes the problem easy to solve. Can that be expected from different file formats, even if all underlying data are integral?

    Thanks!


    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: Binary files

    Posted 05/31/13 04:20 AM

    Yes, this may happen since writing out an LP file and reading it back in may change the order of variables in the model. The LP file reader creates variables as it encounters them in the LP file which may result in a different order of variables than in the original model. Can you please check whether the order of variables in LP and SAV file are different? One way to do this would be

    CPLEX> read model.sav
    CPLEX> write sav.rlp
    CPLEX> read model.lp
    CPLEX> write lp.rlp

    and then compare the two rlp files (the RLP file format is the same as the LP file format but with generic variable names). If the order of variables is the same then both RLP files should be the same.


    #CPLEXOptimizers
    #DecisionOptimization


  • 3.  Re: Binary files

    Posted 05/31/13 04:25 PM

    Originally posted by: gangulo


    I don't have the .lp file right now, just the .sav. I did the following

    > read model.sav
    > write model.sav.rlp
    > read model.sav.rlp
    > write model.sav.rlp.rlp

    I thought  model.sav.rlp and model.sav.rlp.rlp were going to be the same, but they are not, is that expected? I see shifted variables when some of them do not appear in the objective function.


    #CPLEXOptimizers
    #DecisionOptimization


  • 4.  Re: Binary files

    Posted 06/03/13 05:06 AM

    Originally posted by: TobiasAchterberg


    The .lp file format does not preserve the ordering of the variables. Thus, if you do

    write model.lp

    read model.lp

    then you will most likely end up with a permuted problem. But if you do

    write model1.lp

    read model1.lp

    write model2.lp

    then model1.lp and model2.lp will be identical.

    In contrast to the .lp file format, the .mps file format does not modify the order of the variables.


    #CPLEXOptimizers
    #DecisionOptimization


  • 5.  Re: Binary files

    Posted 06/03/13 05:09 AM

    Originally posted by: TobiasAchterberg


    And by the way: modifying the order of the variables in the problem is just one way to trigger what we call "performance variability in MIP" (which means getting very different run-time behavior of a MIP solver even though the change to the input data should be irrelevant). Another way is to change the random seed parameter of CPLEX (publicly available since CPLEX 12.5). So, if you want to find out whether your model features a large performance variability, just do something like:

    read model.sav

    set adv 0

    set rand 1

    opt

    set rand 2

    opt

    set rand 3

    opt

    ...

    Then, check the variation of the solve times.

     

    Tobias


    #CPLEXOptimizers
    #DecisionOptimization


  • 6.  Re: Binary files

    Posted 06/04/13 10:15 AM

    Originally posted by: gangulo


    I haven't tried that, but I found what was happening in my case. The problem that I generate internally is modified and reoptimized several times before exporting the .sav file. Well, the binary file contained a basis which for some reason was messing things up, and turning off the use of advance information solved the issue.

    Thanks!


    #CPLEXOptimizers
    #DecisionOptimization