Switch off Crossover: What am I doing wrong?

857 views
Skip to first unread message

Sven Krumke

unread,
Sep 29, 2015, 2:11:01 AM9/29/15
to Gurobi Optimization
I am trying to solve the LP-relaxation of a large MIP (linear) and found out that barrier seems to work quite fast. The log seems to indicate that barrier solves the problem within less than a minute or so. However, the crossover takes forever. Since I am not interested in a basic solution, I would like to disable the crossover procedure. My python code snipped looks like this:

MWCP.Params.TimeLimit = SINGLETIMELIMIT
MWCP.update()
MWCP.Params.Crossover = 0
MWCP.update()
MWCP.optimize()

However, the log seems to indicate that still the crossover is carried out (and it still takes forever). What am I doing wrong? Or, what am I missing?

Thanks,
Sven

-------gurobi.log---
[...]
Optimize a model with 2097151 rows, 1572863 columns and 4718588 nonzeros

Coefficient statistics:

  Matrix range    [1e+00, 1e+00]

  Objective range [1e+00, 1e+02]

  Bounds range    [1e+00, 1e+00]

  RHS range       [1e+02, 1e+02]


Concurrent LP optimizer: primal simplex, dual simplex, and barrier

Showing barrier log only...


Presolve time: 2.18s

Presolved: 2097151 rows, 1572863 columns, 4718588 nonzeros


Ordering time: 0.71s


Barrier statistics:

 AA' NZ     : 6.291e+06

 Factor NZ  : 4.599e+07 (roughly 2.0 GBytes of memory)

 Factor Ops : 4.058e+09 (less than 1 second per iteration)

 Threads    : 14


                  Objective                Residual

Iter       Primal          Dual         Primal    Dual     Compl     Time

   0   6.67072631e+05  1.12295387e+08  4.02e+05 6.34e+00  6.89e+01     6s

   1   2.06553181e+04  1.81161629e+07  4.11e+04 7.11e-14  7.20e+00     7s

   2   2.77672034e+02  1.50449429e+05  9.47e+01 9.95e-14  3.64e-02     9s

   3   1.23091947e+02  2.91936066e+04  1.06e+00 5.68e-14  5.58e-03    11s

   4   1.57090008e+02  7.34431377e+02  6.34e-09 7.11e-14  1.10e-04    13s

   5   2.35501536e+02  2.83398322e+02  3.90e-10 2.84e-14  9.14e-06    14s

   6   2.52473992e+02  2.58348119e+02  4.09e-10 2.84e-14  1.12e-06    15s

   7   2.54382377e+02  2.55781139e+02  2.38e-09 4.26e-14  2.67e-07    17s

   8   2.54944117e+02  2.55124319e+02  3.97e-10 2.84e-14  3.44e-08    18s

   9   2.54991009e+02  2.54994101e+02  5.73e-11 4.26e-14  5.90e-10    20s

  10   2.54991879e+02  2.54991882e+02  1.31e-10 4.26e-14  5.94e-13    22s

  11   2.54991879e+02  2.54991882e+02  5.25e-10 2.84e-14  5.65e-13    23s

  12   2.54991879e+02  2.54991882e+02  6.07e-10 4.26e-14  4.88e-13    25s


Barrier solved model in 12 iterations and 25.28 seconds

Optimal objective 2.54991879e+02


Crossover log...


  532479 DPushes remaining with DInf 0.0000000e+00                28s

  341915 DPushes remaining with DInf 0.0000000e+00             20482s

  246235 DPushes remaining with DInf 0.0000000e+00             35020s


Stopped in 292617 iterations and 36000.06 seconds

Time limit reached

Sonja Mars

unread,
Sep 29, 2015, 2:37:34 AM9/29/15
to gur...@googlegroups.com
Hi,

You are using our concurrent optimizer:

> Concurrent LP optimizer: primal simplex, dual simplex, and barrier
>
> Showing barrier log only...

If you set method=2 (only use barrier) then crossover=0 will turn off crossover. For our concurrent optimizer the results of the three algorithms running currently need to be comparable, this is why you cannot turn off crossover.

Best regards,
Sonja

-----------------------------------------------------------------
Dr. Sonja Mars
Gurobi Optimization






Sven Krumke

unread,
Sep 29, 2015, 8:20:06 AM9/29/15
to Gurobi Optimization
Thanks for the reply. However, it seems I am just too stupid to get things working. I set

MWCP.Params.method   =  2
MWCP.Params.Crossover = 0
MWCP.update()
MWCP.optimize()

in my Python code, but still the log looks like this:

Deterministic concurrent LP optimizer: primal simplex, dual simplex, and barrier

Showing barrier log only...


Presolved: 2097151 rows, 1572863 columns, 4718588 nonzeros


Root barrier log...


Ordering time: 0.70s


Barrier statistics:

 AA' NZ     : 6.291e+06

 Factor NZ  : 4.599e+07 (roughly 2.0 GBytes of memory)

 Factor Ops : 4.058e+09 (less than 1 second per iteration)

 Threads    : 14


                  Objective                Residual

Iter       Primal          Dual         Primal    Dual     Compl     Time

   0   6.67072631e+05  1.12295387e+08  4.02e+05 6.34e+00  6.89e+01    14s

   1   2.06553181e+04  1.81161629e+07  4.11e+04 7.11e-14  7.20e+00    15s

   2   2.77672034e+02  1.50449429e+05  9.47e+01 9.95e-14  3.64e-02    17s

   3   1.23091947e+02  2.91936066e+04  1.06e+00 5.68e-14  5.58e-03    19s

   4   1.57090008e+02  7.34431377e+02  6.34e-09 7.11e-14  1.10e-04    20s

   5   2.35501536e+02  2.83398322e+02  3.90e-10 2.84e-14  9.14e-06    22s

   6   2.52473992e+02  2.58348119e+02  4.09e-10 2.84e-14  1.12e-06    23s

   7   2.54382377e+02  2.55781139e+02  2.38e-09 4.26e-14  2.67e-07    24s

   8   2.54944117e+02  2.55124319e+02  3.97e-10 2.84e-14  3.44e-08    26s

   9   2.54991009e+02  2.54994101e+02  5.73e-11 4.26e-14  5.90e-10    27s

  10   2.54991879e+02  2.54991882e+02  1.31e-10 4.26e-14  5.94e-13    29s

  11   2.54991879e+02  2.54991882e+02  5.25e-10 2.84e-14  5.65e-13    31s

  12   2.54991879e+02  2.54991882e+02  6.07e-10 4.26e-14  4.88e-13    33s


Barrier solved model in 12 iterations and 32.93 seconds

Optimal objective 2.54991879e+02



Root crossover log...


 1563663 variables added to crossover basis                       35s


  532479 DPushes remaining with DInf 0.0000000e+00                37s

[...]


It seems the concurrent optimizer is still running. Where did I goof?


Thanks,

Sven

Sonja Mars

unread,
Sep 30, 2015, 3:44:32 AM9/30/15
to gur...@googlegroups.com
Hi Sven,

This is strange, I don't see what you are doing wrong. Can you post the complete log? Normally there would be something like this in the log:

Changed value of parameter Method to 2
Prev: -1 Min: -1 Max: 4 Default: -1

By the way, there is no need to call update() right before optimize(). optimize() will do this for you.

Thanks and best regards,
Sonja

-----------------------------------------------------------------
Dr. Sonja Mars
Gurobi Optimization
ma...@gurobi.de
-----------------------------------------------------------------
Gurobi Optimizer 6.0 — State-of-the-art performance and best-in-class support
for your most important problems. Learn more at www.gurobi.com.
> --
>
> ---
> You received this message because you are subscribed to the Google Groups "Gurobi Optimization" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to gurobi+un...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

T.

unread,
Sep 30, 2015, 5:21:03 AM9/30/15
to Gurobi Optimization
I think I once read one cannot disable crossover completely as some kind of posrprocessing or so has to happen. But maybe, I am confusing this with something else.

Sonja Mars

unread,
Oct 1, 2015, 1:49:54 AM10/1/15
to gur...@googlegroups.com
Hi T. ,

If you are just solving an LP, you can disable crossover completely, maybe you are thinking of something else.

Best regards,
Sonja

> On 30 Sep 2015, at 11:18, T. <luft...@gmail.com> wrote:
>
> I think I once read one cannot disable crossover completely as some kind of posrprocessing or so has to happen. But maybe, I am confusing this with something else.
>

Sven Krumke

unread,
Oct 1, 2015, 2:14:17 AM10/1/15
to Gurobi Optimization
Dear Sonja,

thanks for the help. Strangely enough, it now seems to work! I have moved bits of code into a subroutine and miraculously things seem to work now. I have absolutely NO idea why. Let me investigate the situation and get back to you.

Thanks again!
Reply all
Reply to author
Forward
0 new messages