The class implements a graph data structure via an adjacency map, providing a great trade-off in performance. It allows one to do all the basic operations with nodes and edges.
The custom class constructor can generate a scale-free network following the Barabasi-Albert model with
Each time step simulates the spread and mutation of a virus via the edges of the network, starting from one patient zero. Each susceptible subject in the neighborhood of an infected individual has a probability
From a computational point of view, the status of a node is defined by an integer. Positive values mean infection (fixed values for each variant), negative values mean that the patient is recovered (decreasing each time step the subject is still recovered), and zeros for susceptible individuals.
Here are some visualizations of the coupled dynamics of a
On the left, the number of subjects susceptible, infected, or recovered in the initial time steps. After that, the system converges to a dynamic equilibrium. On the right, the rate of different variants in the population.