Let $M$ denote the “largest” number in $\Bbb R$, and then let $y$ be a binary variable and do the following:
$$x\le yM$$$$x>-M(1-y)$$
That strict inequality, $>$, is going to make the feasible region open. So, depending on the objective function of the original problem, this could mean the model is infeasible.
Suppose $x$ is an Integer:
Let $M$ denote the “largest” number in $\Bbb R$, and then let $y$ be a binary variable and do the following:
Suppose $x$ is not an Integer:
Let $M$ denote the “largest” number in $\Bbb R$, and then let $y$ be a binary variable and do the following:
$$x\le yM$$ $$x>-M(1-y)$$
That strict inequality, $>$, is going to make the feasible region open. So, depending on the objective function of the original problem, this could mean the model is infeasible.
Suppose $x$ is an Integer:
Let $M$ denote the “largest” number in $\Bbb R$, and then let $y$ be a binary variable and do the following:
$$x\le yM$$ $$x\ge -M(1-y)+1$$