Removing an objective or getting dual variables with multiple objectives
AnsweredHi!
I am trying to use gurobi with column generation and multiple objectives at the same time.
I have a main objective and I am using column generation on this objective: this means that I need to have access to dual variables (constraint.PI) in order to generate columns.
However, in the middle of the process, I want to add a second lower rank objective to get additional information and then either remove it or forget about it.
The problem is that you cannot have access to dual variables in a multiple objective context (according to the errors I received) which I think is totally normal.
But I can't remove my second objective to return to a mono-objective context.
Does anyone knows how to solve this problem?
-
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 Francois,
To return back to a single-objective optimization you need to set model.NumObj=0, call model.update(), and then reset the primary objective function (model.setObjective).
You can also query the current optimization mode using IsMultiObj
I hope that helps.
Cheers,
Matthias0 -
Thanks it seems to work!
0
Post is closed for comments.
Comments
3 comments