Different Optimal Solutions (MILP) reached by Gurobi Python and Matlab optimproblem.

221 views
Skip to first unread message

Peter Kim

unread,
Jun 27, 2018, 11:31:33 PM6/27/18
to Gurobi Optimization
Hello All,

I have just finished debugging the constraints to my MILP model using Gurobi and Python.  I have a Matlab solver that solves the same instance of the scheduling problem using a problem based workflow (using the optimproblem object).

My concern here is that Gurobi computes an optimal solution of 26.9118, while Matlab reaches 24.551848.  Is there any explanation for this discrepancy?  Could it be inherent differences in the solvers?  

Thanks in advance for any explanations and help.

-Peter


(here are my outputs)

Gurobi:
Optimize a model with 1048 rows, 636 columns and 11290 nonzeros
Variable types: 0 continuous, 636 integer (0 binary)
Coefficient statistics:
  Matrix range     [6e-01, 8e+01]
  Objective range  [4e-02, 1e+01]
  Bounds range     [1e+00, 1e+00]
  RHS range        [1e+00, 2e+02]
Presolve removed 1021 rows and 604 columns
Presolve time: 0.02s
Presolved: 27 rows, 32 columns, 244 nonzeros
Variable types: 0 continuous, 32 integer (32 binary)
Found heuristic solution: objective 26.9118300

Root relaxation: cutoff, 16 iterations, 0.00 seconds

    Nodes    |    Current Node    |     Objective Bounds      |     Work
 Expl Unexpl |  Obj  Depth IntInf | Incumbent    BestBd   Gap | It/Node Time

     0     0     cutoff    0        26.91183   26.91183  0.00%     -    0s

Explored 0 nodes (16 simplex iterations) in 0.03 seconds
Thread count was 4 (of 4 available processors)

Solution count 1: 26.9118

Optimal solution found (tolerance 1.00e-04)
Best objective 2.691183000000e+01, best bound 2.691183000000e+01, gap 0.0000%
The optimal objective is 26.9118
Freed default Gurobi environment

Matlab:
>> MILP
LP:                Optimal objective value is 24.551848.                                            

Cut Generation:    Applied 4 implication cuts, 6 cover cuts,                                        
                   5 strong CG cuts, and 1 Gomory cut.                                              
                   Lower bound is 26.356185.                                                        

Heuristics:        Found 1 solution using rounding.                                                 
                   Upper bound is 27.551520.                                                        
                   Relative gap is 4.19%.                                                          

Cut Generation:    Applied 1 Gomory cut,                                                            
                   and 2 strong CG cuts.                                                            
                   Lower bound is 26.387100.                                                        
                   Relative gap is 4.08%.                                                          

Branch and Bound:

   nodes     total   num int        integer       relative                                          
explored  time (s)  solution           fval        gap (%)                                         
      31      0.21         2   2.732310e+01   3.304279e+00                                          
      37      0.22         3   2.732310e+01   3.304279e+00                                          
      38      0.23         4   2.732310e+01   3.301537e+00                                          
    2627      1.22         4   2.732310e+01   0.000000e+00                                          

Optimal solution found.

Intlinprog stopped because the objective value is within a gap tolerance of the optimal value, options.AbsoluteGapTolerance = 0
(the default value). The intcon variables are integer within tolerance, options.IntegerTolerance = 1e-05 (the default value).

Robert Luce

unread,
Jun 28, 2018, 12:02:40 AM6/28/18
to Gurobi Optimization
Hello Peter,

are you sure that Matlab's objective value of 24.551848 refers to an optimal integer solution?  From the Matlab log you posted I would conclude that this is the objective value of the LP relaxation, and that Matlab's solution from intlinprog has objective value  27.32310.  But still this value is different from Gurobi's optimal objective value, and an investigation of this discrepancy is worthwhile.

In order to get to the bottom of this it would be great if you could solve your problem from within Matlab using Gurobi's Matlab interface.  If you are currently using Matlab's intlinprog with problem based modelling this is very to achieve:


Could you post the output you are getting from Gurobi in Matlab?

Robert
Reply all
Reply to author
Forward
0 new messages