Signature of a distribution - Earth Mover distance

I am studying the Earth Mover Distance from here, but I have some difficulty in fully understanding what is the signature of a distribution and how it matches with the last constraint of the Earth Mover Distance.

In particular, a distribution can be divided in clusters, and for each cluster we take some representative measure, like the mean, and the weight of that cluster in the distribution. I can visualize it as an univariate gaussian distribution, for example, in which I split the $$x$$ axis in segments, and for each segment I take the mean of the distribution truncated at the segment boundaries and the weight (the length of the segment divided by the support of the distribution).

But this visualization leads me to believe that the sum of the weights must be equal to one. So, if the signature of a distribution $$P$$ is defined as

$$P=\{ (p_1, w_1),\dots,(p_n,w_n) \}$$

I believe that $$\sum\limits_i w_i = 1$$

But then I don't understand the last contraint of the EMD, which is

$$\sum_i \sum_j f_{ij} = \min(\sum\limits_i w_{p_i}, \sum\limits_j w_{p_j})$$

Hope you can clarify me