Solution (source code)

= Solution

A positive density factorizes according to an <undirected graphical model> $G^u=(\mathcal V,\mathcal E)$ when there are nonnegative <clique potentials> $\psi_C$ such that
$$
f(v)=\frac1Z\prod_{C\in\mathcal C}\psi_C(v_C),
$$
where $\mathcal C$ may be taken as the maximal cliques and $Z$ normalizes the density. Equivalently, each potential involves only variables in one complete subgraph.