How to add m.ModelSense for multiobjective optimization?
回答済みHi,
I have two objectives, one to maximize another one to minimize. How to tell the model that obj1 is maximization and obj2 is minimization? The below ModelSense will consider both objectives as minimization. Just adding minus sign for objective does not seem to be a rigourus way!
0
-
正式なコメント
This post is more than two 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 try Gurobot, our chatbot interface offering instant, expert-level support. -
Hi Tanmoy,
As noted in Specifying Multiple Objectives, a multiobjective model has only one sense. Negating the objective will certainly do the job, but a better alternative is to use weights. If obj1 is to be maximized, obj2 is to be minimized, and you set
m.ModelSense = GRB.MINIMIZE
then you should set weight=-1 when you apply obj1 using setObjectiveN.
1 -
thank you. I applied your suggestion to the model.
0
投稿コメントは受け付けていません。
コメント
3件のコメント