Decision Optimization

Decision Optimization

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

 View Only
  • 1.  Possible bug in CPLEX

    Posted Thu December 22, 2016 05:14 AM

    Originally posted by: Christian16


    Hi,

     

    I'm working with CPLEX 12.7 in Matlab to solve a MILP.

     

    The Problem:

    I initialize the cplex object and the Model as follows and solve it. The result is not the expected but a valid one. The statusstring is 'integer optimal solution'. Afterwards I want to change the upper bound of x1 (1+e15) in the cplex.Model but confirm the old value with return. Now I solve the same problem again and the result is the expected optimal one. However I solve this MILP with CPLEX 12.6 and 12.7 and different Matlab versions the results are the same.

    I tried to disable the aggregator (CPX_PARAM_AGGIND) and I changed the mipgap tolerances but without success.

    Is there anyone who can confirm the bug or has ideas to solve the bug?

     

    sense: 'minimize'

    obj: [-1, 1, 1, 1, 1, 1, 1]

    lb: [0, 0, 0, 0, 0, 0, 0]

    ub: [1e+15, 1, 1, 1, 1, 1, 1]

    A: [0, 1, 1, 1, 1, 1, 1]

    lhs: [1]

    rhs: [6]

    ctype 'CBBBBBB'

     

    unexpected result: [1e+15, 1, 1, 1, 1, 1, 1]

    expected result: [1e+15, 1, 0, 0, 0, 0, 0]


    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: Possible bug in CPLEX

    Posted Mon January 02, 2017 02:22 AM

    Originally posted by: BoJensen


    This does look odd. Could you please try to :

     

    1) Relace the 1.0e+15 with 'Inf', which I assume is the value you wish to use.

    2) Write out the model as a .sav file and try to reproduce the same behavior by using the interactive command line.


    #CPLEXOptimizers
    #DecisionOptimization


  • 3.  Re: Possible bug in CPLEX

    Posted Tue January 03, 2017 04:26 AM

    Originally posted by: Christian16


    Thank you for your answer.

     

    to 1)

    Don't know why but it does work with Inf.

    Unfortunately it doesn't fix the Problem with 1.0e15. The aim is to reduce the upper bound in further iterations. But now I know that I get the expected result and I can add a few constraints in the A Matrix to limit the upper bound.

     

    to 2)

    I solved the MILP after adding sense, obj, lb etc. in the Command Window. I get the unexpected result.

    I saved the cplex object of the Workspace and solved the MILP in a new Matlab instance after copying the saved object in the Workspace. I get the same unexpected result.


    #CPLEXOptimizers
    #DecisionOptimization


  • 4.  Re: Possible bug in CPLEX

    Posted Tue January 03, 2017 06:28 AM

    Originally posted by: BoJensen


    As said it's not recommended to use such high bounds as 1.0e+15. CPLEX uses internally a higher value for infinity, hence it will consider your 1.0e+15 bound as a real bound (which I can understand is intended in your case). The bound is used for calculations, which can cause numerical issues. In this particular case the variable also has a non zero objective coefficient, hence if it 's set to upper bound the objective contribution is -1.0e+15 and the remaining variables can only contribute with 1 to the objective. When CPLEX solves a MIP it produces a lower and upper bound for the optimal solution. CPLEX will terminate when the gap between the lower and upper bound is below a certain relative level. It's likely this criteria is fulfilled, just by setting the first variable to 1.0e+15. You can try to tighten the relative MIP gap tolerance, which may solve your problem, but you should still avoid this type of formulation.


    #CPLEXOptimizers
    #DecisionOptimization


  • 5.  Re: Possible bug in CPLEX

    Posted Wed January 11, 2017 09:51 AM

    Originally posted by: PierreBonami


    I second Bo's comment that this objective with the unscaled bounds can cause all sort of numerical troubles in many places and should preferably be avoided.

    If you want to hope to get something correct for such a problem, you should definitely set the mip gap tolerances to 0: the solution vector [1e+15, 1, 1, 1, 1, 1, 1]  is correct within our default tolerances.

    Preferably, you can also try to scale variables in the objective.

     

    Unfortunately, it seems that for the trivial example that you provided, even when setting the parameters, we make an incorrect computation early on (that should not hurt with default parameters) and there is no work around by setting CPLEX parameters. If your example is the small version of a bigger model, maybe setting the mip gap tolerances to 0 would work there.

    Sorry about that and thanks for providing us with the simple example! We are working on fixing it.


    #CPLEXOptimizers
    #DecisionOptimization