Skip to main content

MIP stuck in branch-and-cut in some situations

Answered

Comments

6 comments

  • Riley Clement
    Gurobi Staff Gurobi Staff

    Hi Sibo,

    I think it would be worth looking at the performance variance for a single model first.  I.e. for the last model, run it 30 times, each with a different value of Seed, and make sure the logs are written to file.

    You can then "grep" the resulting log(s) for "Explored" to get a quick idea of the seconds used in each solve, or alternatively use gurobi-logtools to read the logfiles and create pandas dataframes rich in information.

    - Riley

    0
  • Sibo Li
    First Comment
    First Question

    Thanks a lot, Riley,
    I have been trying multiple times for one instance of our model, it seems that whether the problem can be solved is not random, but depends on the specific input of different cases.

    For the logs, they are saved correctly to a file, but in branch-and-cut, it seems that nothing is output both in the file and the command lines. The final few lines of the log are appended:


    Besides, I find that the failed cases have relatively small bounds or optimal values (observed by partial solution in logs). So will that make a difference?

    Sibo Li

        15    32 24799.9682    4 7196 169486.713 24791.8357  85.4%   0.0  274s                                                                                         
    H   31    64                    136322.17166 24799.9682  81.8%   0.0  369s                                                                                         
    H   33    64                    123059.49567 24799.9682  79.8%   0.0  369s
    H   47    64                    114344.29144 24799.9682  78.3%   0.0  369s
    ^C
    Interrupt request received
        63    96 24826.9363    6 7193 114344.291 24812.8423  78.3%   0.0 1144s

    Cutting planes:
      Implied bound: 68
      Projected implied bound: 19
      MIR: 210
      Flow cover: 790
      RLT: 69
      Relax-and-lift: 12
      BQP: 56
      PSD: 1

    Explored 95 nodes (0 simplex iterations) in 1144.80 seconds (488.46 work units)
    Thread count was 32 (of 64 available processors)

    Solution count 6: 114344 123059 136322 ... 515984
    0
  • Riley Clement
    Gurobi Staff Gurobi Staff

    Hi Sibo,

    The choice of Crossover=0 and NodeMethod=2 is an interesting one.  Do the simplex algorithms fail terribly on this model?

    - Riley

    0
  • Sibo Li
    First Comment
    First Question

    Hi Riley,
    Thanks for reminding me that, actually Crossover=0 is set as I copied the parameters from another problem, where crossover takes too much time.  I have tried enabling crossover and that helps to give a better dual bound and get a better solution.

    However, the solution does not converge yet. Will there be some other parameters that helps generate a better solution?

    Thanks a lot!

    Sibo Li
    The log is attached here.

    CPU model: AMD Ryzen Threadripper 2990WX 32-Core Processor, instruction set [SSE2|AVX|AVX2]

    Thread count: 32 physical cores, 64 logical processors, using up to 32 threads

    Academic license 2426991 - for non-commercial use only - registered to li___@mails.tsinghua.edu.cn

    Optimize a model with 555812 rows, 542247 columns and 1156717 nonzeros

    Model fingerprint: 0xf9591bf0

    Model has 440287 quadratic constraints

    Model has 998 general constraints

    Variable types: 111111 continuous, 431136 integer (431136 binary)

    Coefficient statistics:

    Matrix range     [2e-01, 1e+00]

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

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

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

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

      RHS range        [2e-03, 2e+03]

    Presolve added 476879 rows and 373439 columns

    Presolve time: 1.38s

    Presolved: 1089650 rows, 931622 columns, 2433876 nonzeros

    Variable types: 121349 continuous, 810273 integer (810033 binary)

    Root relaxation presolve removed 47815 rows and 0 columns

    Root relaxation presolved: 121182 rows, 138989 columns, 599392 nonzeros

    Root barrier log...

    Ordering time: 2.93s

    Barrier statistics:

     AA' NZ     : 3.626e+06

     Factor NZ  : 1.403e+07 (roughly 200 MB of memory)

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

     Threads    : 31

                      Objective                Residual

    Iter       Primal          Dual         Primal    Dual     Compl     Time

       0   1.62407985e+05 -5.80517257e+06  1.11e+04 0.00e+00  2.80e+02    14s

       1   7.14118574e+04 -4.73912752e+06  3.38e+03 5.51e-14  8.77e+01    14s

       2   4.24933082e+04 -3.49829370e+06  6.33e+02 7.64e-14  2.19e+01    14s

       3   4.32761778e+04 -1.48320769e+06  1.16e+02 7.86e-14  5.80e+00    15s

       4   3.51255401e+04 -2.74699646e+05  2.72e+01 5.68e-14  1.05e+00    15s

       5   3.16413139e+04 -1.21619624e+05  1.36e+01 2.66e-14  5.02e-01    15s

       6   3.10504039e+04 -8.43870662e+04  9.29e+00 1.95e-14  3.73e-01    15s

       7   3.07055239e+04 -5.56081901e+04  6.00e+00 1.60e-14  2.75e-01    15s

       8   3.06017574e+04 -4.30059186e+03  4.34e+00 1.98e-14  1.12e-01    15s

       9   3.03428283e+04  6.94274367e+03  2.32e+00 2.35e-14  7.42e-02    15s

      10   3.02552179e+04  2.19024667e+04  1.51e+00 1.78e-14  2.68e-02    16s

      11   3.01884377e+04  2.49192606e+04  8.52e-01 2.23e-14  1.68e-02    16s

      12   3.01674918e+04  2.67793641e+04  7.23e-01 1.96e-14  1.09e-02    16s

      13   3.01565325e+04  2.77763405e+04  6.02e-01 2.62e-14  7.72e-03    16s

      14   3.01359694e+04  2.87463465e+04  3.83e-01 1.75e-14  4.53e-03    16s

      15   3.01196445e+04  2.91945054e+04  1.49e-01 1.52e-14  2.94e-03    16s

      16   3.01122517e+04  2.93435812e+04  8.03e-02 1.60e-14  2.41e-03    17s

      17   3.01104657e+04  2.94340663e+04  5.39e-02 1.94e-14  2.11e-03    17s

      18   3.01092692e+04  2.97699403e+04  4.10e-02 2.82e-14  1.07e-03    17s

      19   3.01075776e+04  2.98387513e+04  2.71e-02 3.84e-14  8.44e-04    17s

      20   3.01074455e+04  2.99386768e+04  2.28e-02 3.59e-14  5.33e-04    17s

      21   3.01069566e+04  3.00945433e+04  1.14e-02 2.41e-14  4.52e-05    17s

      22   3.01064806e+04  3.01060608e+04  8.91e-05 2.87e-14  1.34e-06    17s

      23   3.01064676e+04  3.01064672e+04  2.58e-06 2.50e-14  1.35e-09    18s

      24   3.01064676e+04  3.01064676e+04  2.53e-07 5.26e-14  1.03e-14    18s

    Barrier solved model in 24 iterations and 17.74 seconds (16.25 work units)

    Optimal objective 3.01064676e+04

    Root crossover log...

        4459 DPushes remaining with DInf 0.0000000e+00                18s

           0 DPushes remaining with DInf 0.0000000e+00                18s

       60843 PPushes remaining with PInf 0.0000000e+00                18s

       20943 PPushes remaining with PInf 0.0000000e+00                20s

           0 PPushes remaining with PInf 0.0000000e+00                24s

      Push phase complete: Pinf 0.0000000e+00, Dinf 3.8344558e-10     24s

    Root simplex log...

    Iteration    Objective       Primal Inf.    Dual Inf.      Time

       63998    3.0106468e+04   0.000000e+00   0.000000e+00     24s

       63998    3.0106468e+04   0.000000e+00   0.000000e+00     24s

    Root relaxation: objective 3.010647e+04, 63998 iterations, 14.76 seconds (14.25 work units)

    Total elapsed time = 24.48s (DegenMoves)

        Nodes    |    Current Node    |     Objective Bounds      |     Work

     Expl Unexpl |  Obj  Depth IntInf | Incumbent    BestBd   Gap | It/Node Time

         0     0 30106.4676    0 3713          - 30106.4676      -     -  161s

    H    0     0                    512890.75441 30106.4676  94.1%     -  256s

         0     0 30652.0267    0 3055 512890.754 30652.0267  94.0%     -  305s

    H    0     0                    39165.805084 30652.0267  21.7%     -  347s

         0     0 30673.8973    0 3031 39165.8051 30673.8973  21.7%     -  349s

         0     0 30673.8986    0 3026 39165.8051 30673.8986  21.7%     -  350s

         0     0 30941.5909    0 2829 39165.8051 30941.5909  21.0%     -  377s

         0     0 30986.5760    0 2802 39165.8051 30986.5760  20.9%     -  383s

         0     0 30987.0836    0 2798 39165.8051 30987.0836  20.9%     -  384s

         0     0 31156.0703    0 2749 39165.8051 31156.0703  20.5%     -  398s

    H    0     0                    39130.605084 31176.0703  20.3%     -  458s

         0     0 31176.0703    0 2735 39130.6051 31176.0703  20.3%     -  460s

         0     0 31309.7660    0 2704 39130.6051 31309.7660  20.0%     -  465s

         0     0 31316.4326    0 2701 39130.6051 31316.4326  20.0%     -  477s

         0     0 31448.6798    0 2655 39130.6051 31448.6798  19.6%     -  482s

         0     0 31468.8187    0 2652 39130.6051 31468.8187  19.6%     -  487s

         0     0 31468.8643    0 2652 39130.6051 31468.8643  19.6%     -  487s

         0     0 31523.7499    0 2630 39130.6051 31523.7499  19.4%     -  494s

         0     0 31533.7499    0 2630 39130.6051 31533.7499  19.4%     -  496s

         0     0 31548.3720    0 2602 39130.6051 31548.3720  19.4%     -  500s

         0     0 31550.0243    0 2606 39130.6051 31550.0243  19.4%     -  512s

         0     0 31550.0243    0 2604 39130.6051 31550.0243  19.4%     -  514s

         0     0 31559.6898    0 2604 39130.6051 31559.6898  19.3%     -  522s

         0     0 31559.6898    0 2604 39130.6051 31559.6898  19.3%     -  524s

         0     0 31559.6898    0 2604 39130.6051 31559.6898  19.3%
    0
  • Riley Clement
    Gurobi Staff Gurobi Staff

    Hi Sibo,

    It's fairly typical to have trouble closing the gap on a model with nonconvex quadratic constraints. I would certainly start with default parameters and only change values if there is substantial evidence that it improves (this means running the models with competing parameter sets over many values of Seed). You will also want to make sure you are specifying the tightest bounds on variables you can. I'd also run the No Relaxation heuristic for a while (NoRelHeurTime= ) and see how that performs. It may perform well but plateau, or it may not run well at all. You would use the results to gauge what a good value for this parameter could be.

    - Riley

    0
  • Sibo Li
    First Comment
    First Question

    Hi Riley,
    I set the model with default parameters, but no improvement is observed. And No Relaxation Heuristic seems not working either.

    However, a gap of about 20% is not perfect but acceptable for my question. And further improvement seems to be quite difficult. So I'll stop here, and again, thanks for the suggestions.

    Sibo Li

    0

Please sign in to leave a comment.