How infections spread in a social network: COVID-19
By: Parul Maheshwari
Tags: Coronavirus, Network, Covid 19, Modeling, Social Network

What better way to use quarantine time than to do a network analysis of what is causing this lockdown and the resultant quarantine?

In this post, we’ll go over the well-known network dynamics of infection spreading [1]. After understanding them and implementing them on a toy network, we will implement COVID-19 relevant numbers on a social network of a larger size. Since it is hard to extract a social network, we’ll assume that it is a Barabasi-Albert (BA) graph of the same size [2]. It has been shown in previous research articles that social networks follow the power-law dynamics of BA networks hence it makes a good analysis model for this post. The same analysis can be done on real social networks as well.

Constructing the social network. The social network will comprise of nodes and edges where nodes represent people and edges represent a relationship where there is a good possibility of in-person interaction between them. For example neighbors, colleagues, family members would be linked to each other by edges. For this reason, extracting a social network of tweets or Facebook wall posts will not serve the same purpose. We will start with a network of who knows who in a small neighborhood, i.e., there is an edge between two people if they know each other and live in the same neighborhood. We do not necessarily meet everyone we know every day and for this reason, we will consider a meeting fraction detailed later in this post. We will use the preferential attachment method to construct this social network [2]. Preferential attachment means a new node in the network will connect to other nodes in the network with a probability proportional to their existing degree. In other words, the node in the network with most node-neighbors will be most likely to create a link with a new node. If you are new to a town and you’re trying to make friends, you are most likely to be introduced to someone who has many friends in the town. Consider a network with only three nodes: A, B, and C. A new node, which we label as 1 comes into this network. This new node connects to two of the three nodes at random with a higher probability for a high degree node. In this case, all the nodes A, B, and C have the same degree and hence the node 1 picks any two of these three nodes at random — as a result, this node connects to nodes A and B. Then, another node, labeled 2 is introduced to the network. This node picks two of the nodes A, B, C, and 1 each with degrees 3, 3, 2, and 2 respectively. I ran this code on a computer and the random chance results in node 2 connecting with nodes A and C. Note that the highest degrees at this point is of nodes A and B but since we are choosing nodes at random with probability proportional to the degree, C can also get picked. Thereafter, another node 3 is introduced to the network which connects with nodes A, B, and C.

This network generation model is called the Barabasi-Albert preferential attachment model and I’ll use the networkx package in python to implement it. The figure below shows a BA network with 200 edges. The size and the color of the node denote its degree. A node with a bigger size and darker shade of blue has more edges than a smaller size and lighter shade of blue node. The nodes with very high degrees in a network are called “hubs”.

Spread of infectious disease on a network

We’ll try to understand the spreading of infectious disease on a social network. There are various models of epidemic spreading, read more here. We’ll start with a simple model on networks, the SIR model, where a fraction of the population is Susceptible to catching the infection, that is, everyone who is currently healthy and hasn’t been infected; another fraction is Infected, that is, people who currently have the infection; and a fraction is Removed, that is, people who are removed from the two groups because they became infected and recovered and are now immune or people who died from the disease. For illustration, we will start with a Barabasi-Albert network model of 600 nodes, for example, a network of people living in a housing complex. We’ll assume that to start with, 10 people in the building caught an infectious disease and they have a likelihood of spreading it to people they come in physical contact with. In a world without social distancing, we will assume that a person interacts with a certain fraction of everyone she knows in one day. My guesstimate on this fraction would be 10%. For the fun sake of it, we assume that this infectious disease kills 60% of the people who get it at the end of 6 days of being infected and the other 40% become immune. Running this simulation for 35 days leads to the outbreak completing its course resulting in almost everyone infected at least once hence killing nearly 60% of the total population and the other 40% surviving and becoming immune to further infection. The network evolution resulting from simulations using these numbers is in the gif below. The green nodes are healthy and susceptible, the red nodes are the infected ones, the black nodes are dead and the blue nodes are recovered from the infection and hence immune.

The timeseries plot of the number of healthy, infected, immune, and dead people over time tells how the outbreak will likely die out. It is interesting to note that once the infection dies out, that is, the number of infected people goes down to zero, some people still stay healthy. In other words, the outbreak can lead to some people never catching the infection. To think about it, it would be the best idea to ensure that the most vulnerable form this group of people ensuring the least deaths.

COVID-19 case

The current pandemic of COVID-19 is different in many ways. There are two cases to consider, one is where there is still no social distancing which is the beginning of the spread in many countries and the other is where there is social distancing. The case without social distancing would have the same transmission rate as we used in the toy model above, that is, 10%. When everyone is practicing a great extent of social distancing, this rate would reduce — I estimate it at 2.5%. The death rate of COVID-19 is nearly 5% in the US. However, not all of the other 95% are becoming immune since we have been hearing cases of re-infection. I’ll assume that 85% become immune and the other 10% become susceptible again. Another modification is based on that the patients who die from COVID-19, do so within a week but those who survive and recover need 14 days to become uninfected. Since the COVID-19 evolution rate is expected to be much slower, we will consider a network of 10000 nodes. With these updated numbers, running the simulation for 60 days where the lockdown started after 20 days after the beginning of the outbreak, we get the following results.

The time-series plot above shows how the numbers vary over a 60 day period for the COVID-19 case. The vertical grey line is the time when the lockdown became effective drastically reducing the transmission probability. It is interesting to note that while the lockdown causes kinks in the plot the next day, there is another kink in the number of deaths plot ~6 days after, which is the time after which the sick people who cannot recover die. There is yet another kink in the plots of immune plot and infected plot ~14 days after, which is the time taken by an infected person to get rid of the virus. This shows that in the long run, ~70% of the entire neighborhood will be infected and some ~5% will die from the infection. We can also clearly see the lockdown leads to a reduction in numbers.

We can look at disease spread mechanisms on various other network models or even on the data of real social networks. There were various assumptions in this analysis which can be improved by the match of the predictions with real-time data. We can also involve node attributes to find the vulnerability of a particular person to this disease. The parameters we use here will vary with location. In particular, the death rate would be dependent on the quality of healthcare in the neighborhood. Hopefully, these would make a future post. Till then, stay safe! :)

References:

1. Newman, Mark EJ. “Spread of epidemic disease on networks.” Physical review E 66.1 (2002): 016128.

2. Barabási, Albert-László, and Réka Albert. “Emergence of scaling in random networks.” science 286.5439 (1999): 509–512.