Decision Optimization

Decision Optimization

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

 View Only
  • 1.  Cplex vs Gurobi

    Posted Mon June 22, 2015 02:01 AM

    Originally posted by: bioinfor


      I have a mixed integer problem (in lp format, see the attached file), I can solve it with Cplex, and I get the best objective value as 0. But when I solve it with Gurobi, I get the objective value as -485.7. I don't know which one is correct, please check it for me. Is academic Cplex limited in function for large scale MIP ?


    #DecisionOptimization
    #MathematicalProgramming-General


  • 2.  Re: Cplex vs Gurobi

    Posted Mon June 22, 2015 08:11 AM

    The functionality of academic CPLEX is not limited in any way.

    I think what you are observing here are just numerical issues. With presolve disabled and all tolerances cranked up I can find a solution with objective value -1000.

    Your model file looks a little odd since most coefficients are 1 or 1000, but there are also coefficients like 0.6126000000000000334 or 0.21510000000000001341. Are you sure your data is correct? Could it be that there are some round-off errors in your model file?

    Do you happen to know what the actual optimal solution is to your model?


    #DecisionOptimization
    #MathematicalProgramming-General


  • 3.  Re: Cplex vs Gurobi

    Posted Tue June 23, 2015 05:01 AM

    Originally posted by: bioinfor


    Thank you.

    My data is correct.

    No round-off errors in my model file.

    I don't know what the actual optimal solution is to my model.


    #DecisionOptimization
    #MathematicalProgramming-General


  • 4.  Re: Cplex vs Gurobi

    Posted Sat July 04, 2015 12:05 AM

    Originally posted by: EdKlotz


    I believe the correct optimal objective value is the one Daniel mentioned of -1000.   You can obtain it by setting CPLEX's presolve reduce parameter to 1 to do only primal reductions.   The accuracy of that solution looks reasonable:

     

    CPLEX> d sol qu
    Incumbent solution:
    MILP objective                                -1.0000000000e+03
    MILP solution norm |x| (Total, Max)            4.67843e+04  1.00000e+03
    MILP solution error (Ax=b) (Total, Max)        7.38863e-12  3.60495e-12
    MILP x bound error (Total, Max)                1.88980e-08  5.32962e-09
    MILP x integrality error (Total, Max)          0.00000e+00  0.00000e+00
    MILP slack bound error (Total, Max)            7.44380e-07  2.32831e-07

     

    It looks to me like a dual presolve reduction tightens the model too much.   This could be due to the wide range of coefficients in the model:

    CPLEX> d pr st
    Problem name         : forummodel2.lp
    Objective sense      : Minimize
    Variables            :   21424  [Nneg: 7134,  Fix: 1221,  Box: 2350,
                                     Free: 1190,  Binary: 9521,  Other: 8]
    Objective nonzeros   :       1
    Linear constraints   :   22843  [Greater: 16953,  Equal: 5890]
      Nonzeros           :  100862
      RHS nonzeros       :       2

    Variables            : Min LB: -1000.000        Max UB: 1000.000       
    Objective nonzeros   : Min   : 1.000000         Max   : 1.000000       
    Linear constraints   :
     Nonzeros           : Min   : 5.500000e-05     Max   : 1000.000       
      RHS nonzeros       : Min   : 1.000000         Max   : 1.000000   

     

    Or it could be a bug, although that seems less likely given that both CPLEX and Gurobi appear to miss this best solution running with presolve enabled.

    I will investigate and update this thread.   However, as of now, I recommend you try running CPLEX and Gurobi both with dual presolve reductions disabled and see if that yields consistent results.

     

    More generally, anytime you have two solutions with different objectives that are claimed to be optimal, whether it be for a single solver with different settings or different solvers, try plugging in the solution values of the better solution into the run that resulted in the worse solution.   If you get an infeasible result, you can then use CPLEX's conflict refiner to get an explanation of the infeasibility.   That often sheds light on the issue (although it didn't help here, as feeding the solution with objective -1000 into CPLEX with default settings resulted in acceptance of that solution.


    #DecisionOptimization
    #MathematicalProgramming-General