0

I am using SCIP with ZIMPL to solve an optimization problem where I want to "punish" a solution for which variable x < k, with k being a parameter. I do not want to exclude all solutions where this is the case. Therefore, I introduced variable y= x-k and want to add a penalty term to my objective value, but only if y is negative, as I don't want to punish a solution if x>k.

Adding -(min(y,0)) should do the trick, but I got the feeling that all functions and operations in ZIMPL such as the min - function (listed in Table 2 and 3 on p. 7 of the ZIMPL documentation) can only be aplied to parameters.

Can someone confirm that? And if yes, does anyone maybe have an idea how I can implement a kind of penalty term that only punishes the negative part of variable y in ZIMPL?

PS: Sorry for the misleading tag #scip, as it is a clear ZIMPL related problem. But unfortunatelly there was no existing tag #zimpl.

1 Answers1

1

Yes, you can't use this kind of operators with variables (it wouldn't be a MILP anymore). However, why don't you model it like y1 - y2 = x-k with y1 >= 0 and y2 >= 0 and then put y2 into the objective function?

mueldgog
  • 383
  • 1
  • 7
  • Thanks for the quick response! Why is it a problem that it wouldn't be a MILP anymore? the complete problem I want to solve with SCIP is already a nonconvex MINLP so I don't get why that's the reason these kind of operators cannot be used on variables. But thanks for confirming! And thanks a lot for the workaround! – Michael GE Jan 18 '18 at 12:11
  • It wouldn't be a problem, but ZIMPL simply does not support operators like this for variables. If you want to model an MINLP that is not a polynomial (this is supported by ZIMPL) then you should probably use another modeling language like GAMS or AMPL. – mueldgog Jan 19 '18 at 10:00