  We study a generalization of the multi-marginal optimal transport problem,
which has no fixed number of marginals $N$ and is inspired of statistical
mechanics. It consists in optimizing a linear combination of the costs for all
the possible $N$'s, while fixing a certain linear combination of the
corresponding marginals.
