Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  weird behavior

    Posted 11/07/11 12:12 PM

    Originally posted by: MichaelPoss


    Hi,

    I encounter the following behavior with cplex 12.2 concert technology for the Java interface:

    cplex.solve();
    System.out.println(cplex.getObjValue()); => return a value of 1
    cplex.exportModel("test.lp");
    cplex.importModel("test.lp");
    cplex.solve();
    System.out.println(cplex.getObjValue()); => return a value of -2.667137344314341E-17

    Any idea how this happens ?

    Best,

    Michael.
    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: weird behavior

    Posted 11/07/11 05:55 PM

    Originally posted by: SystemAdmin


    The LP file format is a ASCII based text format, that may not preserve the complete numerical precision of a model which has coefficients with a large number of decimal places. A SAV file on the other hand is a binary representation of the model in the memory and hence almost an exact copy of the underlying model. You may want to export and import your model in the SAV format and then see if the objective values are the same. If they are, then it looks like your model solve is being affected by truncation/rounding of co-efficients in the higher decimel orders (16th place or more). The code with the change could look like the following:

    cplex.solve();
    System.out.println(cplex.getObjValue()); 
    cplex.exportModel("test.sav");
    cplex.importModel("test.sav");
    cplex.solve();
    System.out.println(cplex.getObjValue());
    

    #CPLEXOptimizers
    #DecisionOptimization


  • 3.  Re: weird behavior

    Posted 11/08/11 04:11 AM

    Originally posted by: MichaelPoss


    Thanks, this seems to be the reason !

    Michael.
    #CPLEXOptimizers
    #DecisionOptimization