Skip to main content

How can I correctly retrieve/save the relaxed variables values associated with the best bound?

Answered

Comments

1 comment

  • Jaromił Najman
    • Gurobi Staff

    Hi Nicolas,

    Sorry for the late reply.

    At first I thought this was working well but then I realized that the bound and the variable values that are being saved correspond to the bound 66011.5827 instead of 6.655654040023e+04, also, why isn't that bound being printed in the log since it's better than 66278.6128

    Callbacks are only called from the main thread. Thus, it is possible that a helper thread was able to improve the dual bound but it was not synced with the main thread yet and the optimization has been terminated due to hitting the nodecount limit. The best bound is then collected from all helper threads and reported in the log but without calling the callback again because the nodecount termination criterion is already met.

    You could avoid this behavior by setting Threads=1. This however might hurt performance and has to be decided depending on your application. If it is for research only, then setting Threads=1 is definitely reasonable.

    Best regards, 
    Jaromił

    0

Please sign in to leave a comment.