How to deal with integer linear programming when constant in the objective function is based on solution

Dear Community Member,
I face a problem when doing the integral linear programming. My objective function is not a fixed function.
For example:
objective: min x1+x2+x3+b(x1,x2,x3)
b(x1,x2,x3) is discrete constant number related to different combination of x1,x2 and x3
b=0 when (x1=1,x2=0,x3=1)
b=1 when (x1=0,x2=0,x3=0)
b=2 other
How can I add this b value into the integer linear programming function intlinprog or is there any other way I can achieve this optimization?
Thanks in advance!!!

回答(1 个)

Whatever you may think, that is NOT a linear programming problem, since the constant is not actually constant. It is some general (and essentially nonlinear) function of the variables! The constant is not so.
Just because PART of your objective function is linear, the objective function is not linear. Calling it that does not make it so.
A common solution to this type of problem is to solve the default problem, with no constant b at all.
If the minimum is NOT one of those points, then you are done, and need not worry. If the solution is one of those bad points, then if you could provide a simple linear constraint that would prevent the tool from going to those places, then resolve it. If the solution as found is still better than the solution at the singled out locations, then compare it to the solution with this penalty added to it.
Finally, IF you cannot formulate a constraint that intlinprog can use that prevents the optimization from going into that corner, then you need to work harder. But start with the above.

1 个评论

Hi John,
Yes you are right, it is not a linear problem. But what I have right now is 98 variables(maybe more) in the objective function. And around 200+ solutions will have a unique 'constant' value back to the objective function.
So you have any suggestion to solve problem like this?
Thanks a lot!

请先登录,再进行评论。

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by