Skip to main content

Printing best bound solution for MIP problem

Answered

Comments

4 comments

  • Official comment
    Simranjit Kaur
    Gurobi Staff 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 why not try our AI Gurobot?.
  • Jaromił Najman
    Gurobi Staff Gurobi Staff

    Hi Alexia,

    You can access the relaxation solution of the current node via the \(\texttt{MIPNODE_REL}\) code in the \(\texttt{MIPNODE}\) callback. A list of all information which can be queried from Gurobi via callback can be found in the Callback Codes documentation.

    Best regards,
    Jaromił

    0
  • Alexia Payan
    Gurobi-versary
    First Comment
    Curious

    Hello Jaromil,

    Thank you for your reply. This prints the relaxed solution for the current node being explored but this does not necessarily corresponds to the Best Bound solution. What I am looking for is the following: when a solution is found using Gurobi heuristics for example, I would be interested in seeing the difference between the heuristics solution and the current best bound relaxed solution.

    Would you know how to do so?

    Thank you.

    0
  • Jaromił Najman
    Gurobi Staff Gurobi Staff

    Hi Alexia,

    There is no function to get the best bound solution whenever a new incumbent solution has been found. However, with a bit of bookkeeping, you can still manage to have the best bound solution point at hand. In the \(\texttt{MIPNODE}\) callback, whenever a better best bound has been found, you can save the corresponding best bound solution point obtained by \(\texttt{MIPNODE_REL}\). You then have to replace the best bound solution point and its value only when a better bound has been reported in the \(\texttt{MIPNODE}\) callback. This way, you will have the best bound solution at hand whenever a new incumbent has been found.

    Best regards,
    Jaromił

    0

Post is closed for comments.