Scope of variables in a formula

24 Views Asked by At

If I have a graph $G = (V,E)$ and I wanted to write a constraint that says that the sum of edge variables $x_{ij}$ minus the sum of vertex variables $y_i$ must be 1, can I write it like this?

$\displaystyle\sum_{(i,j)\in E}x_{ij} - \displaystyle\sum_{i\in V}y_i = 1$,

or is it not considered good form to re-use the label $i$ for two variables in the one formula? How about for something like this:

$\displaystyle\sum x_{ij} - \displaystyle\sum y_i = 1, \qquad \forall (i,j)\in E, \forall i \in V$.

In these cases, is the top one okay, because it is clear that the scope of the $i$'s and $j$'s are clearly demarcated by the summation symbols; and the bottom one is too ambiguous because $i$ is used twice before defining it?

It has always been one of the finer points of notation that I have never fully got my head around.