Skip to main content

Set ObjBound

Answered

Comments

4 comments

  • Official comment
    Simranjit Kaur
    • Gurobi Staff
    This post is more than three years old. Some information may not be up to date. For current information, please check the Gurobi Documentation or Knowledge Base. If you need more help, please create a new post in the community forum, or try Gurobot, our chatbot interface offering instant, expert-level support.
  • Maliheh Aramon
    • 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
    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

Post is closed for comments.