[Scip] include constant term in objective function

Tobias Achterberg achterberg at zib.de
Tue Dec 2 17:22:55 MET 2008



Markus Leitner wrote:
> Hi all,
> 
> I am using scip to solve a network design problem by branch & price.
> 
> In one specific case, the objective function of my formulation contains a constant
> term, i.e. it looks as follows:
> 
> min ... + \sum p_k (1-y_k)
> 
> where y_k are variables and p_k are constants. Therefore, the objective contains the
> constant term P = \sum p_k.
> 
> However, I could in principle reformulate the objective to avoid this constant - but
> for comparison reasons to existing approaches - as well as for convenience - I would
> really prefer using the current objective function.
> 
> Is there any option - which I have overseen - to include such a constant in the
> objective?
> 
> I already tried to add an artificial variable with the corresponding objective value
> fixed to one but the presolver eliminates this variable (which is of course not a big
> surprise ;-) ) - finally leading to a "optimal" solution in the transformed problem
> which is not feasible in the original problem.
> 
> Any hints & suggestions highly appreciated!

Your approach is exactly what you need to do: add a variable fixed to one, which has an 
objective coefficient equal to the constant.

The issue that you are reporting, an optimal solution that is not feasible in the original 
problem, should have nothing to do with the objective offset. It may be some numerical 
issue in your model. Just try the same model without the artificial objective offset 
variable. Doesn't it give exactly the same result?

If you like, you can send your instance to the SCIP team, for example to wolter at zib.de or 
berthold at zib.de. Don't send it to the list if it is large.


Tobias


More information about the Scip mailing list