Sunday, July 5, 2020

Network Disease Spread Simulator

The Network Disease Spread Simulator uses a modified Breadth-First Search (BFS) algorithm, to simulate the infection spread throughout the network. This simulator is based on an in-class project I worked on alongside Aditya Pimplaskar and Daniel Koo.
By adjusting multiple variables, such as fatality rate, and transmission rate, you can observe day-by-day progression of a disease throughout a random graph.


At the start of each day, we start a BFS algorithm from each infected node in the queue. Infected nodes might infect healthy nodes they encounter at the specified rate. Once BFS terminates, we perform a pass through each node. During the pass, based on the node's current sttus, they may go into quarantine, or break quarantine, develop symptoms, recover, or die. At the end of each pass, all infected nodes NOT in quarantine, are added back to the queue, and the algorithm is repeated each day, for 56 days (8 weeks).

Variables:

Constant Parameters:
These parameters are constant across all nodes.

Number of Nodes: Number of nodes in the random graph.
Edge Probability: Probability of an edge forming between any two nodes.
Fatality Rate: Probability of an infected node dying from the disease. When the graph is formed, a percentage of nodes based on Fatality Rate are predisposed to death if they were to get infected.
Transmission Probability: Probability of the disease passing to a healthy node from an infected node if there's an edge between them.
Immunity Parameter: Immunity level of those who have recovered from the disease. 0 is no immunity, 1 is total immunity.

Distributed Parameters:
These parameters are randomly distributed using Gamma Distribution. Each node gets a unique parameter to account for the diversity of experience in dealing with the disease. Scale parameter controls how spread out the distribution is. Higher the scale, more spread out it is.

Days Until Symptoms: Average number of days until symptom onset
Days Until Recovery: Average number of days until recovery (if the node is NOT predisposed to die)
Days Until Death: Average number of days until death from the day of symptom onset (if the node is predisposed to die)

Quarantine: Nodes in quarantine are cut off from the rest of the network and cannot infect or be infected, however if they have already been infected - they might recover or die.


Days Until Quarantine: Average number of days until the node goes into quarantine.
Days Until Breaking Quarantine: Average number of days until the node breaks quarantine.