Gurobi in MATLAB and Julia behaving differently

62 views
Skip to first unread message

José Alberto Gómez Roldán

unread,
Jan 25, 2017, 9:56:23 AM1/25/17
to Gurobi Optimization
Hi,

I'm using the same version of Gurobi 7.0.1 in Matlab and Julia to solve the same linear programs. However I see the following behavior:

MATLAB:

Warning for adding variables: zero or small (< 1e-13) coefficients, ignored
Optimize a model with 993 rows, 2711 columns and 9732 nonzeros
Coefficient statistics:
  Matrix range     [6e-06, 6e+01]
  Objective range  [1e+00, 1e+00]
  Bounds range     [0e+00, 0e+00]
  RHS range        [3e-02, 1e-01]
Iteration    Objective       Primal Inf.    Dual Inf.      Time
       0    0.0000000e+00   0.000000e+00   1.049820e+03      0s
       9    0.0000000e+00   0.000000e+00   0.000000e+00      0s

Solved in 9 iterations and 0.05 seconds
Optimal objective  0.000000000e+00


Warning for adding variables: zero or small (< 1e-13) coefficients, ignored
Optimize a model with 994 rows, 2711 columns and 9733 nonzeros
Coefficient statistics:
  Matrix range     [6e-06, 6e+01]
  Objective range  [1e+00, 1e+00]
  Bounds range     [0e+00, 0e+00]
  RHS range        [3e-02, 1e-01]
Iteration    Objective       Primal Inf.    Dual Inf.      Time
       0    0.0000000e+00   0.000000e+00   1.000000e+00      0s
    2024   -3.0836977e-03   0.000000e+00   0.000000e+00      0s

Solved in 2024 iterations and 0.14 seconds
Optimal objective -3.083697743e-03

Julia:

Warning for adding constraints: zero or small (< 1e-13) coefficients, ignored
Optimize a model with 993 rows, 2711 columns and 9732 nonzeros
Coefficient statistics:
  Matrix range     [6e-06, 6e+01]
  Objective range  [1e+00, 1e+00]
  Bounds range     [0e+00, 0e+00]
  RHS range        [3e-02, 1e-01]
Iteration    Objective       Primal Inf.    Dual Inf.      Time
       0    0.0000000e+00   0.000000e+00   0.000000e+00      0s

Solved in 0 iterations and 0.00 seconds
Optimal objective  0.000000000e+00

Warning for adding constraints: zero or small (< 1e-13) coefficients, ignored Optimize a model with 994 rows, 2711 columns and 9733 nonzeros Coefficient statistics: Matrix range [6e-06, 6e+01] Objective range [1e+00, 1e+00] Bounds range [0e+00, 0e+00] RHS range [3e-02, 1e-01] Iteration Objective Primal Inf. Dual Inf. Time 0 0.0000000e+00 0.000000e+00 1.000000e+00 0s 2429 -3.0836977e-03 0.000000e+00 0.000000e+00 0s Solved in 2429 iterations and 0.09 seconds Optimal objective -3.083697743e-03

In both cases I'm setting Presolve = 0 and Method = 0 and I'm starting from the same initial primal feasible basis with no artificial variables. Why would Gurobi take a different number of iterations depending on whether you call it from Julia or MATLAB?

Thanks a lot!

Jose A. Gomez

Francesco Solera

unread,
May 30, 2017, 12:29:02 AM5/30/17
to Gurobi Optimization
Hi Jose,
did you ever find out the cause of such discrepancy?
I'm observing something similar between the MATLAB and C++ interfaces...

Thanks,
Francesco

Michael Winkler

unread,
Jun 1, 2017, 11:13:55 AM6/1/17
to Gurobi Optimization
Could you try to write out the MPS files from each APIs and then just check if they are different. I think it is due to Matlab being a matrix based interface which will result in a slightly different model (different order).

Best,
Michael
Reply all
Reply to author
Forward
0 new messages