0

I want to find the minimum of the following function, using a linear solver in Matlab:

f = sum(((P * x - d)+|P * x - d|))*0.5*p)

x (dimension [ix1]) is binary, P (dimension [nxi]),d and p are always positive.

In other words:

if P*x => d

f = (P*x-d)*p

if P*x < d

f = 0

Is it possible to solve this problem with a linear Solver in Matlab (like linprog or cplexlp)?

Johnny
  • 3

1 Answers1

2

Minimizing $\max\{Ax+b,0\}$ is equivalent to minimizing $t$ under the simultaneous constraints $t\geq Ax+b$ and $t\geq 0$, so it is linear. See for instance https://docs.mosek.com/modeling-cookbook/linear.html#maximum

  • Ok I do understand this. But how can i set constraints for my function value? $$f=max((P∗x−d)∗p,0)$$ Actually it is only possible to set constraints like $$A∗x<=b$$ So how can I set constraints between f and x? – Johnny May 15 '19 at 09:24
  • @Johnny Both inequalities with $t$ from my answer are linear inequalities in the aggregate variable $(t,x)$, that is of the form you want. – Michal Adamaszek May 15 '19 at 09:27
  • Oh ok, so I will operate with two variables in one Optimization? Like this: $$f(t,x) = t * p$$ Constraints: $$t(x) >= P* x - d$$ $$t(x) >= 0$$ and I will need some more like $$A * x >= b$$ – Johnny May 15 '19 at 09:38