# Maximum-entropy random graph model

Maximum-entropy random graph models are random graph models used to study complex networks subject to the principle of maximum entropy under a set of structural constraints ,[1] which may be global, distributional, or local.

## Overview

Any random graph model (at a fixed set of parameter values) results in a probability distribution on graphs, and those that are maximum entropy within the considered class of distributions have the special property of being maximally unbiased null models for network inference[2] (e.g. biological network inference). Each model defines a family of probability distributions on the set of graphs of size ${\displaystyle n}$ (for each ${\displaystyle n>n_{0}}$ for some finite ${\displaystyle n_{0}}$), parameterized by a collection of constraints on ${\displaystyle J}$ observables ${\displaystyle \{Q_{j}(G)\}_{j=1}^{J}}$ defined for each graph ${\displaystyle G}$ (such as fixed expected average degree, degree distribution of a particular form, or specific degree sequence), enforced in the graph distribution alongside entropy maximization by the method of Lagrange multipliers. Note that in this context "maximum entropy" refers not to the entropy of a single graph, but rather the entropy of the whole probabilistic ensemble of random graphs.

Several commonly studied random network models are in fact maximum entropy, for example the ER graphs ${\displaystyle G(n,m)}$ and ${\displaystyle G(n,p)}$ (which each have one global constraint on the number of edges), as well as the configuration model (CM).[3] and soft configuration model (SCM) (which each have ${\displaystyle n}$ local constraints, one for each nodewise degree-value). In the two pairs of models mentioned above, an important distinction[4][5] is in whether the constraint is sharp (i.e. satisfied by every element of the set of size-${\displaystyle n}$ graphs with nonzero probability in the ensemble), or soft (i.e. satisfied on average across the whole ensemble). The former (sharp) case corresponds to a microcanonical ensemble,[6] the condition of maximum entropy yielding all graphs ${\displaystyle G}$ satisfying ${\displaystyle Q_{j}(G)=q_{j}\forall j}$ as equiprobable; the latter (soft) case is canonical,[7] producing an exponential random graph model (ERGM).

Model Constraint type Constraint variable Probability distribution
ER, ${\displaystyle G(n,m)}$ Sharp, global Total edge-count ${\displaystyle |E(G)|}$ ${\displaystyle 1/{\binom {\binom {n}{2}}{m}};\ m=|E(G)|}$
ER, ${\displaystyle G(n,p)}$ Soft, global Expected total edge-count ${\displaystyle |E(G)|}$ ${\displaystyle p^{|E(G)|}(1-p)^{{\binom {n}{2}}-|E(G)|}}$
Configuration model Sharp, local Degree of each vertex, ${\displaystyle \{{\hat {k}}_{j}\}_{j=1}^{n}}$ ${\displaystyle 1/\left\vert \Omega (\{{\hat {k}}_{j}\}_{j=1}^{n})\right\vert ;\Omega (\{k_{j}\}_{j=1}^{n})=\{g\in {\mathcal {G}}_{n}:k_{j}(g)={\hat {k}}_{j}\forall j\}\subset {\mathcal {G}}_{n}}$
Soft configuration model Soft, local Expected degree of each vertex, ${\displaystyle \{{\hat {k}}_{j}\}_{j=1}^{n}}$ ${\displaystyle Z^{-1}\exp \left[-\sum _{j=1}^{n}\psi _{j}k_{j}(G)\right];\ -{\frac {\partial \ln Z}{\partial \psi _{j}}}={\hat {k}}_{j}}$

## Canonical ensemble of graphs (general framework)

Suppose we are building a random graph model consisting of a probability distribution ${\displaystyle \mathbb {P} (G)}$ on the set ${\displaystyle {\mathcal {G}}_{n}}$ of simple graphs with ${\displaystyle n}$ vertices. The Gibbs entropy ${\displaystyle S[G]}$ of this ensemble will be given by

${\displaystyle S[G]=-\sum _{G\in {\mathcal {G}}_{n}}\mathbb {P} (G)\log \mathbb {P} (G).}$

We would like the ensemble-averaged values ${\displaystyle \{\langle Q_{j}\rangle \}_{j=1}^{J}}$ of observables ${\displaystyle \{Q_{j}(G)\}_{j=1}^{J}}$ (such as average degree, average clustering, or average shortest path length) to be tunable, so we impose ${\displaystyle J}$ "soft" constraints on the graph distribution:

${\displaystyle \langle Q_{j}\rangle =\sum _{G\in {\mathcal {G}}_{n}}\mathbb {P} (G)Q_{j}(G)=q_{j},}$

where ${\displaystyle j=1,...,J}$ label the constraints. Application of the method of Lagrange multipliers to determine the distribution ${\displaystyle \mathbb {P} (G)}$ that maximizes ${\displaystyle S[G]}$ while satisfying ${\displaystyle \langle Q_{j}\rangle =q_{j}}$, and the normalization condition ${\displaystyle \sum _{G\in {\mathcal {G}}_{n}}\mathbb {P} (G)=1}$ results in the following:[1]

${\displaystyle \mathbb {P} (G)={\frac {1}{Z}}\exp \left[-\sum _{j=1}^{J}\psi _{j}Q_{j}(G)\right],}$

where ${\displaystyle Z}$ is a normalizing constant (the partition function) and ${\displaystyle \{\psi _{j}\}_{j=1}^{J}}$ are parameters (Lagrange multipliers) coupled to the correspondingly indexed graph observables, which may be tuned to yield graph samples with desired values of those properties, on average; the result is an exponential family and canonical ensemble; specificially yielding an ERGM.

## The Erdős–Rényi model ${\displaystyle G(n,m)}$

In the canonical framework above, constraints were imposed on ensemble-averaged quantities ${\displaystyle \langle Q_{j}\rangle }$. Although these properties will on average take on values specifiable by appropriate setting of ${\displaystyle \{\psi _{j}\}_{j=1}^{J}}$, each specific instance ${\displaystyle G}$ may have ${\displaystyle Q_{j}(G)\neq q_{j}}$, which may be undesirable. Instead, we may impose a much stricter condition: every graph with nonzero probability must satisfy ${\displaystyle Q_{j}(G)=q_{j}}$ exactly. Under these "sharp" constraints, the maximum-entropy distribution is determined. We exemplify this with the Erdős–Rényi model ${\displaystyle G(n,m)}$.

The sharp constraint in ${\displaystyle G(n,m)}$ is that of a fixed number of edges ${\displaystyle m}$,[8] that is ${\displaystyle |\operatorname {E} (G)|=m}$, for all graphs ${\displaystyle G}$ drawn from the ensemble (instantiated with a probability denoted ${\displaystyle \mathbb {P} _{n,m}(G)}$). This restricts the sample space from ${\displaystyle {\mathcal {G}}_{n}}$ (all graphs on ${\displaystyle n}$ vertices) to the subset ${\displaystyle {\mathcal {G}}_{n,m}=\{g\in {\mathcal {G}}_{n};|\operatorname {E} (g)|=m\}\subset {\mathcal {G}}_{n}}$. This is in direct analogy to the microcanonical ensemble in classical statistical mechanics, wherein the system is restricted to a thin manifold in the phase space of all states of a particular energy value.

Upon restricting our sample space to ${\displaystyle {\mathcal {G}}_{n,m}}$, we have no external constraints (besides normalization) to satisfy, and thus we'll select ${\displaystyle \mathbb {P} _{n,m}(G)}$ to maximize ${\displaystyle S[G]}$ without making use of Lagrange multipliers. It is well-known that the entropy-maximizing distribution in the absence of external constraints is the uniform distribution over the sample space (see maximum entropy probability distribution), from which we obtain:

${\displaystyle \mathbb {P} _{n,m}(G)={\frac {1}{|{\mathcal {G}}_{n,m}|}}={\binom {\binom {n}{2}}{m}}^{-1},}$

where the last expression in terms of binomial coefficients is the number of ways to place ${\displaystyle m}$ edges among ${\displaystyle {\binom {n}{2}}}$ possible edges, and thus is the cardinality of ${\displaystyle {\mathcal {G}}_{n,m}}$.

## Generalizations

A variety of maximum-entropy ensembles have been studied on generalizations of simple graphs. These include, for example, ensembles of simplicial complexes ,[9] and weighted random graphs with a given expected degree sequence [10]