model.setObjectiveN()
AnsweredI am implementing a hierarchial multi-objective functions.
Let's say there are three objective functions. f_1, f_2, and f_3 such that f = [f_1, f_2, f_3] in Python. Further note that the weight for each objective is defined as follows.
coef = [1,4,1]
Then, is the following hierarchical multi-objective function going to minimize
1*f_1 + 4*f_2 + 1*f_3 with the first priority for f_1, second priority for f_2, and third priority for f_3?
In addition, I set relative tolerance = 0.05. May I ask if it means that I only allow 5 percent for the next objective?
For example, at i = 0, I am setting the objective function for f_1, and am I only allowing 5 percent from f_2? and f_2 only allows 5 percent for f_3? If my following code does not implement the features described above, would you mind giving me any suggestion?
# Coding
for i in range(3):
objn = f[i]
model.setObjectiveN(expr=objn, index=i, priority=SetObjPriority[i], weight=obj_coef[i+1],
abstol=0.00, reltol = 0.05, name = obj_names[i])
model.optimize()
-
Then, is the following hierarchical multi-objective function going to minimize
1*f_1 + 4*f_2 + 1*f_3 with the first priority for f_1, second priority for f_2, and third priority for f_3?
As long as all priorities are different, Gurobi will not blend objectives, cf. Working With Multiple Objectives.
For example, at i = 0, I am setting the objective function for f_1, and am I only allowing 5 percent from f_2? and f_2 only allows 5 percent for f_3?
The reltol setting allows for an overall degradation of a given objective of at most reltol % over all subsequent optimizations, not only the the next optimization. So after solving f_1, f_2 could degrade f_1 by 1% and then f_3 could degrade f_1 by another 1%.
Best regards,
Jaromił0 -
Thank you very much!
0
Please sign in to leave a comment.
Comments
2 comments