Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  Negative Gap by CPLEX!

    Posted 12/16/13 01:36 AM

    Originally posted by: Hassan.Hijazi


    Hi, 

     

    I'm getting a negative gap when running the attached nl file with CPLEX.

    In other terms, it is finding a solution better than the lower bound it has during the search.

     

    Kind regards,

    Hassan.


    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: Negative Gap by CPLEX!

    Posted 12/16/13 04:01 PM

    I think you will have better luck getting an answer to this if you post a .sav file (or a .lp file, but .sav is better), rather than a .nl file.

    Paul


    #CPLEXOptimizers
    #DecisionOptimization


  • 3.  Re: Negative Gap by CPLEX!

    Posted 12/16/13 09:35 PM

    Originally posted by: Hassan.Hijazi


    Hi Paul, 

    Thanks for your reply.

    My model is a Second-Order Cone Program, I'm not sure I can save it in a .lp file.

    In fact, I'm using AMPL to write my model, can't write it in a .sav file neither.

    Cheers,

    Hassan,


    #CPLEXOptimizers
    #DecisionOptimization


  • 4.  Re: Negative Gap by CPLEX!

    Posted 12/17/13 10:53 AM

    Hassan,

    I'm not sure which file formats accommodate SOCPs. I know that you can write an MPS file from AMPL. The problem with the .nl file is that cplexamp can read it but the CPLEX interactive optimizer cannot, and cplexamp has no interactive interface AFAIK.

    You might want to search the forum for the phrase "negative gap". I'm sure I've seen at least one or two threads reporting negative gaps, but I can't recall how (or whether) they were resolved.

    Paul

     


    #CPLEXOptimizers
    #DecisionOptimization


  • 5.  Re: Negative Gap by CPLEX!

    Posted 12/17/13 11:35 PM

    Originally posted by: Hassan.Hijazi


    Thanks again Paul, 

    I found a similar post in the forum, the bug appears to be in Cplex's presolve, there is a workaround by setting repeatpresolve to 0.

    Cheers,

    Hassan.


    #CPLEXOptimizers
    #DecisionOptimization


  • 6.  Re: Negative Gap by CPLEX!

    Posted 01/06/14 03:44 AM

    Originally posted by: EhsanN


    Dear Hassan,

    I've faced a relatively similar problem. When I searched the forum for the thread you mentioned, I couldn't find it. Would you please post the link to that thread here. Thanks a lot.

    Bests,

    Ehsan


    #CPLEXOptimizers
    #DecisionOptimization


  • 7.  Re: Negative Gap by CPLEX!

    Posted 02/18/14 07:57 PM

    Originally posted by: EdKlotz


    Hassan,

                     I don't know whether AMPL supports writing out SOCPs in MPS format or not.   But, you can tell CPLEX to write out the model to a MPS,  LP or SAV file by using either the 'file' or 'writeprob' directive among the directives in the cplex_options statement before you instruct AMPL to solve the model.     For example

    ampl: model mymodel.mod;

    ampl: data mymodel.dat;

    ampl: option cplex_options 'writeprob mymodel.sav';

    ampl: solve;

    Once you quit AMPL, you will see the model mymodel.sav in the directory from which you invoked AMPL.Since not everyone in the forum necessarily has AMPL, you may get more responses if you post the file in MPS, LP or SAV format.

    That said, I have generated the SAV file from your .nl file myself and reproduce the behavior with CPLEX 12.6, the latest version.  I'll let you know as soon as I have more information regarding what is happening.

     


    #CPLEXOptimizers
    #DecisionOptimization