Are constants allowed within an objective function for a linear programming problem

linear programmingoptimizationproblem solvingsimplex

I've been taking a class on linear programming and have been working with a lot of different problems and methods of solving them.

All this time however, I have rarely come across an objective function with a constant term in it. This has me thinking, are constant terms allowed in objective functions? Do they change the optimal solution for the problem?

Any insight into this would be appreciated. I would like to settle my curiosity.

For example:

Max z = x1 + 2x2 + 3x3 + 37

Is this a legal objective function? Will the optimal values of x1, x2, and x3 be different if there was no "37" term if solved with some version of simplex?

Best Answer

Including a constant term in the objective does not change the set of optimal solutions, and this is true even for nonlinear programming. Some solvers might not allow it, so you can just omit it, solve, and add it back to your final objective value.

Related Question