Lecture with Computer Exercises:
Modelling and Simulating Social Systems with MATLAB
Project Report
Epidemic spreading in a social network
Vincent Jaquet & Marek Pechal
Zurich
December 2009
Eigenst¨andigkeitserkl¨arung
Hiermit erkl¨are ich, dass ich diese Gruppenarbeit selbst¨andig verfasst habe, keine
anderen als die angegebenen Quellen-Hilfsmittel verwenden habe, und alle Stellen,
die w¨ort lich oder sinngem¨ass aus ver¨offentlichen Schriften entnommen wurden, als
solche kenntlich gemacht habe. Dar¨ub er hinaus erkl¨are ich, dass diese Gr uppenarbeit
nicht, auch nicht auszugsweise, bereits f¨ur andere Pr¨ufung ausgefertigt wurde.
Vincent Jaquet
Marek Pechal
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.
Vincent Jaquet
Marek Pechal
3
Contents
1 Individual cont ributions 5
2 Int roduction and Motivations 5
3 Description of the Model 6
3.1 Modified SEIR model of an epidemic on a gr aph . . . . . . . . . . . . 6
3.2 Types of graphs used . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
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
5 Simulation Results and Discussion 18
5.1 Parameters of the simulations . . . . . . . . . . . . . . . . . . . . . . 18
5.2 Evolution of individual epidemics . . . . . . . . . . . . . . . . . . . . 19
5.3 Dependence o n the relative infectiousness . . . . . . . . . . . . . . . . 21
5.4 Dependence o n network size . . . . . . . . . . . . . . . . . . . . . . . 26
5.5 Dependence o n the infectiousness vector . . . . . . . . . . . . . . . . 26
5.6 Dependence o n the mean degree of the network . . . . . . . . . . . . 28
6 Summary and Outlook 31
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.
2 Introduction and Motivations
Epidemics have had a huge impact on human society throughout the history. For
example plague, Spanish flu or at the moment the H1N1 flu. Each epidemic has
a different way of spreading depending of course on the type of the disease and its
characteristics like its latency time and its infectiousness. But spreading also depends
on the structure of the network, i.e. connections between individuals. For instance,
spreading of the H1N1 flu to Europe would have been much slower just one century
ago when aviation was not yet a common way of transport. By using computer
simulations it should be possible to model such epidemic phenomena and to better
understand the role played by the different parameters. Such simulations can then
be used to study potentia l measures that can be taken to prevent or at least hinder
the epidemic from spreading.
In simple models, the rate of epidemic spreading is often represented by the so-
called basic reproduction number R
0
which is the mean number of secondary cases
caused by a single infected individual. In general, R
0
varies a lot depending on the
geographical location (particularly on people’s life style), the season, the density
of population and other parameters. In this project, we try to develop a simple
epidemic model in graphs (implemented in MATLAB) which also takes into account
the network structure and several other parameters. We believe that by using more
parameters, o ne could obtain a better match with real epidemic cases.
Four different types of network were used in our project to represent different
structures of connections between individuals: random, scale-free, small-world and
small-world with weighted edges. We have varied several free parameters of the
graphs and diseases to study their role in disease spreading, for example to find out
whether the speed of disease spreading and the number of affected individuals will
change. The size of the networ k has also been modified to determine how epidemics
in small networks relate to epidemics in large ones. Variations in infectiousness of the
disease have also been studied to see if there is some minimum value of this parameter
under which the epidemic does not spread and to determine what effects its changes
have on spreading of the disease. Then the latency period of the disease has been
5