# How to design the objective function of an MILP problem

In an MILP problem, I wonder if it is better to use an objective function that involves as many of the variables of the problem as possible as opposed to an objective function with only a few variables.

I would expect that the "variable rich" objective is the better choice because it carries more information.

I could always put variables in the objective function even if they do not belong there by penalizing them to an extend that they do not do harm.

• You might be confusing data with information (relevancy). Would you add the amount of eggs uncle Jack's chickens laid yesterday to the objective function, only to multiply that added number by zero? Mar 31, 2020 at 20:37
• Well, if the amount of eggs uncle Jack's chickens laid yesterday are part of my optimization model, yes I would put them in the objective function but not with a penalty of zero. In fact, I am dealing with a scheduling problem where I want to maximize profit. Maximize profit is maximize "amount produced x price". Now if I add to the objective the term - 0,1 production time, I get the solution to the problem much faster. I do not believe that happens by chance. Mar 31, 2020 at 20:44
• After adding those 0, 1 production times, are you getting exactly same solution (probably with a different objective function)? Have you tried a few instances (ideally with different characteristics) to see if its true for all those instances? Apr 1, 2020 at 3:56
• Yes, it works for different instances. The effect the addition has, I believe, is to avoid some combinations that lead to the same objective. Apr 1, 2020 at 6:50
• Could you clarify your thought process by adding the problem formulation? As far as I see it, you've triggered a faster search procedure by chance. Same values are necessary, not sufficient. If the optimal solution is somehow always invariant under adding certain parameters, they hold no added information with regards to the optimum per definition. Apr 1, 2020 at 9:00