sequence and the strength sequence are specified [@mastrandrea2013enhanced], we choose $$\label{cons}
\{C_i\}\equiv\{k_i,s_i\}$$ where $k_i$ stands for the $i$-th node degree and $s_i$ for the $i$-th node strength.

Secondly, we need to find the analytical expression for the probability $P(W)$ that (under the chosen constraints) maximizes the Shannon-Gibbs entropy $$S(W)\equiv -\sum_W P(W) \ln P(W)$$ over the ensemble of allowed networks. Note that $P(W)$ stands for the occurrence probability of the graph $W$ in the ensemble of allowed weighted graphs, and the sums are over all such graphs. For our purposes, the allowed graphs are all the undirected networks with $N$ vertices and non-negative integer edge weights. Each such network is uniquely specified by its $N\times N$ symmetric weight matrix $W$, where the entry $w_{ij}=w_{ji}\in\mathbb{N}$ represents the weight of the link connecting nodes $i$ and $j$. The maximization of Shannon’s entropy is done under the constraints $\sum_W P(W) =1$ (this ensures the normalization of the probability) and $\langle C_i\rangle\equiv\sum_W P(W)C_i(W)=C_i$ for all $i$ (this fixes the desired structural properties). The formal solution [@Squartini_Garlaschelli_2011] of this constrained maximization problem can be written as $$P(W|\vec{\theta})\equiv \frac{e^{-H(W,\vec{\theta})}}{Z(\vec{\theta})},$$ where $$H(W,\vec{\theta}) \equiv \sum_i \theta_i C_i(W)$$ is the *graph Hamiltonian* and $$Z(\vec{\theta})\equiv \sum_W e^{-H(W,\vec{\theta})}$$ is the *partition function*. 