## 2 Materials and Methods
### Epidemic Spread on Networks  
In order to explore the epidemic behavior in a population, the disease dynamics have to be defined. When modeling epidemic spread in networks, individuals or sub-populations are represented by nodes and the contact patterns amongst them are encoded by the edges of the network. In the following we will consider the standard compartmentalization approach in which nodes exist in a certain number of discrete states such as susceptible, infected or permanently recovered. The paradigmatic epidemiological model we considered is the susceptible- infected-removed (SIR) model [19; 20], where nodes can have the following status: susceptible \(S\), infected and infectious \(I\), and recovered or removed \(R\). At any instant, the network's state is given by the statuses of all \(N\) nodes. Thus, there are \(3N\) states in the SIR model. That is, the state space consists of N-tuples of symbols from the set \(S,I,R\). The rates of change of the nodes' statuses are determined by the state changes over time and the infection and recovery processes [21]. For the stochastic formulation \(S(t)\), \(I(t)\), and \(R(t)=N-S(t)-I(t)\) represent random variables that take values from the set \(\{0,1,\ldots,N\}\). The focus of the model is then on determining evolution equations for the probabilities of observing a particular number of susceptible, infected and recovery nodes at a given time t. The transitions between states are given by:  
\[ \begin{split}&(S,I,R)\xrightarrow{\beta SI}(S-1,I+1,R)\\ &(S,I,R)\xrightarrow{\gamma I}(S,I-1,R+1)\end{split}  \tag{3}\]  
where \(\beta\) is the transmission rate, i.e., the rate at which the infection is transmitted across a link between a an infected node and a susceptible node, \(\gamma\) is the recovery rate, i.e., the rate at which each infected node recovers independently of all others of the network. It is worth noting that this model assumes that each node can contact or it is in contact with any other nodes by means of the network topology. In addition, both infection and the recovery processes are Markovian as:  
* transmission from an infected node to a susceptible node occurs across an edge as a Poisson process with rate \(\beta\);
* an infected node recovers by following a Poisson process with rate \(\gamma\). For unweighted networks with a SIR disease spreading across edges, the evolution equations are given by:  
\[\dot{p}_{ij}(t)=\beta(i+1)(j-1)p_{i+1,j-1}-(\beta ij+\gamma j)p_{i,j}+\gamma( j+1)p_{i,j+1} \tag{4}\]  
where \(p_{i,j}(t)\) is the probability that there are \(i\) susceptible, \(j\) infected and \(N-(i+j)\) recovered nodes at time \(t\), with \(0\leq i+j\leq N\). In our analysis we consider weighted networks in which each edge weight \(w_{ij}\) quantifies the mobility rate between each couple of nodes \(i\) and \(j\). Hence, in order to take into account both the topology and the dynamic flows over the network, we included the normalized edge weights into the epidemic model by using an edge-based transmission rate:  
\[\beta_{ij}=\beta w_{ij} \tag{5}\]This definition lead to a dynamic infection process in which the probability \(p_{i,j}(t)\) is modulated by the commuting flow over the edge connecting nodes \(i\) and \(j\). Thereby, the final evolution equations are given by:  
\[\dot{p}_{i,j}(t)=\beta_{ij}(i+1)(j-1)p_{i+1,j-1}-(\beta_{ij}ij+\gamma j)p_{i,j}+ \gamma(j+1)p_{i,j+1} \tag{6}\]  
An important parameter for the analysis of an epidemic outbreak is the basic reproductive number \(R_{0}\), which relates to the number of secondary infected cases generated by a primary infected individual [19]. Under the assumption of the homogeneous mixing of the population, the basic reproductive number is defined as:  
\[R_{0}=\frac{\beta}{\gamma} \tag{7}\]  
Thus, from Equation (7) it is evident that any epidemic will spread across a non-zero fraction of the population only for \(R_{0}>1\). Indeed, in this case, the epidemic spread generates a number of infected individuals larger than those who recover.