Lecture With Computer Exercises: Modelling and Simulating Social Systems With MATLAB
Lecture With Computer Exercises: Modelling and Simulating Social Systems With MATLAB
Project Report
Zurich
December 2009
Eigenständigkeitserklärung
Hiermit erkläre ich, dass ich diese Gruppenarbeit selbständig verfasst habe, keine
anderen als die angegebenen Quellen-Hilfsmittel verwenden habe, und alle Stellen,
die wörtlich oder sinngemäss aus veröffentlichen Schriften entnommen wurden, als
solche kenntlich gemacht habe. Darüber hinaus erkläre ich, dass diese Gruppenarbeit
nicht, auch nicht auszugsweise, bereits für andere Prüfung ausgefertigt wurde.
2
Agreement for free-download
We hereby agree to make our source code for this project freely available for download
from the web pages of the SOMS chair. Furthermore, we assure that all source code
is written by ourselves and is not violating any copyright restrictions.
3
Contents
1 Individual contributions 5
4 Implementation 10
4.1 Generating graphs . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
4.1.1 Random graphs . . . . . . . . . . . . . . . . . . . . . . . . . . 10
4.1.2 Scale-free graphs . . . . . . . . . . . . . . . . . . . . . . . . . 11
4.1.3 Small-world graphs . . . . . . . . . . . . . . . . . . . . . . . . 12
4.1.4 Weighted small-world graphs . . . . . . . . . . . . . . . . . . . 14
4.2 Epidemic simulation . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
7 References 33
4
1 Individual contributions
The scripts for creating random and scale-free graphs were written and the simula-
tions with varying relative infectiousness and graph size performed by Marek Pechal.
The scripts for generating small-world graphs were written and the simulations with
varying infectiousness vector and mean degree of networks performed by Vincent
Jaquet. Otherwise, we have worked on the project together.
5
varied in an attempt to observe differences between diseases with and without a
latency period. Finally, simulations for different mean degrees of the network have
been performed to determine its effect on characteristics of the epidemic.
6
1. Susceptible individual i becomes infected (its state changes into I1 ) with prob-
ability given by the weighted sum of the infectiousness values of its infected
neighbours, i.e. X
Pinfection (i) = κ wij αs(j) , (1)
j
where the sum is over all infected neighbours j of the individual i, wij is the
weight of the edge connecting i and j and s(j) is the number of the disease
stage in which individual j currently is.
2. Infected individual changes its state from In to In+1 unless n = L in which case
it becomes resistant.
3. Resistant individual remains resistant.
The only stochastic step in our model is transmission of the disease. Once an
individual becomes infected, its further evolution is fully deterministic.
The relative infectiousness parameter κ has a relatively simple interpretation in
the limit κ → 0. The probability that an infected individual j infects its neighbour
i before it reaches the resistant stage is equal to
Y
L X
L
1− (1 − καn wij ) ≈ καn wij = κwij .
n=1 n=1
Therefore if the weights of the edges are just 1 (if the two vertices are connected) or
0 (if they are disconnected) then κ simply expresses the probability that the disease
will spread from one individual to its neighbour at some point in time.
7
denoted by G(N, p)) with a random number of edges fluctuating around the mean
value N (N2−1) p while the latter produces graphs with a fixed number of edges. Due
to the law of large numbers, the graphs G(N, p) and G(N, k) for k = N (N2−1) p can
be expected to be similar in many aspects.
In our simulations we adopt the second method for generating random graphs
because the possibility of choosing the number of edges exactly allows better com-
parison of our results for different types of graphs.
However, typical real-world social networks possess additional structure that is
absent in general random graphs. For example, it seems quite natural that two
people are more likely to be socially connected if they have a common acquaintance
– a property called clustering which does not exist in random graphs where the
presence or absence of an edge connecting two given vertices is independent of the
rest of the graph and its structure. Another property shared by many naturally
occuring networks is that the degrees of their vertices are often distributed according
to a power law.
To better account for these properties, various models using other types of random
graphs with correlations between edges have been devised. One of them are the
so-called scale-free graphs generated by preferential attachment. The method for
creating such graphs proposed by Barabási and Albert [1999] is based on sequential
adding of vertices where each vertex is connected to a given number of previously
placed vertices with probabilities proportional to their degrees. This means that
highly connected vertices are more likely to be linked with newly added ones.
It has been demonstrated by Barabási and Albert [1999] that the algorithm out-
lined above produces graphs with power law distributed degrees of vertices. However,
it turns out that in some real-world networks the scaling invariance breaks down at
some point and there is a certain cutoff value of the degree above which the power
law description ceases to be valid. Amaral et al. [2000] argue that this cutoff may
be explained by “aging” of the vertices or their limited capacity to form connections
which is obviously a reasonable assumption for social networks. Therefore even a
scale-free graph cannot be the ultimate model of such networks.
Another kind of random graphs which have useful properties often observed in
real-world networks are the small-world graphs. Their name suggests that their di-
ameter (maximum distance separating two vertices in the graph) grows slowly with
increasing size of the graph. Specifically, the growth is only logarithmic – this is a
feature that these graphs share with random graphs. Yet unlike random graphs, they
are highly clustered and although random in nature, they have a certain underlying
topology – similarly to real social networks whose topology is naturally given by
geography (people are more likely to have a social connection if they live near each
other). On the other hand, small-world networks do not exhibit power law distribu-
8
(a) (b)
(c) (d)
Figure 1: Examples of a random graph (a), a scale-free graph (b), a small-world graph
(c) and a weighted small-world graph (d) (weights are represented by line widths) with 50
nodes and 150 edges (corresponding to the mean degree 6.0).
9
tion of degrees. They can be created in a way described by Watts and Strogatz [1998]
by starting with some regular graph (e.g. a lattice ring) and randomly “rewiring” a
given fraction p of edges. The limiting cases p = 0 and p = 1 correspond to com-
pletely regular and completely random graphs, respectively. For some intermediate
values of p, the resulting graph has certain properties of a random graph (slowly
growing diameter) and other properties resembling a regular graph (high clustering).
4 Implementation
4.1 Generating graphs
In our implementation of the above desribed model we represented the graphs by
their adjacency matrices. Here we present the scripts for MATLAB that we used to
generate them.
We have used the short script shown above to generate random graphs with a
given number of vertices N and a given mean degree d. The N2d edges are placed
between randomly chosen pairs (j, k) of vertices. If a pair is chosen that is already
connected or if j = k then the selection step is repeated (lines 7–10). Finally, the
resulting adjacency matrix is stored as a sparse matrix to save memory (line 14).
This very simple algorithm is definitely not optimal because the same edge can be
chosen repeatedly. Especially if the required mean degree is close to the maximum
10
possible value N − 1, most tries at adding another edge will be unsuccessful and the
time efficiency of such algorithm will become extremely poor.
But since we are mainly interested in values of d which are considerably smaller
than N (we typically work with d/N < 0.1) it is very unlikely that the probabilistic
algorithm will take significantly more time than its deterministic counterpart which
would be comparatively more complicated to implement.
11
28 graph = sparse(graph);
First (lines 3–11) a complete subgraph with d + 1 edges is created (to ensure that
the mean degree is equal to d throughout the whole process) together with an N-
dimensional vector placed which marks the already placed vertices (placed(i)==1
if the vertex i has been already placed and placed(i)==0 otherwise).
Then in a loop over all remaining vertices (lines 13–27) each new vertex i is con-
nected to d/2 of the already placed (old) ones in the following way. First a vector
prob containing degrees of the old vertices is calculated (line 15). The multiplications
by placed ensure that edges connected to i are not counted and the element-wise
multiplication by ones(N,1)-graph(:,i) discards from the vector prob vertices al-
ready linked to i. Then the vector prob is normalized (line 16) to obtain probabilities
of connecting the newly added edge to the individual old vertices and one vertex is
drawn from this distribution (lines 17–22). This vertex is then linked with i and
added to the vector placed.
One obvious disadvantage of this algorithm is that it is based on adding a constant
number of edges per one vertex which means that the mean degree of the resulting
graph can only be an even number. This situation could be remedied by varying
the number of edges added at each step. However, in our simulations we only use
even values of d and therefore the simple form of this algorithm presented here is
sufficient for our purposes. A way in which an algorithm can be modified to allow
for all values1 of d is demonstrated in the next script.
12
9 end;
10 k=floor(degree+.5)/2;
11 if(floor(k)<k)
12 for i =1:2:N
13 graph(i,mod(i+floor(k),N)+1)=1;
14 end;
15 end;
16 for i=1:N
17 for j=i+1:N
18 if(graph(i,j)==1 && rand()<p)
19 graph(i,j)=0;
20 a=floor(rand()*N)+1;
21 while(graph(a,i)==1 || graph(i,a)==1 || i==a)
22 a=floor(rand()*N)+1;
23 end;
24 if(i<a)
25 graph(i,a)=1;
26 else
27 graph(a,i)=1;
28 end;
29 end;
30 end;
31 end;
...
13
In the second part of the script, some edges are added or removed to match the
required value of mean degree d if it is not a natural number, i.e. if d =
6 d′ (lines
32–61).
...
32 if degree<floor(degree+.5)
33 N_edge_removed=0;
34 N_edge_to_remove=floor((floor(degree+.5)-degree)*N);
35 while(N_edge_to_remove>N_edge_removed)
36 for i=1:N
37 for j=i+1:N
38 if(N_edge_to_remove>N_edge_removed && graph(i,j)==1 &&
39 rand()<N_edge_to_remove/(N_edge_per_vertice*N))
40 graph(i,j)=0;
41 N_edge_removed=N_edge_removed+2;
42 end;
43 end;
44 end;
45 end;
46 else
47 N_edge_added=0;
48 N_edge_to_add=floor((degree-floor(degree+.5))*N);
49 while(N_edge_to_add>N_edge_added)
50 for i=1:N
51 for j=i+1:N
52 if(N_edge_to_add>N_edge_added && graph(i,j)==0 &&
53 rand()<N_edge_to_add/(N_edge_per_vertice*N))
54 graph(i,j)=1;
55 N_edge_added=N_edge_added+2;
56 end;
57 end;
58 end;
59 end;
60 end;
61 graph = graph+graph’;
14
matrix by random numbers drawn from a uniform distribution between 0 and 2 (to
keep the mean value of each edge equal to one). Finally, the matrix is multiplied by
an appropriate factor so that the sum of weights of all edges is exactly equal to the
number of edges in the original unweighted graph.
1 function graph=weighted_edge_rnd(graph)
2
3 N_edge=0;
4 S_edge=0;
5 for i=1:length(graph)
6 for j=1+i:length(graph)
7 if(graph(i,j)==1)
8 graph(i,j)=rand;
9 graph(j,i)=graph(i,j);
10 S_edge=graph(i,j)+S_edge;
11 N_edge=N_edge+1;
12 end;
13 end;
14 end;
15 graph=(N_edge/S_edge)*graph;
1 function new_states =
2 epidemic_step(old_states, graph, disease, k);
3
4 infectiousness = zeros(length(old_states),1);
5 for individual = 1:length(old_states)
6 if (old_states(individual) > 0)
15
7 infectiousness(individual) = disease(old_states(individual));
8 end;
9 end;
10
11 prob = (graph*infectiousness)*k;
12 for individual = 1:length(old_states)
13 if (old_states(individual) > 0)
14 if (old_states(individual) == length(disease))
15 new_states(individual) = -1;
16 else
17 new_states(individual) = old_states(individual) + 1;
18 end;
19 else
20 if (old_states(individual) == 0)
21 if (rand<prob(individual))
22 new_states(individual) = 1;
23 else
24 new_states(individual) = 0;
25 end;
26 else
27 new_states(individual) = -1;
28 end;
29 end;
30 end;
16
resistant individuals at the corresponding time step.
The script repeatedly calls the function epidemic step, keeps updating the state
vector states (which has been set to initstates at the beginning), counting the
numbers of susceptible, infected and resistant individuals and storing them in the
matrix history (lines 6–10). The loop ends when the number of infected people
drops to 0.
The following simple script was used to count the numbers of individuals in the
three states S, I and R:
It takes the state vector states as a parameter and returns a 3-dimensional row
vector consisting of the counts S, I and R, respectively.
17
5 Simulation Results and Discussion
5.1 Parameters of the simulations
Our model allows us to change several free parameters of the system and study
the influence of these changes on the epidemic. For a given type of network these
parameters are: the size N of the graph, the mean degree d of its vertices, the disease
infectiousness vector (α1 , . . . , αL ) and the relative infectiousness κ.
To avoid ending up with too much data which would be quite difficult to present
here in a reasonable and logical way, we decided to choose one “default” set of these
parameters and always change only one of them at a time, observing any effects on
the character of the epidemic.
These parameters are:
• graph size: N = 400
• mean degree: d = 6.0
• infectiousness vector: (0.000, 0.000, 0.025, 0.075, 0.175, 0.225, 0.250, 0.250)
• relative infectiousness: κ = 0.5
The chosen values are not entirely arbitrary. The graph size N = 400 is small
enough to allow reasonably fast simulations while at the same time (in our opinion)
being sufficiently large to offer good statistics and to virtually exclude potential
major deviations from the “typical” structure of the particular type of graph which
could possibly occur for smaller N. The mean degree d = 6.0 is based on our
rough estimate of the number of strong social ties that an average person might
have. The time dependence of the infectiousness should describe a disease with a
moderately long incubation period, gradual onset and sudden stop. The relative
infectiousness κ = 0.5 was chosen based on results of several preliminary simulations
which suggested that this value lies in an interesting region of the parameter space
where the epidemic is neither too weak so that it “dies out” before spreading over a
significant portion of the network, neither is it too strong so that it spreads almost
deterministically.
Finally, let us remark that the initial state vector, indicating which individuals are
infected at the beginning of the epidemic, could be also regarded as a free parameter
of the system. However, for the sake of simplicity we have decided to leave it out
of our consideration by choosing the initial population to always contain only one
randomly chosen infected individual (in the state I1 ).
18
5.2 Evolution of individual epidemics
Before moving on to experimenting with varying parameters of the epidemic, we de-
cided to first inspect the character of individual epidemics in order to gain confidence
with our program.
We simulated an epidemic spreading in a random graph and a scale-free graph
with 50 vertices and displayed2 the color-encoded states of the individuals at several
chosen times. The results of the simulation are shown in figure 2.
Our next goal was to look at the time dependence of the numbers of susceptible,
infected and resistant individuals and to see how much individual epidemics differ
from each other. To this end, we simulated 20 epidemics in the same two graphs as
before and displayed the resulting time dependences in two plots in figure 3.
Although both figures 2 and 3 suggest that there might be some difference be-
tween epidemics in structurally different networks (for example that epidemics spread
slightly faster in free-scale networks than in random ones), they are not very suitable
for a closer analysis of this difference. Despite being quite illustrative and possibly
helpful for a crude assessment of basic features of the epidemic, it is rather difficult
to extract any quantitative results from them. One of the reasons is that they display
too much information about the individual epidemics whereas we would like to draw
conclusions about epidemics in the four types of networks in general.
Obviously, it is necessary to evaluate properties of the epidemics statistically and
possibly reduce the amount of information used to describe them. Therefore we have
further focused on two specific parameters of the epidemics – the fraction of affected
individuals (i.e. individuals who are resistant in the end) and the time extent of the
epidemic. Rather than simply by the number of steps between the start and the
end of the epidemic, we characterize the time extent by a quantity which we call
the epidemic time scale and define it as the average of time weighted by numbers of
infected people, i.e. P
tN (t)
Pt I , (2)
t NI (t)
where the sum is over different values of the discrete time t and NI (t) denotes the
number of infected people at time t. One can also think about this quantity as the
horizontal coordinate of the centre of mass of the area below the graph NI (t) (the
red curves in figure 3).
Before proceeding to study the epidemics statistically, we decided to check whether
it is justifiable to use only one pre-generated graph of each kind instead of generating
a new one for each simulation. In other words, we wanted to see if there are major
2
using the open source graph visualization package Graphviz
19
(a)
t=0 t = 10 t = 20
t = 25 t = 30 t = 40
(b)
t=0 t = 10 t = 20
t = 25 t = 30 t = 40
Figure 2: Example of an epidemic spreading in a random (a) and a scale-free (b) graph
with 50 vertices and a mean degree 6.0. States of the individuals for several values of
the discrete time t are represented by colors of the vertices – black corresponding to the
susceptible, red to the infected and green to the resistant state.
20
400 400
number of individuals 350 350
number of individuals
300 300
100 100
50 50
0 0
0 10 20 30 40 50 60 70 80 90 100 0 10 20 30 40 50 60 70 80 90 100
time time
(a) (b)
Figure 3: Time dependence of the numbers of susceptible (green), infected (red) and resis-
tant (blue) individuals during an epidemic in a random graph (a) and a scale-free graph
(b).
differences in the epidemic parameters for two randomly generated graphs of the
same kind.
To this end, we generated 100 different small-world graphs (we only did this
procedure for this one type of graph and assumed that the results are not much
different for the other types), ran 1000 simulations in each of them, then averaged
the time dependences of numbers of susceptible, infected and resistant individuals
over these simulations and calculated means and standard deviations of these average
values for the different graphs. Figure 4 show the resulting confidence intervals.
Since the standard deviations are relatively small, we conclude that the differences
between individual graphs will not substantially affect the statistical properties of
epidemic parameters and that it is therefore quite safe to use just a single set of
pre-generated graphs in order to save computer time.
21
400
350
300
250 susceptible
infected
Individuals
resistant
200
150
100
50
0
0 50 100 150 200
time
Figure 4: Mean values and standard deviations of averaged (over 1000 simulations) time de-
pendences of the numbers of susceptible, infected and resistant individuals for 100 different
randomly generated small-world graphs.
22
140
random
scale-free
small world
120 weighted small world
80
60
40
20
0
0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2
relative infectiousness
(a)
1
0.9
0.8
fraction of affected individuals
0.7
0.6
0.5
0.4
0.3
0.2
random
scale-free
0.1 small world
weighted small world
0
0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2
relative infectiousness
(b)
Figure 5: Parameters of the epidemics (the epidemic time scale (a) and fraction of affected
individuals (b)) for different values of the relative infectiousness κ in the four types of
networks (random – red, scale-free – green, small-world – blue, weighted small-world –
magenta).
23
epidemics spread slower. Although we could have expected this as small-world graphs
are esentially combinations of regular and random graphs (which means that their
diameter and consequently the epidemic time scale should be higher than for random
graphs) we think it is important to emphasize this difference.
One might be tempted to think that since random graphs are such a poor approx-
imation of real-world networks, replacing them with either small-world or scale-free
networks should automatically mean an improvement. In fact, the simulation shows
that this need not be the case – at least when one is interested in the speed of
epidemic spreading. If simulations with random graphs underestimate duration of
epidemics then a model with scale-free networks would be even worse. In that case it
would probably be favourable to use small-world networks. Conversely if a random
graph model overestimates the real epidemic time scale then so does a small-world
model which means that one should rather choose scale-free networks.
Nevertheless, without comparing the simulation results with some real world data,
we cannot really decide which of the two models is likely to perform better in com-
parison with the random graph model.
Another interesting results of our simulations can be seen in figure 5b. One of
them is that although the differences between the four types of graphs are not as
striking as in figure 5a, the number of individuals affected by an epidemic in a scale-
free network appears to be smaller than in other types of networks for higher values
of κ but larger when κ gets low enough (i.e. approximately κ < 0.25). This finding
is also closely related to the other noteworthy feature – there seems to be a small
but non-zero value of κ under which the disease is very unlikely to spread. On the
other hand, when κ rises above this threshold value, the average fraction of affected
individuals starts to increase quite rapidly.
To further investigate this phenomenon, we performed the same kind of simulation
but this time we sampled the values of κ only from a region of interest between 0.0
and 0.4. The resulting plot of the fraction of affected individuals is displayed in
figure 6.
Looking at this plot, we can very roughly estimate the critical values of κ to be
random 0.15 < κcrit < 0.20
scale-free 0.05 < κcrit < 0.10
small-world 0.20 < κcrit < 0.25
weighted small-world 0.25 < κcrit < 0.30
The observed value near 0.20 for random graphs can be explained theoretically by
the following argument. Let us suppose that we have an infinite random graph with
a mean degree d. The first infected individual has on average d neighbours, each of
whom will be infected with probability κ (assuming that κ ≪ 1). This implies that
the mean number of infected individuals in the second generation is κd. However,
24
0.9
random
scale-free
0.8 small world
weighted small world
0.7
0.5
0.4
0.3
0.2
0.1
0
0 0.05 0.1 0.15 0.2 0.25 0.3 0.35 0.4
relative infectiousness
Figure 6: Fraction of affected individuals for different values of the relative infectiousness κ
sampled from the region of interest around κ = 0.2 in the four types of networks (random
– red, scale-free – green, small-world – blue, weighted small-world – magenta).
the situation is slightly different with the subsequently infected individuals because
they only have d − 1 neighbours that they can infect. In an infinite random graph
the probability that two infected individuals have a common susceptible neighbour
is zero. The mean number of infected individuals in the k th generation is therefore
κd[κ(d − 1)]k−2 .
1 1
This sequence diverges if κ > d−1 and goes to 0 if κ < d−1 . Hence the critical value
1
κcrit = d−1 separates the regime in which the epidemic dies out from that where the
number of infected individuals diverges. Specifically, for our default value d = 6.0
we get exactly κcrit = 0.2.
For other types of networks, the clustering comes into play. It decreases the effec-
tive number of neigbours available for infection because some of them are common
to more than one infected individual. On the other hand, if a susceptible individual
has multiple infected neighbours, it increases the probability of disease transmission.
It is not immediately obvious which of these effects will be stronger in which type of
network. The simulations show that a scale-free graph is a more “epidemic-friendly”
environment than the other three types of networks – the epidemic can spread in it
at lower values of κ.
It is apparent that even in this aspect epidemics in scale-free and small-world
25
networks deviate from epidemics in random graphs in exactly opposite ways – the
former being more and the latter less “viable”. Also this difference must surely be
taken into account when deciding which type of network is better suited for real-world
simulations.
26
90 90
individual epidemics individual epidemics
80 mean value 80 mean value
epidemic time scale
(a) (b)
160 160
individual epidemics individual epidemics
140 mean value 140 mean value
epidemic time scale
120 120
100 100
80 80
60 60
40 40
20 20
0 0
10 100 1000 10000 10 100 1000 10000
number of vertices number of vertices
(c) (d)
Figure 7: Epidemic timescales for different network sizes. An epidemic was simulated 100
times on each of the four types of networks with 50, 100, 200, 400, 800 and 1600 vertices
and the characteristic time scale of each epidemic was measured. The points correspond to
individual epidemics on a random (a), scale-free (b), small-world (c) and weighted small-
world (d) graphs. The plots also show calculated mean values and their uncertainties. Note
the difference in scales between plots (a), (b) and (c), (d).
27
80
70
60
40
30
20 random
scale-free
10 small-world
weighted small-world
0
10 100 1000 10000
number of vertices
Figure 8: Plot of the mean epidemic time scale as a function of the network size for all
four types of networks combined from figure 7. The plot also shows logarithmic functions
fitted to the data.
Slightly more interesting results were obtained for numbers of affected individuals.
Figure 9 shows histograms of this quantity for 1000 simulations in all four types of
networks.
These histograms show that the form of the infectiousness vector almost does not
influence the number of individuals affected by the epidemic. Although this may
look like a negative result, it tells us that introducing relative infectiousness as one
of the key parameters of the model was probably a good step because – as we now
see – fraction of affected individuals turns out to be an epidemic parameter which
almost does not depend on the infectiousness vector (assuming that it is normalized
to one) but only on the relative infectiousness.
28
120 120
standard standard
long latency time long latency time
no latency time no latency time
100 100
Number of epidemics
Number of epidemics
80 80
60 60
40 40
20 20
0 0
0 50 100 150 200 250 300 350 400 0 50 100 150 200 250 300 350 400
infected individuals infected individuals
(a) (b)
120 120
standard standard
long latency time long latency time
no latency time no latency time
100 100
Number of epidemics
Number of epidemics
80 80
60 60
40 40
20 20
0 0
0 50 100 150 200 250 300 350 400 0 50 100 150 200 250 300 350 400
infected individuals infected individuals
(c) (d)
Figure 9: Histograms of numbers of affected individuals for different forms of the infec-
tiousness vector – the default one (in blue), one with long latency time (in green) and
one with no latency time (in red). The data were obtained by running 1000 simulations
for each of the four types of networks – random (a), scale-free (b), small-world (c) and
weighted small-world (d).
29
150 150
Number of epidemics
Number of epidemics
100 4 100
6
8 4
12 6
8
12
50 50
0 0
0 50 100 150 200 250 300 350 400 0 50 100 150 200 250 300 350 400
infected individuals infected individuals
(a) (b)
150 150
4
Number of epidemics
Number of epidemics
100 100
6
8
12 4
6
8
12
50 50
0 0
0 50 100 150 200 250 300 350 400 0 50 100 150 200 250 300 350 400
infected individuals infected individuals
(c) (d)
Figure 10: Histograms of numbers of affected individuals for four different values of the
mean degree – 4 (dark blue), 6 (light blue), 8 (yellow) and 12 (red). 1000 epidemics were
simulated on each of the four types of networks – random (a), scale-free (b), small-world
(c) and weighted small-world (d).
30
It seems that spreading of the epidemic is somehow inhibited for the lowest value
d = 4. This is a feature that cannot be seen in the other two types of graphs.
The number of affected individuals has an unusually high variance and a significant
fraction of epidemics fail to spread – a fact demonstrated by the pronounced peak
near the zero value. We think that this is really remarkable because for higher values
of d the histograms look quite similar to those for the other types of networks and
the spreading almost does not seem to be disrupted at all.
This is probably the strongest structure-dependent effect we have observed in
our simulations and it confirms that there indeed are certain values of parameters
of the model at which the network structure plays a crucial role in determining the
character of spreading of the epidemic.
31
to be significantly inhibited in comparison with the other networks as well as with
the situation at higher mean degree.
What we believe to be one of the most important results of our simulations is that
in most aspects epidemics in the two more complicated classes of graphs – scale-free
and small-world – deviate from epidemics in simple random networks in opposite
ways (e.g. the former spread faster and have lower infectiousness threshold while the
situation is exactly opposite for the latter). This finding demonstrates that these two
types of networks certainly are not equally suitable replacements for random graphs
in epidemic models. To decide which class of networks yields more realistic results,
one would need to carefully compare the simulations output with data on real-world
epidemics.
It would also be beneficial to run simulations with other types of small-world
networks. For instance, an interesting class of deterministically generated networks
has been described by Comellas and Sampels [2002]. In principle, it is generated by
iteratively replacing vertices of a graph with regular subgraphs. An interesting prop-
erty of this algorithm is that it allows creating small-world graphs with a prescribed
degree distribution. This means that networks could theoretically be generated that
combine the small-world property with power law degree distribution characteristic
for scale-free graphs. Also, parameters of such network could be adjusted to match
real social networks as closely as possible.
Another interesting possibility for further work on this topic could in our opinion
be simulations in lattice-based small-world networks. A big advantage of small-
world graphs is that they have a well-defined regular underlying structure. This
means that in principle one does not need to store the full adjacency matrix but only
information about reconnected edges. As a result, epidemics could be simulated in
large networks using a cellular automaton model with connections between nearest
neighbours in the lattice and few “long distance” edges which could be either fixed
or simply randomly generated at each step. Such model would include both local
spreading of the epidemic as well as transfer over longer distances mediated by traffic.
Availability of realistic and accurate epidemic models is undeniably important
for our better undestanding of epidemics and the way they spread. The possibility
of inexpensive experimenting with parameters of the model is essential for develop-
ment of efficient defence strategies against contagious diseases. Therefore we believe
that epidemic modelling is a perspective field which will further evolve but this will
surely require extensive collaboration with social sciences which could provide better
understanding of the large-scale structure of human social networks.
32
7 References
33