Why Objective must be liearn for multi-objective model in Gurobi ?
AnsweredHi all,
I have a multi-objective optimization problem where in some of the cost functions I do have a product of two decision variables. The form of the optimization problem embeds the assignment problem.
I first linearized the product of the two decision variables but Gurobi returns the following error message :
gurobipy.GurobiError: Objective must be linear for multi-objective model.
Is there a way to get rid of this issue ? I mean how could I solve my problem from the multi-objective perspective with this product of the two decision variables ?
Could anyone point out some technical solutions ?
Regards
Laaziz
-
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 Laaziz,
For multi-objective models, all objectives must be linear, but you should be able to work around this by linearizing the non-linear term. E.g. if your objective contains the term x*y, add a new variable z and replace x*y by z in the objective. Then add an additional constraint x*y == z. Note that this must be a constraint in the model, not a Python assignment. E.g.
model.addConstr(x*y == z)
0 -
Hi Horn,
Surprisingly, it works without the linearization method I had to use.
Thanks
Laaziz
0
Post is closed for comments.
Comments
3 comments