# How to model membership to a set using MILP?

Consider the following problem. I have two regions $$X1=[a,b]$$ and $$X2=[b,c]$$. Notice that they are disjoint except for point $$b$$.

I have a continuous variable $$x$$ and two binary variables, $$y_1,y_2$$ which indicate membership of the two sets. I want to model $$x\in X1\implies y_1=1$$ $$x\in X2\implies y_2=1$$ So far so good.

However, the two regions intersect at one end (point $$b$$). So, I want to enforce that $$x=b\implies y_1=1,y_2=0$$ That is, if $$x$$ is at level $$b$$ we consider region $$X1$$ active instead of $$X2$$.

I am finding this surprisingly difficult to model explicitly, without adding a tolerance to $$b$$ in set $$X2$$. Any hints?

• $Pr(x=b)\approx 0$ for continuous variables and there are also all kind of tolerances in a MIP solver. So, the question is somewhat moot. I would allow the model to choose $y_1$, $y_2$ when $x\approx b$. It can pick the best one (and make you some profit). Jan 3 at 15:49
• I don't think there is a way to accomplish what you want without putting some space between $X1$ and $X2$ (i.e., $X2=[b + \epsilon, c]$).
– prubin
Jan 3 at 16:49