|
Algorithm 2 Simulating disease spread for a given network, A, and initial infection status of the population, s0. |
|
t=0 |
while
st(i) = 1 for some i ∈ {1, …, N} do
|
t =t + 1 |
% Infection of susceptible nodes % |
for all
i ∈ {i|st−1(i) = 0} do
|
{Count number of infected contacts} |
Set st(i) = 1 with probability p(i) = 1 − e−Cinf(i) β
|
end for
|
% Recovery of infected nodes % |
for all
j ∈ {j|st−1(j)1} do
|
Set st(j) = −1 with probability q = 1 − e−δ
|
end for
|
end while
|
|
return
ninf {Final outbreak size} |
|