setObjectiveN misses objective values
AnsweredHi all,
I am trying to set up multiple objective functions in the model. According to the manual, I can set up priority of objective functions . Gurobi will take this priority into account and will try to achieve objective function's value of N function no less, than N-1 function's value. I set up different priorities for different objectives.
I got the following messages:
Multi-objectives: starting optimization with 2 objectives ...
...
Multi-objectives: optimize objective 1 (Route_Selection) ...
Solution count 2: 0 4069.03
---------------------------------------------------------------------------
Multi-objectives: optimize objective 2 (General_Objective_) ...
Loaded MIP start with objective 15196.5
Solution count 2: 15196.5 15196.5
---------------------------------------------------------------------------
...
How you could explain why calculation started with MIP objective = 15196.5 and why previous objective function's value is missed?
With best regards,
Santalov Maxim
-
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 Maxim,
When Gurobi solves multi-objective problems in a hierarchical manner, then each objective optimized in a decreasing manner (respecting the priorities you set for each objective). In the first optimization Gurobi reports the objective value of the objective with highest priority, here \(\texttt{Route_Selection}\). In the second optimization run, Gurobi optimizes the second objective, here \(\texttt{General_Objective_}\), and reports the objective value of this particular objective.
The line
Loaded MIP start with objective 15196.5
means that the solution point of the previous objective optimization run provides a solution with value 15196.5 for the second objective, which in your case turns out to be optimal.
The previous objective value is not missed but rather used in order to not degrade the solution of subsequent runs as described here.
Best regards,
Jaromił0 -
Hi Jaromil,
Thank you for your answer. I got your idea. Could you, please, answer on another question, relative to previous one:
I am setting up abstol for objective functions equal to 0. I expect, when all optimization processes ends, the objective value will remain the same. But, in fact the situation is different.
In instance, the first objective value = 14653, the second one is 44. When I am calculating by hands the output result, objective value is 14697. Why it happens and how I can make the second objective function keep objective value from the first one?
0 -
Hi Maxim,
What do you mean by "calculate it by hand"? Please note that 14653 + 44 = 14697, which is the sum of your multiple objectives weighted by 1.0. You could set the weight of the second objective to 0 when defining your multi-objective problem.
Best regards,
Jaromił0 -
Hi Jaromil,
Thank you again for an immediate answer.
I mean, that I can take values from the output of the optimization, put it in a objective function and count it. I also mentioned, that those two numbers in sum will provide 14697, but was wondering why it happens. Indeed, if a weight is set to 0 for the second objective, I receive correct output values.
With best wishes,
Santalov Maxim
0
Post is closed for comments.
Comments
5 comments