Multiobjective difference index and priority
AnsweredHallo,
I try to set up a multiobjective function using:
setObjectiveN ( expr, index, priority=0, weight=1, abstol=1e-6, reltol=0, name="" )
I wonder what the difference between index and priority is.
Is index a unique identifier for the "part" of the multiobjective and priority the ordering of how the objectives are try to be optimized.
Is it possible have
setObjectiveN ( x, 0, 0, weight=1, abstol=1e-6, reltol=0, name="" )
setObjectiveN ( y, 0, 1, weight=1, abstol=1e-6, reltol=0, name="" )
to get min x+y or will it be min y?
Cheers,
Florian
-
Hi Florian,
Here's the relevant part from our documentation:
Objectives are numbered
0
throughNumObj-1
. The order of the objectives is arbitrary, but you must provide a unique index for each one (specified using theindex
argument tosetObjectiveN
).Using the same priority will blend the objectives using the given weights.
I hope that answers your question.
Cheers,
Matthias0 -
In addition to the above - to answer your last question explicitly: No, that approach won't work since both parts of the objective use the same index 0. If they would use a different index (0, 1) for each expression but the same priority 0 and weight 1 then you would be optimizing x+y. If you would use different index (0, 1) and different priority (0, 1) then Gurobi would first optimize y (highest priority), then add a bound on that objective y and optimize for objective x.
Kind regards,
Ronald0 -
Thanks for your answers. Can I also do the following.
setObjectiveN ( x, 0, 0, weight=1, abstol=1e-6, reltol=0, name="" )
setObjectiveN ( y, 1, 1, weight=1, abstol=1e-6, reltol=0, name="" )
Which means first min x than min y. Can I also say only optimize objective with prio 0 for 10 seconds. Then take this as best value (add as constraint) and go to objective with prio 1....
0 -
Please see here for objective-wise termination criteria: How do I set termination criteria in multi-objective environments? – Gurobi Help Center
Cheers,
Matthias0
Please sign in to leave a comment.
Comments
4 comments