EPIGUI: Graphical User Interface for Simulating Epidemics on Networks

ABSTRACT This paper presents a graphical interface called EPIGUI, which allows the study of the dynamics of an infectious disease spread using compartmental models in combination with complex networks. This interface aims at considering stochastic factors that govern the evolution of an infection in a network. Moreover, it provides simple tools to create networks of agents and to define the epidemiological parameters of outbreaks. There are six common infectious disease models (SI, SIS, SIR, SIRS, SEIR, and SEIRS) or a user can provide another model, combining compartments. Moreover, in the simulations the user can either include a synthetic network generated according to a network model (random, small-world, scalefree, modular, or hierarchical) or a real network. This approach can help understand the paths followed by outbreaks in a given community and design new strategies to prevent and to control them.


INTRODUCTION
Infectious diseases or communicable diseases have been a cause of panic since ancient times, decimating populations.They are usually caused by a biological agent (for example, virus or bacteria).Currently, the world is facing the impact of COVID-19 which, in addition to being a threat to public health, with the loss of countless lives, has brought enormous economic damage to all countries [11].Another disease that terrified the world was the black death wiping out a quarter of the European population during the years 1347-1350 [7].The number of deaths caused by the great epidemics is incomparably higher than the number of deaths caused by all wars together [2].
Considering this scenario, numerous research fronts have been developed for the understanding and prevention of infectious diseases.Mathematical epidemiology has provided essential support to political and scientific authorities, inferring information about the epidemiological impact of a vaccine, identifying which and how many agents (or individuals) should be vaccinated, verifying whether the disease under study is epidemic or endemic and making projections for the number of infected people.[5] expresses the main reason for this interest when says: "The main reasons for studying mathematical models of disease proliferation is the hope that a better understanding of transmission mechanisms can provide strategies for more effective control." Mathematical epidemiology proved to be decisive in the policy for more restrictive isolation measures in countries in Europe, such as the United Kingdom.Scientists at Imperial College London made a set of mathematical predictions that contributed to convincing Prime Minister Boris Johnson to change the course of his policy [34].In general, this document prepared epidemiological scenarios that can be synthesized taking into account the control action adopted and the expected number of deaths.In this sense, mathematical epidemiology has benefited from techniques and methodologies typical of Engineering and Exact Sciences.
With the increase in computational power, the use of software for simulating epidemics has become essential, and numerous graphic interfaces have emerged, such as, GLEaMviz [33], STEM [10], OutbreakTools [20] and epidemix [28].The epidemiological modelling used in these programs is largely based on compartmental models, that is, groups of agents who share identical properties [2,8].In particular, the sispread [1] software and the hybridModels package in R [26] have attracted attention due to the use of complex networks.Unlike the classic models of differential equations, this approach does not use the assumption of a homogeneous mixture, in which the relationships between agents are randomized.An example in which the topology of a real network cannot be described by a purely random network, was demonstrated by the SARS outbreak, where the average number of secondary cases was about two for all infected agents [24].
It is worth mentioning that sispread and hybridModels software have some limitations.Firstly, they do not consider agents to be discrete and their local interactions.Secondly, the sispread software has only three epidemiological models (SI, SIS and SIR) and three complex networks models (Random, Scale-free and Kleinberg) that can be combined, not allowing the user to implement another model and use a network of your choice (real or synthetic).Thirdly, the hybrid-Models package does not consider interactions between agents, only between sub-populations.Furthermore, it requires some knowledge about the R language.
To overcome this lack, at least partially, the software proposed in this article implements a graphical user interface for simulating epidemics using the Agent-Based Model (ABM) -EPIGUI.Our method uses a bottom-up strategy and begins by creating rules for the behaviour of agents and, based on the interaction between these agents, tries to understand the properties that emerge from the system [16].An advantage of agent-based models over traditional models is that they have a more flexible construction and can incorporate any number of agent-level mechanisms, using aspects that are difficult or impossible to represent in population-level differential equations.In addition, stochasticity and the low profile of the population can play an important role in the evolution of the system.In a model described by an Ordinary Differential Equation (ODE), each process (for example, infection and recovery) has a rate.This approach assumes that the time evolution is continuous and deterministic and the number of agents can be a non-integer number for each time which is unreal [13].Alternatively, instead of focusing on a process rate, models can be developed on agent reaction events that do not necessarily occur at regular intervals.The timing of these events is stochastic rather than deterministic [26].
The EPIGUI allows the user to simulate the spread of infectious diseases using compartmental models and complex networks.The software combines the advantages of ABM's stochasticity with the realistic contacts that complex network models or network databases can provide.Such models include random networks by [12]; small-world networks by [35]; scale-free networks by [3]; modular networks by [32] and hierarchical networks by [9].Network databases are openly available in several repositories, such as the Koblenz Network Collection (KONECT) [22] and the Stanford large network dataset collection (SNAP Datasets) [23].Finally, the interface is userfriendly, it does not require proficiency in any programming language and it is freely available on the internet.
The remainder of this paper is organized as follows: after this introduction, Sect. 2 describes the SI, SIS, SIR, SIRS, SEIR, and SEIRS compartment models, the Agent-Based Models for the compartment models previously described, as well several network models.The equivalence between each compartment model described in Sect. 2 and the corresponding Agent Based Model is built in Sect.3. The installation, platform availability, and main elements of the EPIGUI software are presented in Sect. 4. Usage examples of the EPIGUI software are described in Sect. 5.The conclusions are presented in Sect.6.

SI
The SI model divides the population into two disjoint classes, ie, the number of susceptible agents (S) and number of agents infected (I) [18].It is defined by a continuous system of two ordinary differential equations.This model (Eq.(2.1)) describes the temporal evolution of each epidemiological class, that is: where µ and β are birth/death and contact rates, respectively [18].

SIS
The SIS model admits that infected agents can recover and return to the susceptible state unlike the SI model, which assumes that agents remain infected for life [18].The SIS model is defined by a continuous system of two ordinary differential equations.This model (Eq.(2.2)) describes the temporal evolution of each epidemiological class, that is: where µ and β are the same as described in Subsection 2.1.1 and γ is the recovery rate.

SIR
The SIR model admits that infected agents can recover from the infection and acquire lifetime immunity, moving to the recovered state (R) [21].The classic SIR model is defined by a continuous system of three ordinary differential equations.This model (Eq.(2.3)) describes the temporal evolution of each epidemiological class, that is: where µ, β and γ are birth/death, contact and recovery rates, respectively.

SIRS
The SIRS model admits that recovered agents can return to the susceptible state after losing immunity over time [17,19].The SIRS model is defined by a continuous system of three ordinary differential equations.This model (Eq.(2.4)) describes the temporal evolution of each epidemiological class, that is: where µ, β and γ are the same as described in Subsection 2.1.3and ρ is the proportion of agents that lose immunity.), which can also be represented by a compartment.This new compartment was added to the SIR model due to the fact that an agent may be infected, but not yet developed the disease and infected other agents [25].The SEIR model is defined by a continuous system of four ordinary differential equations.This model (Eq.(2.5)) describes the temporal evolution of each epidemiological class, that is: where µ, β , γ, and ρ are birth/death, contact, latency and recovery rates, respectively.

SEIRS
Unlike the SEIR model, the SEIRS model admits that recovered agents can return to the susceptible state after losing immunity over time.The SEIRS model is defined by a continuous system of four ordinary differential equations [25].This model (Eq.(2.6)) describes the temporal evolution of each epidemiological class, that is: where µ, β , γ and ρ are the same as described in Subsection 2.1.5and ε is the proportion of agents that lose immunity.

Agent-Based Model (ABM)
Agent-Based Models simulate populations and communities by following agents and their properties [15].These models are developed to address important features such as agent variability, local interactions and adaptive behaviours.In the ABM, each agent in the population has a set of characteristics such as state or behaviours.According to [14], "each agent is treated as a unique and discrete entity that has age and at least one more property that changes over the life cycle, such as weight, social position, among others".
The ABM can be expressed by a P m×n matrix, where each of its rows represents an agent and each of its columns represents a characteristic.For each time step t, its matrix (population) can be represented by: As previously mentioned, this formulation is quite general, allowing to incorporate several attributes of agents.For the compartmental models SI, SIS, SIR, SIRS, SEIR, and SEIRS described in Section 2.1, and already implemented in EPIGUI, the characteristics are based on the work of [31].

SI and SIS model
In this work, the ABM for the SI model with vital dynamic consists of the following rules: • C 1 is the state of an agent regarding the epidemic (susceptible (0) and infected (1)).
• C 2 is the age of an agent (in units of time).At t = 0, C 2 = 0 and for each iteration, ∆t is added to the age.
• C 3 is the maximum age an agent can live.At the birth time, this age is obtained by: where µ abm is the life expectancy of the population and a u is a random variable uniformly distributed between 0 and 1.
The ABM for the SIS model has the same characteristics and transition rules of the SI model, except that, for SIS, two new features are added: • C 4 is the time (in units of time) that an agent gets infected.At t = 0, C 4 = 0.
• C 5 is the maximum time that an agent remains infected and it is obtained by: where γ abm is the infection period.In this work, the ABM for the SIR model with vital dynamic consists of the following rules: • C 1 is the state of an agent regarding the epidemic (susceptible (0), infected (1) and recovered ( 2)).
• C 2 is the age of an agent (in units of time).At t = 0, C 2 = 0 and for each iteration, ∆t is added to the age.
• C 3 is the maximum age an agent can live.At the birth time, this age is obtained by: where µ abm is the life expectancy of the population and a u is a random variable uniformly distributed between 0 and 1.
• C 4 is the time (in units of time) that an agent gets infected.At t = 0, C 4 = 0.
• C 5 is the maximum time that an agent remains infected and it is obtained by: where γ abm is the infection period.
The ABM for the SIRS model has the same characteristics and transition rules of the SIR model, except that, for SIRS, two new features are added: • C 6 is the time (in units of time) that an agent gets recovered.At t = 0, C 6 = 0.
• C 7 is the maximum time that an agent remains recovered and it is obtained by where ρ abm is the recovered period.
By definition, in the SIR and SIRS models, for susceptible and recovered agents C 4 = 0 and C 5 = 0 for all t ≥ 0.

SEIR and SEIRS model
In this work, the ABM for the SEIR model with vital dynamic consists of the following rules: • C 1 is the state of an agent regarding the epidemic (susceptible (0), exposed (1), infected (2), and recovered (3)).
• C 2 is the age of an agent (in units of time).At t = 0, C 2 = 0 and for each iteration, ∆t is added to the age.
• C 3 is the maximum age an agent can live.At the birth time, this age is obtained by: where µ abm is the life expectancy of the population and a u is a random variable uniformly distributed between 0 and 1.
• C 4 is the time (in units of time) that an agent gets exposed.At t = 0, C 4 = 0.
• C 5 is the maximum time that an agent remains exposed and it is obtained by: where γ abm is the exposed period.
• C 6 is the time (in units of time) that an agent gets infected.At t = 0, C 6 = 0.
• C 7 is the maximum time that an agent remains infected and it is obtained by: where ρ abm is the infected period.
The ABM for the SEIRS model has the same characteristics and transition rules of the SEIR model, except that, for SEIRS, two new features are added: • C 8 is the time (in units of time) that an agent gets recovered.At t = 0, C 6 = 0.
• C 9 is the maximum time that an agent remains recovered and it is obtained by: where ε abm is the recovered period.
For the SEIR and SEIRS models, the characteristics C 4 to C 7 are unnecessary for susceptible and recovered agents.For all models presented, at time t the numbers of susceptible, exposed, infected, and recovered agents are indicated by S(t), E(t), I(t) and R(t), respectively.Moreover, the population has a constant size, that is, N = S(t) + E(t) + I(t) + R(t) for all t ≥ 0.

Complex networks
A complex network can be described by R = (V , E ), where V = {v 1 , v 2 , . . ., v N } represents a set of N vertices or nodes and E = {e 1 , e 2 , . . ., e M } represents set of M connections or edges which connect pairs of vertices.Complex network theory relies on the use of mathematical metrics that are able to quantify different features of the network's topology, such as, the average degree (⟨k⟩), the clustering coefficient (⟨CC⟩), the shortest path length (ℓ), and the global efficiency (E) [6].Several complex networks models have been proposed in the literature with the aim of reproducing patterns of connections found in real networks [29].In this work, random, small-world, scale-free, modular and hierarchical models were used to generate undirected and unweighted networks to better understand the implications of these patterns in the propagation of a disease.
Random model (RAN) Paul Erdõs and Alfred Rényi proposed the first model of complex networks (or graphs), which became known as random graphs of Erdõs and Rényi [12].According to this model, N disconnected vertices are connected with a probability p between [0, 1].For p = 0 the network is disconnected, for p = 1 the network is fully connected, and for any 0 < p < 1 the network is random.
Small-world model (SW) Duncan Watts and Steven Strogatz analyzed empirical data of several real networks, such as the neuron network of Caernohabditis elegans and the United States power distribution network, and noted that the connections were not completely regular or completely random, however it was situated between these two extremes [35].Thus, they proposed a model that consists of an interpolation between a regular and a random network.Networks procuded by this model are highly clustered, as regular networks, but with a short path length between their nodes, as random graphs.
Scale-free model (SF) Real-world networks are often claimed to be scale-free, meaning that the degree distribution follows P(k) ≈ k −γ , where 2 ≤ γ ≤ 3. The scale-free model used in this work, proposed by Albert-Laszlo Barabasi and Reka Albert, is capable of generating scale-free networks based on the the concepts of growth and preferential attachment [3].

Modular model (MOD)
A modular network model is able to produce networks with a modular structure, that is, with edges densely distributed between vertices belonging to the same group (module) and sparingly distributed between vertices belonging to different groups.In this work, the algorithm proposed by Pratha Sah, known as random modular model, is used to create modular networks [32].

Hierarchical model (HIE)
The scale-free model previously described lacks the small-world effect that can be found in most real complex networks, i.e. its clustering coefficient is too small while the average length path remains relatively large.Hierarchical models are able to overcome this deficiency, creating networks that have similar characteristics of scale-free and small-world networks at the same time.In this work, the algorithm proposed by Peter Dodds et al. is used to create hierarchical networks [9].

REFORMULATION OF THE ABM
The set of Eqs.(3.1) is defined to guarantee the discrete nature of ABM and to follow the parameters of the models previously described in Sec.2.1.Using Eqs.(3.1), it is possible to build the equivalence between an ODE model and an ABM, in such a way that, on average, their solutions present similar behaviours [31].

INSTALLATION AND PLATFORM AVAILABILITY
The EPIGUI software is freely available on Linux and Windows operating systems.The installation size depends on the system.On Linux, it is currently around 76.

Main elements of the user interface
The main user elements and features of the EPIGUI interface are presented as follows.First, there is a dialog box that offers the user the choice between writing a system or using a predefined one.
If the user chooses to write the system, then the number n of epidemiological states in the model  must be informed.After that, n boxes will appear to be named.The number of parameters m can be chosen and named.Below the parameter descriptions, there is a "Writer System" button in which the user can write the model of equations, the initial conditions and the values of the parameters, as shown in Figure 2. Note that each variable, each parameter and each arithmetic operation written in the writer system must be separated with single spaces.
Figure 2: The EPIGUI interface.In this interface, the user is able to set up the number of compartments, parameters and write the correspondent equation.Additionally, the type of network and respective parameters are also disposable to be configured.
The epidemic model with vital dynamics can be considered.In this case, a mortality rate µ is added to all compartments, and after reaching the maximum age, agents return to the first compartment.After, the number of simulations, the time spacing and the final time must be informed.The interface allows the user to change all parameters, to run it and to see the results in plot graphs.However, the interface does not check whether the parameters values are reasonable for the simulation.
The last group of parameters to be defined corresponds to the complex network model.For illustration, the random network model with p = 1 was chosen.Other options include the small world, scale-free, modular and hierarchical network models.As previously described in Section 2.3.1, each model has at least one box to be filled out with the corresponding parameter value.Each parameter has a tooltip with its description, which is activated by placing the mouse pointer on it.At the bottom of Figure 2 there is a box with an article reference of the corresponding network model.
Finally, the user can click on the green box called "Run simulation" and a graph plot is displayed (Fig. 3a).In the example, the graph plot corresponds to the average number of agents (susceptible,  • Return to the initial settings, ie, auto-scales the graph to contain all data points for all visible sets.

•
Back to the previous view.
• Forward to the next view.
• Pan mode for axes (left mouse button) and move mode for axes (right mouse button).
• Zoom in the axis view.
After closing the network plot, a button named "Show measures" will be enabled, allowing the user to visualize six different network measures (Fig. 4) of the corresponding network (Fig. 3b). Figure 4: EPIGUI allows the user to show some basic measures of the network, which calculations are based on reference illustrated.

SEI model
The SEI model can be used for modelling the tuberculosis spread [30].The population is divided into three compartmental classes, that is, agents who have never had contact with the bacillus, called susceptible (S); agents who have the bacillus but do not develop the disease, called exposed or latent (E) and agents who develop pulmonary tuberculosis, responsible for the transmission of the disease, called infected (I).
Figure 5 presents the interaction flowchart between agents in the classes S, E and I. Parameters µ, β , δ , and ρ represent the rates of mortality, infection, exogenous infection, and relapse, respectively.A portion q of susceptible agents who contract the bacillus agent, does not develop tuberculosis in a period γ −1 after infection, while (1 − q) develops pulmonary tuberculosis.105 The following ODE system can be written based on the flowchart (Fig. 5), that is [27]: (5.1) Figure 6 shows the configuration of the EPIGUI based on Eq.(5.1), using a real infection network. 1 Note that S(0) + E(0) + I(0) has to be equal to the number of vertices in the network to properly run the interface.Figure 7a shows the average number of susceptible, exposed and infected agents, over 10 different simulations as a function of time.More specifically, the ABM solution based on Eq.(5.1) with N = 410, ∆t = 0.1, q = 0.9, γ = 0.0027, ρ = 0.0083, µ = 0.0143, δ = 0.0867, β = 4.3, S(0) = 400, E(0) = 0 and I(0) = 10. Figure 7b shows the corresponding network layout in the final time step t f = 500.Black, blue and red vertices correspond to susceptible, exposed and infected agents, respectively.Figure 8 shows the network measures of the corresponding network for the ABM.

SIRV model
The SIR model with vaccination (SIRV) is considered as a way of reducing epidemic incidences.In this model, there is a class of vaccinated agents (V), that is, agents who are not infected, are vaccinated and acquire temporary immunity, besides the susceptible (S), infected (I) and recovered (R) classes.The SIRV model [4], defined by a continuous system of four ordinary differential equations considers that the distribution of agents is spatially and temporally homogeneous.The following ODE system can be written based on the flowchart (Fig. 9), that is [4]: ( The flowchart in Fig. 9 can be redesigned taking into account the following rules: α = µ(1 − p v ), ρ = µ p v and µ = α + ρ (Fig. 10).Therefore, the system previously described in Eq. (5.2) can be rewritten (Eq.(5.3)) [31]. (5.3) Figure 11 shows the configuration of the EPIGUI based on Eq.( 5.3), using a small-world network with n 0 = 20 and p = 0.01.Note that S(0) + E(0) + I(0) has to be equal to the number of vertices in the network to properly run the interface.Figure 12a shows the average number of susceptible, infected, recovered, and vaccinated agents, over 10 different simulations as a function of time.

CONCLUSIONS
This paper has introduced the EPIGUI interface for simulating epidemics.Although there is a significant number of epidemiological packages in public domain [10,20,28,33] to model epidemiological systems using compartmental models, less attention has been given to the discrete aspect of the population or the impact of network topology of population.The EPIGUI interface was developed to fill this gap by incorporating stochasticity in real epidemics together with agent contact networks.This approach is certainly of great help to understand paths followed by outbreaks in a given community and to design new strategies to prevent and control them.
Our interface was developed for users, proficient or not in any programming language, to study infectious disease spread using compartmental models in combination with complex networks.
In the disease outbreak simulation, the user can combine one of the six compartmental models widely known in the literature (SI, SIS, SIR, SIRS, SEIR, or SEIRS) or another provided by the user with one of the five complex network models (random, small-world, scale-free, modular, or hierarchical) or a real network openly available in a database.Unified access to different modelling approaches under the same visualization platform allows users to compare assumptions, parameters and differences in results under different conditions.Thus, with the use of the EPIGUI interface users may better understand main concepts of the dynamics of infectious diseases and also appreciate the impact of various modelling assumptions and control interventions.

103Figure 3 :
Figure 3: (a) Time series for susceptible, infected and recovered agents and (b) network graph, which each node represents an agent coloured according to its compartment.
Trends Comput.Appl.Math., 24, N. 1 (2023) 104 EPIGUI: GRAPHICAL USER INTERFACE FOR SIMULATING EPIDEMICS ON NETWORKS At the bottom of Figure 4 there is a box with an article reference of the corresponding network measures.

Figure 5 :
Figure 5: Flowchart of susceptible, exposed and infected agents for the SEI model.

Figure 6 :Figure 7 :
Figure 6: Configuration of the SEI model in the EPIGUI interface.

Figure 8 :
Figure 8: Network measures of the real infection network for the ABM of the SEI model and t f = 500.

Figure 9 Figure 9 :
Figure 9  presents the interaction flowchart between agents in the classes S, I, R, and V .Parameters µ, β and γ represent the rates of mortality, infection and recovery, respectively.Note that a

Figure 10 :
Figure 10: Flowchart of susceptible, infected, recovered, and vaccinated agents for the modified SIRV model.

Figure 11 :Figure 12 :
Figure 11: Configuration of the SIRV model in the EPIGUI interface.

Figure 13 :
Figure 13: Network measures of the small-world network for the ABM of the SIRV model and t f = 100.

8 .
Select the Random option in the Network dialog box; 9. Write the parameter of the random network, that is, p = 1; 10.Click in the Run simulation button.

Figure 1b 1 . 5 . 1 Final time: 100 8 .
Figure 1b 1. Select the yes option in the Defined models dialog box; 2. Select the SIS option in the Choose the model dialog box; 3. Write the initial system conditions under the Initial Condition, ie, first box (S(0)): 800 second box (I(0)): 200 4. Write the parameter values under Values Parameters, ie, first box (beta): 0.125 second box (gamma): 0.1 5. Select the within option in the Vital dynamic dialog box; 6. Write the value of the system's birth/mortality rate in the µ box parameter, ie, 0.0143; 7. Write the simulation parameters, ie, Number of simulation: 100 Time spacing: 0.1 Final time: 100 8. Select the Random option in the Network dialog box; 9. Write the parameter of the random network, that is, p = 1; 10.Click in the Run simulation button.

Figure 1d 1 . 4 . 1 5. 1 Final time: 100 8 . 9 .
Figure 1d 1. Select the yes option in the Defined models dialog box; 2. Select the SIRS option in the Choose the model dialog box; 3. Write the initial system conditions under the Initial Condition, ie, first box (S(0)): 800 second box (I(0)): 200 third box (R(0)): 0 4. Write the parameter values under Values Parameters, ie, first box (beta): 1.5 second box (gamma): 0.0278 third box (rho): 0.1 5. Select the within option in the Vital dynamic dialog box; 6. Write the value of the system's birth/mortality rate in the µ box parameter, ie, 0.0143; 7. Write the simulation parameters, ie, Number of simulation: 100 Time spacing: 0.1 Final time: 100 8. Select the Random option in the Network dialog box; 9. Write the parameter of the random network, that is, p = 1; 10.Click in the Run simulation button.

Figure 1e 1 . 4 . 4 5.
Figure 1e1.Select the yes option in the Defined models dialog box; 2. Select the SEIR option in the Choose the model dialog box;

Figure 12a 1 . 7 . 8 .
Figure 12a1.Select the no option in the Defined models dialog box; 2. Select the third option (4 compartments) in the Number of compartments dialog box; 3. Write the names of the compartments S, I, R and V in the four boxes, respectively; 4. Select the third option (3 parameters) in the Number of parameters dialog box; 5. Write the names of the parameters beta, gamma and rho in the three boxes, respectively; 6. Click in Writer system; 7. Write the system of differential equations in the boxes below the ODE system (each parameter, variable and sign must be separated by spaces), ie, first box ( S): -beta S I -rho S second box ( I): beta S I -gamma I -rho I third box ( R): gamma I -rho E fourth box ( V): rho S + rho I + rho R 8. Write the initial system conditions under the Initial Condition, ie, first box (S(0)): 190 second box (I(0)): 10 third box (R(0)): 0 fourth box (V(0)): 0