2

Assume a mathematical optimization problem with two positive continuous variables:

0 <= x <= 1
0 <= y <= 1000

I am seeking of an efficient way to express in form of linear constraints (possibly with the use of binary/integer variables and big M) the following nonlinear relationship, so the problem can be solved with milp solvers:

when   0 <= y < 200      then   x = 0
when   y = 200           then   0 <= x <= 1
when   200 < y <= 1000   then   x = 1

The numbers 200 and 1000 are indicative.

Are there any direct suggestions or papers/books addressing similar problems?

Manos
  • 85
  • 5
  • this can be done w/ a couple of binary indicator variables & linking constraints. But first, can you edit your inequalities? right now, if x=200, the first and third are contradictory. I'm thinking you want non-strict inequalities in there somewhere...? – AirSquid Jan 28 '22 at 23:17
  • Thank you for the comment, I corrected the first and third equations with non-strict inequalities. – Manos Jan 29 '22 at 10:55
  • Consider posting to https://cs.stackexchange.com – Vitaly Olegovitch Jan 29 '22 at 11:05
  • 1
    I’m voting to close this question because it belongs to [OR.SE](https://or.stackexchange.com/). – joni Jan 29 '22 at 12:25

1 Answers1

1

I think this will work...

Here's how I think of this. You have 3 states that you need to be aware of, which are the 3 partitions on the domain of y. So, 2 binary variables can capture these 3 states. In order to keep things linear, you will need to work with non-strict inequalities. So define:

y_lb ∈ {0, 1} and let y_lb = 1 if y >= 200
y_ub ∈ {0, 1} and let y_ub = 1 if y <= 1000

so now we have our partitions set up in terms of a truth table for y_lb and y_ub:

y        y<200    200<=y<=1000    y>1000
y_lb       0    |      1        |    1
y_ub       1    |      1        |    0

Now we can easily link that truth table to constrain x:

x ∈ Reals
x <= y_lb
x >= 1 - y_ub
AirSquid
  • 10,214
  • 2
  • 7
  • 31