why GRBcbsolution doesn't work
AnsweredHello,
I am trying to using GRBcbsolution to provide a feasible solution for my model when the where is equal to GRB_CB_MIPSOL. But I noticed at the beginning, the solution didn't show in the "Incumbent" column immediately. I am using C API for Gurobi10.0.3. I am wondering should I using GRBcbsolution when the where is GRB_CB_MIPNODE?
-
Hi Dong Han,
Do you see that your solution is accepted but just not immediately? In some Callbacks Gurobi needs to store the solution until it can be processed internally. If you need the MIPSOL callback to create your solution, you can also provide it via GRBcbsolution. It will not be faster if you keep it and provide it when in MIPNODE Callback.
Hope this helps,
Marika0 -
Hello Marika,
Thank you for your response. The thing is, for example, the first solution I provided didn't be accepted when I used GRBcbsolution. And after a few iteration, the fifth solution I provided was accepted. But the fifth solution was worse than the first solution. I am not sure if the process is reasonable. If not, is there anything wrong that might cause this situation?
0 -
Do you provide a full solution or solution values for only a subset of the variables? Either Gurobi is not able to extend the partial solution to a complete solution or your solution violates some constraints or bounds.
Are you sure that your solution is indeed feasible and has a better objective value? Could you verify this in a different test, e.g., create an equivalent model where the variable bounds are fixed to the (not accepted) solution values and check if this is feasible?0 -
Yes, I provide a full feasible solution and its corresponding objective value to the model. And I verified in the way you suggested, the solution is absolutely feasible and the worse feasible solution show in the "incumbent" solution.
0 -
Could you create and provide the code of a minimum reproducible example? It is not possible to attach a file to a community post; could you use a service like Filemail, Dropbox, Box, Google Drive, OneDrive?
0
Please sign in to leave a comment.
Comments
5 comments