Modeling $t \in [a,b] \; \Rightarrow y_{[a,b] }=1$, asking for alternatives if any

43 Views Asked by At

Suppose you have a variable $t\ge 0 $, I want to model the following statement : $$ t \in [a_i,b_i] \; \Rightarrow y_i =1 $$ I am assuming $t$ belongs to a unique interval among the ones proposed.

I am doing it as follows : $$ \sum_i y_i = 1 \\ t \le \sum_i b_i y_i \\ t \ge \sum_i a_i y_i \\ y_i \in \{0,1\} $$

Just wondering if there is another way to do it (there most certainly is !).

1

There are 1 best solutions below

2
On BEST ANSWER

You could break up your two inequalities into a bunch of "big M" type inequalities of the form$$t\le b_i + (B-b_i)(1-y_i)$$and$$t\ge a_i + (A-a_i)(1-y_i)$$where $A$ and $B$ are respectively the smallest and largest legal values of $t$. Between your formulation and this one, I don't know which would fare better in terms of solution time.

If the intervals are consecutive ($a_{i+1}=b_i$), you could try an SOS2 formulation (assuming your solver understands SOS2 constraints). Again, it's an empirical question which results in the best solver performance.