Professional Documents
Culture Documents
JingxinZhang
JingxinZhang
JingxinZhang
Networks
Jingxin Zhang
May 13, 2020
Abstract
In order to simulate the heterogeneity of individual social patterns, randomness
may be added to the small-world model based on β-graphs by assigning each node
a normally-distributed degree. It turns out that, with our modified model, both the
growth rate and the final size of an epidemic are reduced.
1 Introduction
Due to the urgent and non-experimentable nature of epidemics, mathematical epidemiology
has always been an indispensable tool for us to study the spread and management of diseases.
For example, in response to the ongoing COVID-19 pandemic, many institutes have shared
their forecasts based on statistical or mathematical models with the Centers for Disease
Control and Prevention to help inform public health decisions [1].
The basic compartmental models to describe the transmission of communicable diseases
are first defined in a sequence of three papers by W.O. Kermack and A.G. McKendrick in
1927, 1932, and 1933 [2]. These models assume that each individual has an equal likelihood of
coming into contact with any other individual. However, in reality the patterns of contacts
between individuals are highly heterogeneous, and this heterogeneity can be a significant
factor in the early spread of a disease. When this is the case, the compartmental model can
be insufficient.
In the case of the 2002 SARS outbreak, for instance, the basic reproduction number R0 of
the disease, or the average number of secondary infections caused by an infected individual,
was estimated to be between 2.2 and 3.6. With these values, compartmental models predicted
that there should have been approximately between 30,000 and 10 million cases in the first
120 days of transmission in China. However, these predictions turned out to be inaccurate,
and only 782 case were reported during the initial three months [6].
In [6], L.A. Meyers and her team attribute this inaccuracy to the assumption of ho-
mogeneity of contacts between individuals in compartmental models. They point out that
there is an enormous epidemiological difference between a situation where all individuals
share similar contact patterns and a situation where most infected individuals pass the dis-
ease to only a few others but a small number pass it to dozens or even hundreds, even though
the mean value of R0 can be the same in both cases.
For this project, we will look into small-world network models for modeling epidemics,
apply them to diseases with different characteristics, and finally use them to examine how
individual social patterns may influence prediction results by adding a degree of randomness
when generating individual contact numbers.
2 Background
2.1 Compartmental Models
Compartmental models are perhaps the most widely-used tool in mathematical epidemiology.
A compartmental model analyzes an epidemic by dividing the host population into several
compartments, each containing individuals that are identical in terms of their status with
respect to the disease in question [2]. The most basic compartmental model is the SIR
model, where S stands for the susceptible, I the infectious, and R the removed. Their
relationship can be described by the following system of differential equations,
dS
= −βSI,
dt
dI
= βSI − αI,
dt
where the transmission rate is β and the recovery rate is α. The basic SIR model is used
when the disease in question confers immunity against re-infection. Many adjustments can
be made to adapt the basic SIR model to a specific disease. For example, we can add an E
class between the S class and the I class, forming a SEIR model which describes a disease
with an exposed period between becoming infected and becoming infectious.
Notice that S 0 < 0 at any time and I 0 > 0 if and only if S > α/β. If S(0) < α/β, I
decreases to zero and there is no epidemic. On the other hand, if S(0) > α/β, I first increases
to a maximum value and then decreases to zero, indicating the occurrence of an epidemic.
Therefore, the quantity βS(0)/α, called the basic reproduction number and denoted by R0 ,
is a crucial threshold quantity used to predict whether an epidemic will occur.
2
The compartmental models simplify the complicated reality by making assumptions that
allow us to examine an epidemic macroscopically. However, they don’t perform the best in all
the cases. The fact that compartmental models focus on compartments instead of individuals
indicates their assumption of random mixing of the population, meaning each individual has
an equal likelihood of coming into contact with any other individual. This is obviously not
the case in reality, and the error caused by this assumption could be non-negligible, especially
at the beginning stage of an epidemic where there are only a few infectives. Thus, network
models are introduced to solve this problem.
2.2 Networks
In network models, we refer to individuals of a population as nodes and their connections with
others as edges through which disease can spread. Also, the set of contacts of an individual
is called its neighborhood, and the size of this neighborhood is called its degree. There exist
many different network models, but we are going to only focus on random networks, lattices,
and small-world networks.
3
2.2.2 Lattices
Contrary to the random networks, the lattices are highly ordered based on different as-
sumptions. In lattices, connections exist only between adjacent individuals, emphasizing the
spatial position of individuals in a population. Thus, contacts are spatially localized, and it
requires a long chain of contacts for a disease to spread between two distant individuals. As
a result, more clustering is present and the spread of the disease is further slowed down.
3 Methodology
For this project, we wrote a program which can create β-graphs with any given parameters
with the help of Python NetworkX package. This program then served as a base for later ap-
plications. Helper methods were fully utilized when programming to make this base program
easy to modify. The code is attached below along with a selection of β-graphs generated by
the program (see Figure 3).
1 import random
2 import networkx a s nx
3
4 # c r e a t e a beta−graph o f n k−d e g r e e nodes with p r o b a b i l i t y b e t a by f i r s t
c r e a t i n g a r i n g l a t t i c e o f n k−d e g r e e nodes and then r e w i r i n g a l l e d g e s
with p r o b a b i l i t y b e t a
4
Figure 3: A selection of beta-graphs with different probability produced by
our base program
5
29 i f edge [ 1 ] − edge [ 0 ] < n / 2 :
30 node = edge [ 1 ]
31 else :
32 node = edge [ 0 ]
33 c h o i c e s = l i s t ( nx . n o n n e i g h b o r s ( graph , node ) )
34 graph . remove edge ( edge [ 0 ] , edge [ 1 ] )
35 graph . add edge ( node , c h o i c e s [ random . r a n d i n t ( 0 , l e n ( c h o i c e s ) −1)
])
36 r e t u r n graph
37
4 Applications
4.1 Applying to Epidemic Simulation
The β-graphs simulate a more realistic social pattern of the population. Therefore, we
can use them to replace the random-mixing pattern in traditional compartmental models so
that a disease can then only be transmitted through connecting edges with the corresponding
transmission rate. Furthermore, they may be used to model infectious diseases with a variety
of different characteristics.
For example, if we are dealing with an SIR disease that involves three states, Susceptible,
Infectious, and Removed, we tag 0 to susceptible nodes, 1 to infectious nodes, and 2 to
removed nodes. Similarly, for an SEIR disease that involves four states, Susceptible, Exposed,
Infectious and Removed, we only need to add a number, tagging 0 to susceptible nodes, 1
to exposed nodes, 2 to infectious nodes, and 3 to removed nodes. By tagging, we can easily
track the status of each node as well as modify our model for various diseases.
Below are two sample Python functions that can run epidemic simulations on a given
population for SIR diseases and SIER diseases respectively. Here, we track the total number
of individuals who are or have been infected to demonstrate the spread of the disease.
1 # apply beta−g r a p h s t o an SIR d i s e a s e with t r a n s m i s s i o n r a t e p and
i n f e c t i o n p e r i o d T, s t a r t i n g with k i n f e c t e d i n d i v i d u a l s
2 d e f s i m u l a t e S I R ( graph , k , p , T) :
3 n = graph . n u m b e r o f n o d e s ( )
4
5 status = [0]∗ n
6 days = [ 0 ] ∗ n
7 infected = [ ]
8 data = [ 0 ]
9
10 i n f e c t e d = random . sample ( l i s t ( graph . nodes ( ) ) , k )
11 for v in infected :
12 status [ v ] = 1
13 days [ v ] = T
14 data [ −1] = data [ −1] + 1/n
15
16 while len ( infected ) > 0:
17 data . append ( data [ − 1 ] )
18 new infected = [ ]
6
Figure 4: A sample plot representing the spread of an SIR disease and an
SIER disease produced by our algorithm. The β-graphs have 10000 6-degree
nodes and a rewiring probability of 0.01. The SIR disease has a transmission
rate of 0.1 and an infection period of 14 days, starting with 3 infected individ-
uals. The SIER disease has an exposed period transmission rate of 0.05, an
infection period transmission rate of 0.1, an exposed period of 7 days, and an
infection period of 7 days, starting with 3 infected individuals.
19 f o r node i n i n f e c t e d :
20 f o r v i n l i s t ( nx . a l l n e i g h b o r s ( graph , node ) ) :
21 i f s t a t u s [ v ] == 0 and random . random ( ) < p :
22 n e w i n f e c t e d . append ( v )
23 status [ v ] = 1
24 days [ v ] = T
25 data [ −1] = data [ −1] + 1/n
26 days [ node ] = days [ node ] − 1
27 i f days [ node ] < 1 :
28 i n f e c t e d . remove ( node )
29 s t a t u s [ node ] = 2
30 infected = infected + new infected
31
32 r e t u r n data
33
34 # apply beta−g r a p h s t o an SIER d i s e a s e with exposed p e r i o d t r a n s m i s s i o n
r a t e p1 , i n f e c t i o n p e r i o d t r a n s m i s s i o n r a t e p2 , exposed p e r i o d T1 and
i n f e c t i o n p e r i o d T2 , s t a r t i n g with k i n f e c t e d i n d i v i d u a l s
35 d e f run model SEIR ( graph , k , p1 , p2 , T1 , T2) :
36 n = graph . n u m b e r o f n o d e s ( )
37
38 status = [0]∗ n
39 days = [ 0 ] ∗ n
40 exposed = [ ]
41 infected = [ ]
7
42 data = [ 0 ]
43
8
duced a degree of randomness in space which turns out to have a great influence on the
results. It is then natural to think about further introducing a noise for individual social
patterns in order to investigate whether or not it will have a great influence on our model
as well.
In order to look into this problem, we modified the β-graphs in our base program, assign-
ing each node a normally-distributed degree instead of a fixed one. Then, we ran experiments
with populations of different sizes using the algorithm for SIR diseases and compared the
results with the original β-graphs.
From the results above in Figure 5, we observe that, after introducing the new noise
to individual social patterns, the epidemic proceeds more slowly and ends with fewer total
infections, even though the average degree of the nodes is the same as the original fixed
degree. Also, the difference is more significant with larger populations. In the case of 10000
9
people, the difference reaches as high as about 15% of the whole population. This experiment
reveals that the heterogeneity in individual social patterns has a considerable impact in the
course of an epidemic, and it may suggest that including this heterogeneity in our future
models can help us make predictions closer to reality.
5 Conclusions
Traditional compartmental models largely simplify problems in real world, allowing them
to become widely-used tools for modeling epidemics. However, they assume an unrealistic
random-mixing of the population, often leading to overly pessimistic predictions. The small-
world models, on the other hand, simulate social patterns more realistically by emphasizing
the effects of both the spacial positions of individuals and the possibility of long-range
transmission events, thus potentially improving the accuracy of their predictions. In this
project, we added random noise to the degree of individual nodes in small-world models
and found compelling evidence that the heterogeneity in individual social patterns further
reduces the growth rate and the final size of an epidemic in prediction results. We may
manage to perform better predictions with our modified small-world model, and our next
question will be how to obtain a good enough estimation of the rewiring probability β and
the mean degree k of a given population.
References
[1] Covid-19 forecasts, May 2020.
[2] L. J. Allen, F. Brauer, P. Van den Driessche, and J. Wu, Mathematical epi-
demiology, vol. 1945, Springer, 2008.
[5] M. J. Keeling and K. T. Eames, Networks and epidemic models, Journal of the
Royal Society Interface, 2 (2005), pp. 295–307.
[7] D. J. Watts, Small worlds: the dynamics of networks between order and randomness,
vol. 9, Princeton university press, 2004.
10