I am trying to model a if-then condition for a MIP. The MIP looks like
Maximize $\sum\limits_i H_i - C$
s.t. $\sum\limits_j x_{ij} \le D_i$ and $\sum\limits_i x_{ij} \le S_i$, where $H_i = 1$ if $\sum\limits_j x_{ij} = D_i$, and $0$ otherwise; $C = \sum\limits_{i,j}$ if $x_{ij} \gt 0$ then $1$, $0$ otherwise.
$x_{ij}$ is integer.
I know how to model a simple if-then condition in an MIP. But not able to model this one.
The ability to do this hinges on whether $x$ is integer-valued or not. For non-integer $x$,you will have to compromise a bit. I have details posted at Flagging a Specific Variable Value.