• 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ł

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.

• 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ł