Epidemic modelling of COVID-19 has been used to inform public health officials across the globe and the subsequent decisions have significantly affected every aspect of our lives, from financial burdens of closing down businesses and the overall economical crisis, to long term affect of delayed education, and adverse effects of confinement on mental health. Given the huge and long-term impact of these models on almost everyone in the world, it is crucial to design models that are as realistic as possible to correctly assess the cost benefits of different intervention strategies. Yet, current models used in practice have many known issues. In particular, the commonly-used compartment based models from classical epidemiology do not consider the structure of the real world contact networks. It has been shown previously that contact network structure changes the course of an infection spread significantly (Keeling 2005; Bansal, Grenfell, and Meyers 2007) . In this paper, we demonstrate the structural effect of different underlying contact networks in COVID-19 modelling. Standard compartment models assume an underlying ER contact network, whereas real networks have a non-random structure as seen in Montreal Wifi example. In each network, two infected patients with 5 and 29 edges are selected randomly and the networks in comparison have the same number of nodes and edges. In Wifi network, infected patients are highly likely to spread their infection in their local communities while in ER graph they have a wide-spread reach.
Non-pharmaceutical Interventions (NPIs) played a significant role in limiting the spread of COVID-19. Understanding effectiveness of NPIs is crucial for more informed policy making at public agencies (see the timeline of NPIs applied in Canada in Table 2 ). However, the commonly used compartment based models are not expressive enough to directly study different NPIs. For example, Ogden et al. (2020) described the predictive modelling efforts for COVID-19 within the Public Health Agency of Canada. To study the impact of different NPIs, they used an agent-based model in addition to a separate deterministic compartment model. One significant disadvantage of the compartment model is its inability to realistically model the closure of public places such as schools and universities. This is due to the fact that compartment models assume that each individual has the same probability to be in contact with every other individual in the population which is rarely true in reality. Only by incorporating real world contact networks into compartment models, one can disconnect network hubs to realistically simulate the effect of closure. Therefore, Ogden et al. (2020) need to rely on a separate stochastic agent-based model to model the closure of public places. In contrast, our proposed CGEM is able to directly model all NPIs used in practice realistically.
In this work, we propose to incorporate structural information of contact network between individuals and show the effects of NPIs applied on different categories of contact networks. In this way, we can 1) more realistically model various NPIs, 2) avoid the imposed homogeneous mixing assumption from compartment models and utilize different networks for different population demographics. First, we perform simulations on various synthetic and real world networks to compare the impact of the contact network structure on the spread of disease. Second, we demonstrate that the degree of effectiveness of NPIs can vary drastically depending on the underlying structure of the contact network. We focus on the effects of 4 widely adopted NPIs: 1) quarantining infected and exposed individuals, 2) social distancing, 3) closing down of non-essential work places and schools, and 4) the use of face masks. Lastly, we simulate the effect of re-opening strategies and show that the outcome will depend again on the assumed underlying structure of the contact networks.
To design a realistic model of the spread of the pandemic, we also used a wifi hotspot network from Montreal to simulate real world contact networks. Given our data is from Montreal, we focus on studying Montreal timeline but the basic principles are valid generally and CGEM is designed to be used with any realistic contact network. We believe that CGEM can improve our understanding on the current COVID-19 pandemic and be informative for public agencies on future NPI decisions.
Summary of contributions:
• We show that structure of the contact networks significantly changes the epidemic curves and the current compartment based models are subject to overestimating the scale of the spread • We demonstrate the degree of effectiveness of different NPIs depends on the assumed underlying structure of the contact networks
• We simulate the effect of re-opening strategies and show that the outcome will depend again on the assumed underlying structure of the contact networks Reproducibility: Code for the model and synthetic network generation are in supplementary material. The real-world data can be accessed through the original source.
Different approaches have accounted for network structures in epidemiological modelling. Degree block approximation (Barabási et al. 2016 ) considers the degree distribution of the network by grouping nodes with the same degree into the same block and assuming that they have the same behavior. Percolation theory methods (Newman 2002) can approximate the final size of the epidemic for networks with specified degree distributions. Recently, Sambaturu et al. (2020) (Vogel 2020; Lawson et al. 2020) design effective vaccination strategies based on real and diverse contact networks. Various modifications are made to the compartment differential equations to account for the network effect (Aparicio and Pascual 2007; Keeling 2005; Bansal, Grenfell, and Meyers 2007) . Simulation-based approaches are often used when the underlying networks are complex and mathematically intractable. Grefenstette et al. (2013) employed an agent-based model to simulate the dynamics of the SEIR model with a census-based synthetic population. The contact networks are implied by the behavior patterns of the agents. Chen et al. (2020) adopted the Independent Cascade (IC) model (Saito, Nakano, and Kimura 2008) to simulate the disease propagation and used Facebook network as a proxy for the contact network. Social networks, however, are not always a good approximation for the physical contact networks. In our study, we attempt to better ground the simulations by inferring the contact networks from wifi hub connection records. Table 2 : CGEM can realistically model all NPIs used in practice while existing models miss one or more NPIs period), prevalence of hospital admissions and ICU use, and death. They assumed the effect of physical-distancing measures were to reduce the number of contacts per day across the entire population. In addition, enhanced testing and contact tracing were assumed to move individuals with nonsevere symptoms from the infectious to isolated compartments. In this work, we also examine the effect of closure of public places which is difficult to simulate in a realistic manner for standard compartment models. Ogden et al. (2020) described the predictive modelling efforts for COVID-19 within the Public Health Agency of Canada. They estimated that more than 70% of the Canadian Population may be infected by COVID-19 if no intervention is taken. They proposed an agent-based model and a deterministic compartment model. In the compartment model, similar to Tuite, Fisman, and Greer (2020), effects of physical distancing are modelled by reducing daily per capita contact rates. The agent model is used to separately simulate the effects of closing schools, workplaces and other public places. In this work, we compare the effects all NPIs used in practice through a unified model and show how different contact networks change the outcome of NPIs. In addition, Ferguson et al. (2020) employed an individual-based simulation model to evaluate the impact of NPIs, such as quarantine, social distancing and school closure. The number of deaths and ICU bed demand are used as proxies to compare the effectiveness of NPIs. In comparison, our model can directly utilize contact networks and we also model the impact of wearing masks. Block et al. (2020) proposed three selective social distancing strategies based on the observations that epidemic dynamics depends on the network structure. The strategies aim to increase network clustering and eliminate shortcuts and are shown to be more effective than naive social distancing. Reich, Shalev, and Kalvari (2020) proposed a selective social distancing strategy which lower the mean degree of the network by limiting super-spreaders. The authors also compared the impact of various NPIs, including testing, contact tracing, quarantine and social distancing. Neural network based approaches (Soures et al. 2020; Dan-dekar and Barbastathis 2020) are also proposed to estimate the effectiveness of quarantine and forecast the spread of the disease.
In a classic SEIR model, referred to as base SEIR, the dynamics of the system at each time step can be described by the following equations (Aron and Schwartz 1984) :
where an individual can be in one of the 4 states: (S) susceptible, (E) exposed, (I) infected and can infect nodes that are susceptible, and (R) recovered at any given time step t. β, σ, γ are the transition rates from S to E, E to I, and I to R respectively.
Similarly, in CGEM, an individual can be either S susceptible, E exposed, I infected or R recovered. We do not consider reinfection, but extensions are straightforward. Unlike the equation-based SEIR model which assumes homogeneous mixing, CGEM takes into account the contact patterns between the individuals by simulating the spread of a disease over a contact network. Each individual becomes a node in the network and the edges represent the connections between people.
Algorithm 1 shows the pseudo code for CGEM 1 . Given a contact network, we assume that a node comes into contact with all its neighbours at each time step. More specifically, at each time step, the susceptible neighbours of infected individuals will become infected with a transmission probability φ, and enter the exposed state (illustrated below). We randomly select exposed nodes to become infected with probability σ and let them recover with a probability γ. (Barabási et al. 2016) , the parameters of the synthetic graph generation could be adjusted to produce graphs with same sizes thus facilitating a fair comparison between different structures. We discuss details in the following sections.
Inferring Transmission Rate By definition, β represents the likelihood that a disease is transmitted from an infected to a susceptible in a unit time. Barabási et al. (2016) assumes that on average each node comes into contact with k neighbors, then the relationship between β and the transmission rate φ can be expressed as:
where k is the average degree of the nodes.
In the case of a regular random network, all nodes have the same degree, i.e. k = k and equation 1 can be reduced into: β = k · φ (2) The homogeneous mixing assumption made by the standard SEIR model can be well simulated by running CGEM over a regular random network, we propose to bridge the two models with the following procedure: 1. Fit the classic SEIR model to real data to estimate β. 2. Run CGEM over regular random networks with different values of k and with φ derived from equation 2.
3. Choose k = k * which produce the best fit to the predictions of the classic SEIR model.
The regular random network with average degree k * would be the contact network the classic SEIR model is approximating and φ * = β/k * would be the implied transmission rate. We will use this transmission rate for other contact networks studied, so that the dynamics of the disease (transmissibility) is fixed and only the structure of contact graph changes.
Tuning Synthetic Network generators As a proxy for actual contact networks which are often not available, we can pair CGEM with synthetic networks with more realistic properties, comparable to real world networks e.g. heavy-tail degree distribution, small average shortest path, etc. To adjust the parameters of these generators, we can reframe the problem as: given transmission rate φ * and population size n, are there other networks which can produce the same infection curve? For this, we can carry out similar procedures as above. For example, we can run CGEM with transmission rate φ * over scale-free networks generated from different values of m BA , where m BA is the number of edges a new node can form in the Barabasi Albert algorithm (Barabási et al. 2016) . m BA which produces the best fit to the infection curve gives us a synthetic contact network that is realistic in terms of number of edges compared to the real contact network.
Here we explain how different NPIs can be modelled directly in CGEM as changes in the underlying structure.
Quarantine How can we model the quarantining and selfisolation of exposed and infected individuals? Exposed individuals have come into close contact with an infected person and are considered to have high risk of contracting. In an ideal world, most, if not all, infected individuals would be easily identifiable and quarantined. However, in reality, over 40% (He et al. 2020 ) of infected cases are asymptomatic and not all are identified immediately or at all and therefore can go on to infect others unintentionally. To account for this in our model, we apply quarantining by removing all edges from a subset of exposed and infected nodes.
Social Distancing Social distancing reduces opportunities of close contacts between individuals by limiting contacts to those from the same household and staying at least 6 feet apart from others when out in public. In CGEM, a percentage of edges from each node are removed to simulate the effects of social distancing to different extent.
Wearing Masks Masks are shown to be effective in reducing the transmission rate of COVID-19 with a relative risk (RR) of 0.608 (Ollila et al. 2020) . We simulate this by assigning a mask wearing state to each node and varying the transmissibility, φ, based on whether 2 nodes in contact are wearing masks or not. We define the new transmission rate with this NPI, φ mask as follows:
if both nodes wearing masks m 1 · φ, if 1 node wearing masks m 0 · φ, otherwise Closure: Removing Hubs Places of mass gathering (e.g. schools and workplaces) put large number of people in close proximity. If infected individuals are present in these locations, they can have a large number of contacts and very quickly infect many others. In a network, these nodes with a high number of connections, or degree, are known as hubs. By removing the top degree hubs, we simulate the effects of cancelling mass gathering, and closing down schools and non-essential workplaces. In CGEM, we remove all edges from r% of top degree nodes to simulate the closure of schools and non-essential workplaces. However, some hubs, such as (workers in) grocery stores and some government agencies, must remain open, so we assign each hub a successful removal rate of p success to control this effect.
Compliance Given the NPIs are complied by majority but not all the individuals, we randomly assign a fixed percentage of the nodes as non-compilers. We set this to 26% in all the simulations based on a recent survey (Bricker 2020) .
Due to the economical and psychological impacts of a complete lockdown on the society, it is critical to know how safe it is to resume commercial and social activities once the pandemic has stabilized. Therefore, we also investigate the impact of relaxing each NPIs and the risk of a second wave infection. More specifically, we simulate a complete reversing of the NPIs, by adding back the edges that were removed when the NPI was applied at first, to return the underlying structure to its original form.
We compare the spread of COVID-19 with synthetic and real world networks. These networks include 3 synthetic networks, (1) the Regular random network, where all nodes have the same degree, (2) the Erdős-Reńyi random network, where the degree distribution is Poisson distributed, (3) the Barabasi Albert network, where the degree distributions follows a power law. Additionally, we analyzed 4 real world network, the USC35 network from the Face-book100 dataset (Traud, Mucha, and Porter 2012) , consisting of Facebook friendship relationship links between students and staffs at the University of Southern California in September 2005, and 3 snapshots of a real world wifi hotspot network from Montreal , a network often used as a proxy for human contact network while studying disease transmission Yang et al. 2020 ). In the Montreal wifi network, edges are formed between nodes (mobile phones) that are connected to the same public wifi hub at the same time. As shown in Table 3 , each of the 7 networks consist of 17,800 nodes, consistent with 1/100th of the population of the city of Montreal, and have between 110,000 to 220,000 edges, with the exception of the USC network. Due to the aggregated nature of the USC dataset, edge sampling is enforced during the contact phase in order to obtain reasonable disease spread. The synthetic networks are in general more closely connected than the Montreal wifi networks, despite having similar number of nodes and edges. Only the largest connected component is considered in all networks. 
The structure of the contact network plays an important role in the spread of a disease (Bansal, Grenfell, and Meyers 2007) . It dictates how likely susceptible nodes will come into contact with infected ones and therefore it is crucial to evaluate how the disease will spread on each network with the same initial parameters. Here, the classic SEIR model is fitted against the infection rates from the first of the 100th case in Montreal to April 4 to obtain β, which is before any NPI is applied. With Eq. 2, the transmission rate, φ, is estimated to be 0.0371 and is used across all networks. In all experiments, we also seed the population with the same initial number of 3 exposed nodes and 1 infected node. The parameters used to generate synthetic networks are obtained following the procedures described in the previous session. All results are averaged across 10 runs. The grey shaded region shows the 95% confidence interval of each curve. As shown in Figure 2 , the ER network fits the base SEIR model almost perfectly-compare green 'ER' and black 'base' curves.
Observation 1 CGEM closely approximates the base SEIR model when the contact network is assumed to be Erdős-Reńyi graph.
All networks drastically overestimates the spread of COVID-19 when compared with real world data. This can be expected to some degree as in this experiment we are projecting the curves assuming no NPI is in effect which is not what happened in reality (see 'Real' orange curve). However, we observe that all 3 synthetic networks, including the ER model exceedingly overshoot, showing almost the entire population getting infected, whereas the real-world wifi networks predict a 3x lower peak.
Observation 2 Assuming an Erdős-Reńyi graph as the contact network overestimates the impact of COVID-19 by more than a factor of 3 when compared with more realistic structures.
In order to limit the effects of the pandemic, the federal and provincial governments introduced a number of measures to reduce the spread of COVID-19. We simulate the effects of 4 different non-pharmaceutical interventions, or NPIs, at different strengths to determine their effectiveness. These include, (1) quarantining exposed and infected individuals, (2) social distancing between nodes, (3) removing hubs, and (4) the use of face masks.
Quarantine We apply quarantining into our model on March 23. Where both Quebec and Canadian government have asked those who returned from foreign travels or experienced flu-like symptoms to self isolate. We remove all edges from 50, 75, and 95% of exposed and infected nodes to simulate various strengths of quarantining. Figure 8 displays the effect of quarantining on different graph structures. Quarantining infected and exposed nodes both reduces and delays the peak of all infection curve. However, the peak is not delayed as much in the wifi graphs as the ER graph predicts, which is important information in planning for the healthcare system. Out of all tested NPIs, applying quarantine has the most profound reduction on all infections curves. Observation 3 Quarantining delays the peak of infection on the ER graph whereas the peak on the real world graphs are lowered but not delayed significantly. Social Distancing reduces the number of close contacts. Different degrees of 10%, 30%, and 50% of edges from each node is removed to simulate this. Figure 9 shows the effects of social distancing on the infection curves of each network structures. It is effective in reducing the peak of the pandemic on all networks but again delays the peaks only on synthetic networks. Similar to Observation 3, we have: Observation 4 Social distancing delays the peak of infection on the ER graph whereas the peak on the real world graphs are lowered but not delayed significantly. Removing Hubs We remove all edges from 1% of top degree nodes to simulate the closure of schools and 5 and 10% of top degree nodes to simulate the closure of non-essential workplaces. These NPIs are applied on March 23 respectively, coinciding with the dates of school and non-essential business closure in Quebec. p success is set to 0.8 unless otherwise stated. Figure 10 shows the effects of removing hubs. This NPI is very effective on the BA network and all 3 Montreal wifi networks since these networks have a power law degree distribution and hubs are present. However, it is not very effective on the regular and ER random networks.
Observation 5 The ER graph significantly underestimates the effect of removing hubs. Removing hubs is most effective on networks with a power law degree distribution since hubs act as super spreaders and removing them effectively contains the virus. However, no hubs are present in the ER and regular random network, and thus removing hubs reduces to removing random nodes. Luckily, real world contact networks have power law degree distributions, making a hubs removal an effective strategy in practice.
Wearing Masks we set m 2 = 0.6, m 1 = 0.8 and m 0 = 1, and use the following transmission rate, φ mask in CGEM:
if both nodes wearing masks 0.8 · φ, if 1 node wearing masks 1 · φ, otherwise
Wearing masks is only able to flatten the infection curve on the synthetic networks but does not reduce the final epidemic attack rate, the total size of population infected, as shown in Figure 11 . However, in the real world wifi networks, wearing masks is able to both flatten the curve and also significantly reduce the final epidemic attack rate.
Observation 6 The ER graph significantly underestimates the effect of wearing masks in terms of the total decrease in the final attack rate.
We experiment with reopening of all the NPIs, but for brevity we only report the results for allowing hubs, which corresponds to the current reopening of schools and public places. The results form other NPIs are available in the extended results.
For removing hubs, we apply reopening on July 18 (denoted by the second vertical line in Figure 7) , after many non-essential businesses and workplaces are allowed to open in Quebec. Because the synthetic networks estimates that most of the population would be infected before the hubs are reopened, we calibrate the number of infected and recovered individuals at the point of reopening to align with Figure 6 : Difference between cumulative curves from wearing masks and not wearing masks. The cumulative curves represent the total impact, and the different shows how much drop in final attack rate is estimated with the NPI enforced. statistics available in the real world data. Therefore the simulation continues after reopening with all the models having the same number of susceptible individuals, otherwise int the ER graph, everyone is infected at that point. We can see in Figure 7 that ER and regular random network significantly underestimates the extent of second wave infections. BA and the wifi networks all show second wave infections with a higher peak than the initial, prompting more caution when considering reopening businesses and schools.
Observation 7 ER graph significantly underestimates the second peak after reopening public places, i.e. allowing back hubs.
In this paper, we propose to model COVID-19 on contact networks (CGEM) and show that such modelling, when compared to traditional compartment based models, gives significantly different epidemic curves. Moreover, CGEM subsumes the traditional models while providing more expressive power to model the NPIs. We hope that CGEM could be used to achieve more informed policy making when studying reopening strategies for COVID-19 .