# Writing different constraints using equivalent variables

Let $$z_{ij}\in\{0,1\}$$ be a binary variable and $$t_{ij}\geqslant0$$ be a continuous variable. I have the following equivalence: $$z_{ij}=1\iff t_{ij}>0.$$

Since we have an equivalence between $$z_{ij}$$ and $$t_{ij}$$, is it possible to write the following constraints $$\sum_{i=1}^nz_{ij}\leqslant B,\forall j,$$ in terms of $$t_{ij}$$?

Like for example $$\sum_{i=1}^nt_{ij}\leqslant C,\forall j?$$

• Is there some restriction, perhaps implied by other constraints, on the values $t$ can take when it is positive? – Rob Pratt Oct 29 '19 at 23:26
• Yes, when $t_{ij}$ is positive, we have: $t_{ij}\leqslant T_i$ for all $i, j$ – zdm Oct 29 '19 at 23:30
• I don’t think you can get a constraint like $\sum t_{i,j}\le C$ unless they all take some common value when positive. Do you already know how to express the relationship between $z$ and $t$ via linear constraints? – Rob Pratt Oct 29 '19 at 23:36
• I don't see the motivation here. What is wrong with $\sum_{i=1}^n z_{ij}\leqslant B\ \forall j$? – Math1000 Oct 29 '19 at 23:46
• @Math1000 I am trying to remove binary variables and reduce the number of variables I have in a formulation. But it seems, as Rob Pratt said, it is not possible to do so. – zdm Oct 30 '19 at 0:05

The standard way to limit the number of positive values to $$B$$ is to introduce a binary variable $$z_{i,j}$$ with $$\sum_i z_{i,j} \le B$$, as you have done. The remaining part is to enforce $$t_{i,j} >0 \implies z_{i,j}=1$$, which is accomplished via linear constraint $$t_{i,j} \le T_i z_{i,j}$$.