Skip to main content

Set ObjBound

Answered

Comments

3 comments

  • Maliheh Aramon
    Gurobi Staff Gurobi Staff
    Hi Jose,
     
    No, you cannot. The Var.setAttr() method sets the value of a variable attribute. The GRB.Callback.MIPSOL_OBJBND is not an attribute of a Var object. It is a piece of information that can be only queried inside a callback when a new incumbent solution is found, i.e., \(\texttt{where} = \texttt{MIPSOL}\).
     
    Best regards,
    Maliheh
    1
  • Jose Vindel
    Gurobi-versary
    Thought Leader
    Investigator

    Hello Maliheh,

    Thanks for your response. Basically, the only way to update the objective bound would be through a cut that cuts off that solution? A similar question if one wants to update the incumbent solution.

     

    Best,

    Jose Alexander

    0
  • Maliheh Aramon
    Gurobi Staff Gurobi Staff
    Hi Jose, 
     
    Yes, you can use the Model.cbCut() and Model.cbLazy() methods to respectively add cutting planes and new lazy constraints to a MIP model (see the article What is the difference between user cuts and lazy constraints? for their difference). 
     
    The Model.cbSetSolution() can be used to import a new heuristic solution to the model.
     
    Best regards,
    Maliheh
    0

Please sign in to leave a comment.