How to insert new heuristic solution in Callback?
Hello!
Recently, I have a problem when using callback in a MIP problem.
In the condtion "where == GRB_CB_MIPNODE" and "getIntInfo(GRB_CB_MIPNODE_STATUS) == GRB_OPTIMAL", I construct a better feasible solution and pass it to Gurobi by function "setSolution". However, it seems that Gurobi does not know the feasible solution.
I use the branch and cut schema. Is it possible that my REAL feasible solution is not as good as the "current-feasible" solution obtained by Gurobi? Since some cuts have not been added to Gurobi.
-
Official comment
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?. -
Hi Yuan,
Are you sure that your solution is feasible? You can check the solution using the cbUseSolution callback.
Please check that you followed the guidelines for how to set solutions via callbacks.Cheers,
Matthias0 -
Hi Matthias, thank you for replying.
The solution is feasible, since it is easy to find a feasible one in the hub location problem. I have tried function "useSolution", which returned a value equal to the objective value of the feasible solution.
Fortunately, this problem does not affect the final solution. Well, I have another question. How does Gurobi know an "incumbent" is always feasible? Note that I keep inserting new cuts, is it possible that an "incumbent" solution becomes infeasible after new cuts are inserted?
Thank you.
0
Post is closed for comments.
Comments
3 comments