Skip to main content

BestBd NaN for MILP and When will BestBd be NaN?

Answered

Comments

9 comments

  • Marika Karbstein
    Gurobi Staff Gurobi Staff

    In the first line of the B&B log you see a "postponed" for the objective. This means numerical troubles were encountered during the solution of the relaxation, see also the post What are postponed nodes?

    Could you share the first lines of the log file about the model size and statistics?
    Which Gurobi Version are you using? You shared a link for version 9.1. This is quite old and there were some improvements w.r.t. numerics in the recent Gurobi versions. 

    0
  • CAN YIN
    Gurobi-versary
    First Question
    Conversationalist

    Hello Marika

    Thanks for your patient and also thanks for your answer. It's very helpful, and below is the first few lines and last few line of the log file, and the version I am using is  9.5.2. 

    Thanks for you help

    Yin Can

     

    Set parameter TimeLimit to value 3600
    Set parameter Presolve to value 0
    Gurobi Optimizer version 9.5.2 build v9.5.2rc0 (win64)
    Thread count: 8 physical cores, 16 logical processors, using up to 16 threads
    Optimize a model with 1301 rows, 965 columns and 4132 nonzeros
    Model fingerprint: 0x197aaa26
    Model has 216 quadratic objective terms
    Variable types: 716 continuous, 249 integer (249 binary)
    Coefficient statistics:
      Matrix range     [1e-01, 1e+02]
      Objective range  [4e-01, 4e+01]
      QObjective range [4e+00, 4e+00]
      Bounds range     [1e+00, 1e+00]
      RHS range        [1e+00, 1e+02]
    Found heuristic solution: objective 360.0003600
    Variable types: 718 continuous, 895 integer (465 binary)
    Found heuristic solution: objective 0.0000000




     8709650 16835  postponed  150      -767.95483          -      -  19.1 3565s
     8721306 16731  postponed  151      -767.95483          -      -  19.1 3570s
     8733280 16690 infeasible  150      -767.95483          -      -  19.1 3575s
     8745310 16622  postponed  151      -767.95483          -      -  19.1 3580s
     8757355 16544  postponed  157      -767.95483          -      -  19.1 3585s
     8767040 16488     cutoff  156      -767.95483          -      -  19.1 3590s
     8779153 16393     cutoff  157      -767.95483          -      -  19.1 3595s
     8791459 16320 infeasible  155      -767.95483          -      -  19.1 3600s
    0
  • Marika Karbstein
    Gurobi Staff Gurobi Staff

    Hi Yin Can,

    The statistics look ok, but the model seems to be numerical challenging. Could you share your model file? You cannot attach a file to a community post. But can you use some share service (like FilemailDropboxBox etc)?

    Best regards,
    Marika

    0
  • CAN YIN
    Gurobi-versary
    First Question
    Conversationalist

    Hello Marika

    Sorry for the late reply and again thank you for your help, I really appreciate it.

    Might I know whether you mean the lp file, code, the log file, or something else? 

    Thanks for reading and again thanks for your help

    Yin

    0
  • CAN YIN
    Gurobi-versary
    First Question
    Conversationalist

    Hello Marika

    I just upload the file with Filemail(https://www.filemail.com/d/dsuhpqpbdasornc), inside have the code, and the log file. And sorry that I new to the filemail, so please let me know that if there is any trouble with it. 

    Thanks for reading and thanks for your help

    Yin Can

    0
  • Marika Karbstein
    Gurobi Staff Gurobi Staff

    Hi Yin Can,

    Thanks, I could access the files. (The lp file would have been sufficient.)
    Your problem can be solved within 1 second without any issues with the default parameter setting. 
    You have set Presolve=0. What is the reason for this?
    Your model does not contain upper bounds for all non-binary variables. The bounds are implicitly defined by the constraints. But if you turn presolve off, the implied bounds are not detected by Gurobi. The root relaxation is considered as unbounded due to the 216 quadratic terms in the objective. A bound cannot be computed.
    You should turn presolve on again or you need to set at least the upper bounds for the variables.

    Best regards,
    Marika

    0
  • CAN YIN
    Gurobi-versary
    First Question
    Conversationalist

    Hello Marika

    Thank you very much, that helps a lot, at the beginning I want to set Presolve = 0 is want to compare solving time before and after removing the Presolve to see how different it would be. 

    Might I know if some of the bounds are defined by the constraints rather than the variable definition? Will this always be the case?

    Thanks for reading and again thank you very much

    Yin Can

    0
  • Marika Karbstein
    Gurobi Staff Gurobi Staff

    Hi Yin Can,

    I am not sure whether I understand your question.
    You created the model, so hopefully you know which variable values are reasonable and which are not.
    The quadratic terms involve the x and the epsilon variables. All x-variables are binary and hence have an upper bound. Each epsilon variable has the default lower bound of 0 and is part of a constraint you named 16b:

      epsilon_kit[0,0,0] + epsilon_kit[0,0,1] + epsilon_kit[0,0,2]
       + epsilon_kit[0,0,3] + epsilon_kit[0,1,0] + epsilon_kit[0,1,1]
       + epsilon_kit[0,1,2] + epsilon_kit[0,1,3] + epsilon_kit[0,2,0]
       + epsilon_kit[0,2,1] + epsilon_kit[0,2,2] + epsilon_kit[0,2,3]
       + epsilon_kit[0,3,0] + epsilon_kit[0,3,1] + epsilon_kit[0,3,2]
       + epsilon_kit[0,3,3] + epsilon_kit[0,4,0] + epsilon_kit[0,4,1]
       + epsilon_kit[0,4,2] + epsilon_kit[0,4,3] + epsilon_kit[0,5,0]
       + epsilon_kit[0,5,1] + epsilon_kit[0,5,2] + epsilon_kit[0,5,3] <= 100

    Hence, we have an upper bound of 100 for each epsilon variable which you can set when adding the variables to the model.
    It is sufficient to define the bounds only for the epsilon variables to get a root relaxation and hence a dual bound. But I would recommend to use presolve and not to set the Presolve parameter to 0.

    Best regards,
    Marika

    0
  • CAN YIN
    Gurobi-versary
    First Question
    Conversationalist

    Hello Marika

     

    Thank you very much, your answer is very helpful, I really appreciate it.

     

    Thanks for reading and again thanks for your help

    Yin Can

    0

Please sign in to leave a comment.