5
$\begingroup$

Suppose we have the following objective function with one decision variable $x_i$ where $p_i$ is a fixed parameter for each $i$ and also, $a$ is a constant for the problem
\begin{align} \label{eq} \max \sum^N_{i=1} p_i(a+1-x_i) = \max \bigg{(}\sum^N_{i=1} p_ia +\sum^N_{i=1}p_i -\sum^N_{i=1} p_i x_i\bigg{)} \end{align}

As the first two components: $\sum^N_{i=1} p_ia $ and $\sum^N_{i=1}p_i$ are fixed and changing $x_i $ won't affect them anyway. Is there any difference if I excluded the fixed components from the objective function and set the objective function to be \begin{equation} \max \sum^N_{i=1} -p_ix_i = \min \sum^N_{i=1} p_ix_i? \end{equation}

Of course, the objective function value is not the same before and after excluding the fixed components, but will the values of $x_i$ be the same in both cases?

$\endgroup$
7
$\begingroup$

Excluding the constant portions of the objective function is perfectly fine. The optimal solutions will be unchanged and it should have no impact on how long the solver needs to solve the model.

$\endgroup$
4
  • 9
    $\begingroup$ One subtlety to be aware of is that both the solution returned and the solve time can be impacted if a relative objective gap other than 0 is used as a termination criterion. $\endgroup$
    – RobPratt
    Jun 26 at 18:38
  • $\begingroup$ @prubin it have no impact on how long the solver needs to solve the model, should not it be faster after excluding the constant portions? $\endgroup$
    – OR Junior
    Jun 27 at 1:07
  • 2
    $\begingroup$ @ORJunior Not enough to notice. A typical solver will set aside the constant portion anyway, so the number of nodes processed and time to process them will not be affected (other than as noted by Rob, and the effect there can go either way). The time the solver would have spent ignoring the constant stuff is too little matter. $\endgroup$
    – prubin
    Jun 27 at 20:46
  • $\begingroup$ @prubin Thank you, I got it. And I really appreciate your answer to my question $\endgroup$
    – OR Junior
    Jun 28 at 4:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.