Inverse Optimal Impulsive Neural Control for Complex Networks Applied to Epidemic Diseases

: This paper proposes an impulsive control scheme for a complex network that helps reduce the spread of two epidemic diseases: inﬂuenza type A and COVID-19. Both are respiratory infections; thus, they have a similar form of transmission, and it is possible to use the same control scheme in both study cases. The objective of this work is to use neural impulsive inverse optimal pinning control for complex networks to reduce the effects of propagation. The dynamic model is considered unknown, for which we design a neural identiﬁer that, through training using the extended Kalman ﬁlter algorithm, provides the appropriate nonlinear model for this complex network. The dynamics of the network nodes are represented by the Susceptible-Infected-Removed (SIR) compartmental model in their discrete form. The results of the simulations are presented and addressed, applying the same control scheme but with different parameter values for each case study.


Introduction
The continuous monitoring of the dynamics of the spread of infectious diseases such as influenza and COVID-19 is an important investigation, implementing the use of mathematical models to lay the foundations of proposed control strategies and then to evaluate whether the contagion curve can be flattened [1][2][3]. Within control systems, we aim to drive the states of a given system to a desired point. The techniques are very varied as in [4], and the one to be used depends specifically on the type of problem to be addressed. With the use of impulsive inverse optimal control, we can distribute resources for the treatment of diseases [5].
By using neural networks as state identifiers, we can replicate the system behavior without completely knowing its parameters [6,7] because it does not require a precise model; it is adaptable to both influenza type A and COVID-19. The training approach proposed for the neural network is based on the algorithm of the extended Kalman filter [8], as it has proven to be a reliable method with a fast learning speed [9] compared to other methods, such as backpropagation, which requires calculating the gradient descent, and therefore its learning speed is affected [10].
Epidemiological models based on differential equations allow for a realistic representation of the transmission dynamics of some diseases. Therefore, they become an excellent tool to generate control theory methods that make it possible to stop or eliminate the spread of diseases such as influenza type A and COVID-19, which are the cases of study in this paper. Complex networks describe interactions between different entities that produce a certain state for the whole network in general [11]. This same interaction occurs in populations when a pandemic occurs.
In the case of seasonal influenza in the United States, it is estimated that 5% to 20% of the population is infected each year [12]; considered in this range are those infected who are symptomatic and asymptomatic. In the case of COVID-19, there is a record of countries that report up to 68% of their infected population [13].
Undoubtedly, the adequate distribution of medicines in the event of an epidemic outbreak carries a role of great importance for fighting infections and to control shortages or oversupply in health systems. We seek a proposal that simulates the spread of COVID-19 in a population susceptible to the disease. We consider the nodes of a complex network as dynamic systems represented by a variation of the SIR model. This model is considered to be the representation of various towns' or cities' populations interacting with each other during a pandemic.
In this research we use complex networks to simulate the interaction between some towns' or cities' populations that are affected by an epidemic outbreak of influenza type A and COVID-19. The use of a neuronal identifier allows us to use this scheme for both influenza type A and COVID-19, or any disease caused by a similar virus. The objective of using a pinning control scheme is to seek an effective distribution of treatments in the populations affected by the spread of these diseases.

Mathematical Background
In this section, we present the theoretical framework and mathematical models on which the proposal is based.

Susceptible-Infective-Removed Model
The complexity of pandemics is a subject of great interest for many areas, from those that are in charge of their surveillance, such as the medical and epidemiological perspective [14], to other kinds of disciplines originating in engineering, such as control theory [15]. In recent years, contagious diseases have appeared that require our attention and supervision. Influenza type A and COVID-19, for example, affect the respiratory tract [16], spread rapidly, and, if not treated, can cause irreversible damage to the human body. Performing numerical simulations of the spread of the disease is a useful tool in the estimation of the scope that this type of phenomena can have [17].
In 1927, Kermack and McKendrick proposed the Susceptible-Infective-Removed (SIR) compartmental model [18], in which a susceptible individual in class S who is in contact with an infected individual in class I has a certain probability of moving to class I. In this model, the ability to infect susceptible individuals does not always remain latent, but rather disappears after some time. This situation is covered by individuals in the class R and can occur due to the natural course of the disease and the acquisition of immunity or due to death [19].
The SIR model is represented mathematically in the following system of differential equations [20]: where α and β are the recuperation and transmission rate of the disease, respectively. The sum S + I + R = N, with N as the total population, which is considered to be constant. The conditions in which the set of Equation (1) is solved are: S(0) = S 0 > 0, I(0) = I 0 > 0, R(0) = R 0 ≥ 0 and S + I + R = 1. contagion capable of reinfecting an individual who has not been exposed to this evolution of the virus [21], which is also similar to what happens with influenza type A.
The work in [22] proposes a variant of the SIR model that adds seasonality and an impulsive control scheme, in which birth and death rates are considered. The model with seasonality is shown in Equation (2): where µ is both the birth and death rate considered to be the same, and β i represents the variable transmission rate that changes according to the season. The impulsive control dynamics are represented in Equation (3): where p ∈ [0, 1] represents the portion of individuals who will receive treatment or vaccination against the disease. This type of control allows for establishing adequate measures for the application of treatments.

Impulsive Inverse Optimal Control for the SIR Model with Seasonality
There are several control methods to drive a given system to the desired state; which one to choose depends on the desired application [4]. In particular, for this research, impulsive control adapts well to this type of biomedical application due to how medicine is usually administrated [5,23]. The work in [5] proposes an impulsive inverse optimal control for the SIR model with the seasonality of Equations (2) and (3), applied to influenza type A. The controller proposed in [5] is as follows: where R 2d ∈ R 2×2 , P 2 ∈ R 2×2 , and P 12 ∈ R 2×1 ; p 1 and p 2 replace the constant p in Equation (3); thus, we obtain: The variation in the portion of people treated or vaccinated against the disease is intended to optimize the available resources. The details on the optimality of this controller are discussed in Section 2.4.

Complex Networks
A complex network can be considered as a set of dynamic systems that are connected to each other, and each one has its own characteristics [24]. The mathematical representation of a complex network in which its connections are linear and diffusive is shown in the following model [25]: .
where x i = x i1 x i2 . . . x iN ∈ R Nn is the state vector of node i; f i : R n → R n represents the self-dynamics of node i; c ij is the coupling strength between node i and node j, a ij = 1 when there is a connection between node i and node j, a ij = 0 when there is no connection between nodes i and j, a ii = −k i with k i being equal to the number of connections of node i; Γ is a constant matrix that represents the way the different elements of the state vector are connected.
For a dynamic network to be synchronous, the states of the nodes must be measurable when the time tends to infinity [26]. If a system is not stable, we can use a controller to correct that behavior. A control technique developed for complex networks pinning control, this technique allows for controlling only a fraction of the nodes and thus brings the system to the desired state [27].

Discrete-Time Recurrent High-Order Neural Networks
A disadvantage of mathematical models is that they do not capture the imperfections of the real world. For this reason, we can use recurrent high-order neural networks (RHONNs), and, by configuring them as neural identifiers, we can recreate the dynamics of the real system [28].
The following model presents the discrete version of the RHONN [26]: where x i (k) is the state of the i-th neuron at iteration k with n as the state dimension, w i is the online adaptable weight vector, and z(x(k), u(k)) is defined as: . . .
where L is the number of high-order connections; I 1 , I 2 , . . . , I L is a set of L unordered subsets {1, 2, . . . , m + n}; and y is a vector formed by the inputs of each neuron, defined as: where S(·) is a nonlinear sigmoid function, and u = u 1 u 2 . . . u m is the input vector to the neural network.

Impulsive Inverse Optimal Control
The impulsive controller of Equation (4) was developed from the following concepts [23]. Consider a dynamic impulsive system defined by: . where x(t + ), f c : D → R n and f d : D → R n are continuous, and T = {t k } is the restart set with t k ∈ R, t k < t k+1 , k = 1, 2, . . . , ∞. It is assumed that the dynamics of f c (·) are such that the solution to .
x(t) in (10) is jointly continuous in t and x 0 between resetting events t k , s(t, τ, x 0 ) is the solution of x(t) in (10) at time t ≥ τ with initial condition x(τ) = x 0 , the point x e ∈ D is an equilibrium point of (10) if and only if s(t, τ, x e ) = x e for all τ ≥ 0 and t ≥ τ. x e ∈ D is an equilibrium point of (10) if and only if f c (x e ) = 0 and f d (x e ) = 0.
Consider the following controlled impulsive dynamical system: .
and the hybrid performance functional: where u c (·) and u d (·) are restricted to a class of admissible hybrid controls consisting of We assume there exists a continuously differentiable function V : R n → R , and functions P 12 : D → R 1×m d and P 2 : Then, the zero solution x(t) ≡ 0 of the closed-loop system in Equation (12) is globally asymptotically stable with the optimal hybrid feedback control law and performance functional (12), with is minimized in the sense that

Simulation Preliminaries
In this section, we detail the actual models used within the numerical simulation, which are derived from the models in Section 2.

Complex Networks and Discretization of the SIR Model with Seasonality
Taking the complex network model of (6), we can define f i (x i ) as Equations (2) and (5) when t = t k . Given the nature of the reported data on epidemics, we use a finite difference discretization for the model, which will result in the next set of equations: where is the state vector node i, T is the sampling time, c is the constant coupling strength equal for all node connections. From discretization, the impulsive dynamics result as follows: where p 1 and p 2 are obtained from a discretized version of the controller described in Equation (4), which will be detailed further in another subsection.
The interpretation for this is that the nodes represent towns or cities that interact with each other during an epidemic outbreak through the connections or links between them.

Neural Identifier
Based on the model (7), we design the next neural identifier: where ϕ(·) is a logistic function defined as follows: To obtain the real estimated value of the system, we use the auxiliar variables obtained from Equation (12) and compute as follows: This is executed so that the obtained values are consistent with the conditions established for the SIR model, specifically, that the states are positive and that their sum equals one.

Training with the Extended Kalman Filter Algorithm
We use the extended Kalman filter algorithm to train the neural network shown in (19). The equation for the adaptable weights is [15]: where e(k) = y(k) −ŷ(k) is the error signal between the system output y(k) and the neural network outputŷ(k), and K(k) is the Kalman gain matrix defined as: where H(k) is defined as z (x(k), u(k)) in (10), R(k) = R = 10, and P(k) is computed as: where Q(k) = Q is a 2 × 2 diagonal matrix with the number 10 in its diagonal elements, P(0) = Q, and all initial weights are random.

Control Law Synthesis
From the values obtained in (21), we use the controller shown in (4) to compute the impulsive control input. Then, Equation (4) turns into: where the values for R 2d , P 2 , and P 12 are heuristically determined as: The values shown in (26) are used for both study cases. The general form of the controller has been used in [29] in a single-system case with fairly good results.
The control scheme used is illustrated in Figure 1. where ( ) = is a 2 × 2 diagonal matrix with the number 10 in its diagonal elements, (0) = , and all initial weights are random.

Control Law Synthesis
From the values obtained in (21), we use the controller shown in (4) to compute the impulsive control input. Then, Equation (4) turns into: where the values for 2 , 2 , and 12 are heuristically determined as: The values shown in (26) are used for both study cases. The general form of the controller has been used in [29] in a single-system case with fairly good results.
The control scheme used is illustrated in Figure 1.

Numerical Simulations
Based on the encouraging results we obtained when applying this control scheme to the problem of influenza type A, we now apply it to a complex network case, including a scenario with COVID-19, which has a higher contagion rate.
In the work in [30], it was shown that by using an impulsive pinning controller with a neural identifier, we can obtain good results for lowering the contagion curve. We now consider the nodes of a complex network as towns' or cities' populations described by the SIR model, which is represented by Equations (17) and (18).
The networks of Figure 2 were designed for simulation tests in both study cases.

Numerical Simulations
Based on the encouraging results we obtained when applying this control scheme to the problem of influenza type A, we now apply it to a complex network case, including a scenario with COVID-19, which has a higher contagion rate.
In the work in [30], it was shown that by using an impulsive pinning controller with a neural identifier, we can obtain good results for lowering the contagion curve. We now consider the nodes of a complex network as towns' or cities' populations described by the SIR model, which is represented by Equations (17) and (18).
The networks of Figure 2 were designed for simulation tests in both study cases.
The only parameter that changes for the ten-node network is matrix , which is given by: .
Next, we present other parameters specific to each study case and the results of the simulations.

Influenza Type A
Using models (17) and (18), the parameters used are = 0.1 and = 9 for the winter months and = 1 for the rest of the year. = 0.9, and = 0.125/12, which is roughly equivalent to 3 days of simulation time. These values were taken from [31].
In the five-node network simulation, control was placed at node 3. In the ten-node network simulation, control was placed at nodes 1 and 2. Initial conditions for the controlled nodes are assigned at random. Both simulation scenarios start with the assumption that all nodes are unconnected to each other. After a month of simulation time, nodes in the network are connected according to matrix of Equations (27) and (28) for the network with five and ten nodes, respectively. The start of the connections simulates the transmission of the infection to other nodes. Vaccination and application of treatments occur from the beginning of the simulation and are repeated every year in the winter season. Figure 3 shows the dynamics of the five-node network for the case of influenza type A. The parameters for the five-node network for both study cases are: The only parameter that changes for the ten-node network is matrix A, which is given by: Next, we present other parameters specific to each study case and the results of the simulations.

Influenza Type A
Using models (17) and (18), the parameters used are µ = 0.1 and β i = 9 for the winter months and β i = 1 for the rest of the year. α = 0.9, and T = 0.125/12, which is roughly equivalent to 3 days of simulation time. These values were taken from [31].
In the five-node network simulation, control was placed at node 3. In the ten-node network simulation, control was placed at nodes 1 and 2. Initial conditions for the controlled nodes are assigned at random. Both simulation scenarios start with the assumption that all nodes are unconnected to each other. After a month of simulation time, nodes in the network are connected according to matrix A of Equations (27) and (28) for the network with five and ten nodes, respectively. The start of the connections simulates the transmission of the infection to other nodes. Vaccination and application of treatments occur from the beginning of the simulation and are repeated every year in the winter season. Figure 3 shows the dynamics of the five-node network for the case of influenza type A.   Figure 4 shows the suggested treatment for node 3 obtained by the control law shown in (25) for the five-node network and influenza type A disease.  Figure 5 shows the state of the network for the ten-node network and influenza type A.   Figure 4 shows the suggested treatment for node 3 obtained by the control law shown in (25) for the five-node network and influenza type A disease.    Figure 5 shows the state of the network for the ten-node network and influenza type A.
Systems 2022, 10, x FOR PEER REVIEW 2 of 17 Figure 5. Dynamics of the ten-node network for influenza type A. Figures 6 and 7 show the suggested treatment for nodes 1 and 2 for the ten-node network and influenza type A disease.   Figures 6 and 7 show the suggested treatment for nodes 1 and 2 for the ten-node network and influenza type A disease.
Systems 2022, 10, x FOR PEER REVIEW 2 of 17 Figure 5. Dynamics of the ten-node network for influenza type A. Figures 6 and 7 show the suggested treatment for nodes 1 and 2 for the ten-node network and influenza type A disease. Figure 6. Estimated treatment for node 1 of the ten-node network in the case of influenza type A. Figure 6. Estimated treatment for node 1 of the ten-node network in the case of influenza type A.

COVID-19
The changes in parameters used for this study case are the following. The recuperation rate α = 8.69, and the transmission rate is now invariant through time, which means there is no seasonality in this case, but the transmission rate varies between the different nodes with β i = β = 21.275, 19.987, 19.118, 20.856, and 18.249, for nodes 1, 2, 3, 4, and 5, respectively. These values were estimated according to the basic reproduction number of COVID-19 found in page 10 of [32] and the disease recovery rate stated on page 14 of [32], considering a hypothetical scenario. For the ten-node network, the transmission rate is the same for all nodes with β = 19.118. Systems 2022, 10, x FOR PEER REVIEW 2 of 17 Figure 7. Estimated treatment for node 2 of the ten-node network in the case of influenza type A.

COVID-19
The changes in parameters used for this study case are the following. The recuperation rate = 8.69, and the transmission rate is now invariant through time, which means there is no seasonality in this case, but the transmission rate varies between the different nodes with = = 21.275, 19.987, 19.118, 20.856, and 18.249, for nodes 1, 2, 3, 4, and 5, respectively. These values were estimated according to the basic reproduction number of COVID-19 found in page 10 of [32] and the disease recovery rate stated on page 14 of [32], considering a hypothetical scenario. For the ten-node network, the transmission rate is the same for all nodes with = 19.118.
The initial conditions in the five-node network are = 0.995, = 0.005, and = 0 for node 3; the rest of the nodes start with = 1, = 0, and = 0. The sample time is now = 1/365, which is a day of simulation time. Initial conditions in the ten-node network simulation are = 0.995, = 0.005, and = 0 for node 1 and = 1, = 0, and = 0 for the rest of the nodes. Simulations for this case are performed as before with the assumption that all nodes start unconnected to each other. After a month of simulation time, nodes in the network are connected according to matrix of Equations (27) and (28) for the network with five and ten nodes, respectively. The start of the connections simulates the transmission of the infection to other nodes. In this case, vaccination and application of treatments begin until day 105 of simulation time and are repeated each week of the duration of simulation for the selected nodes. Figure 8 shows the dynamics of the five-node network for the case of COVID-19. The initial conditions in the five-node network are S = 0.995, I = 0.005, and R = 0 for node 3; the rest of the nodes start with S = 1, I = 0, and R = 0. The sample time is now T = 1/365, which is a day of simulation time. Initial conditions in the ten-node network simulation are S = 0.995, I = 0.005, and R = 0 for node 1 and S = 1, I = 0, and R = 0 for the rest of the nodes. Simulations for this case are performed as before with the assumption that all nodes start unconnected to each other. After a month of simulation time, nodes in the network are connected according to matrix A of Equations (27) and (28) for the network with five and ten nodes, respectively. The start of the connections simulates the transmission of the infection to other nodes. In this case, vaccination and application of treatments begin until day 105 of simulation time and are repeated each week of the duration of simulation for the selected nodes. Figure 8 shows the dynamics of the five-node network for the case of COVID-19.  Figure 9 shows the suggested treatment for node 3 obtained by the control law shown in (25) for the five-node network and COVID-19 disease.  Figure 9 shows the suggested treatment for node 3 obtained by the control law shown in (25) for the five-node network and COVID-19 disease. Figure 8. Dynamics of the five-node network for COVID-19. Figure 9 shows the suggested treatment for node 3 obtained by the control law shown in (25) for the five-node network and COVID-19 disease.  Figure 10 shows the state of the network for the ten-node network and COVID-19.  Figure 10 shows the state of the network for the ten-node network and COVID-19.
Systems 2022, 10, x FOR PEER REVIEW 2 of 17 Figure 10. Dynamics of the ten-node network for COVID-19. Figures 11 and 12 show the suggested treatment for nodes 1 and 2 for the ten-node network and COVID-19 disease. Figure 10. Dynamics of the ten-node network for COVID-19. Figures 11 and 12 show the suggested treatment for nodes 1 and 2 for the ten-node network and COVID-19 disease. Figure 10. Dynamics of the ten-node network for COVID-19. Figures 11 and 12 show the suggested treatment for nodes 1 and 2 for the ten-node network and COVID-19 disease.

Results Discussion
The results of Figures 3 and 5 show the infected population declining to a low level, and, though is not zero, it is lower than without treatment or vaccination, and this has been accomplished with only one of the nodes for the five-node network and two nodes for the ten-node network. We can conclude the same for the results of the COVID-19 case shown in Figures 8 and 10.
Figures 4, 6. and 7 show the variation in the suggested treatment and vaccination over time and how it settles as the simulation concludes. The overall population vaccinated and treated for the disease is quite low if one considers that only a certain percentage of the susceptible or infected population classes are receiving said vaccine and treatment. If we compare the vaccinated and treated population against the population for the whole node, the percentage is even lower. Similar conclusions can be made for the results shown in Figures 9, 11, and 12 of the COVID-19 case. Figure 13 shows an example of the five-node network with no treatment at all for the case of COVID-19. With this, we can compare the effects of the control scheme and how much it lowers the percentage of infected people, which is certainly a good feature of this proposal.
Though these results are encouraging, the model still needs to be validated and com-

Discussion
The results of Figures 3 and 5 show the infected population declining to a low level, and, though is not zero, it is lower than without treatment or vaccination, and this has been accomplished with only one of the nodes for the five-node network and two nodes for the ten-node network. We can conclude the same for the results of the COVID-19 case shown in Figures 8 and 10. Figures 4, 6 and 7 show the variation in the suggested treatment and vaccination over time and how it settles as the simulation concludes. The overall population vaccinated and treated for the disease is quite low if one considers that only a certain percentage of the susceptible or infected population classes are receiving said vaccine and treatment. If we compare the vaccinated and treated population against the population for the whole node, the percentage is even lower. Similar conclusions can be made for the results shown in Figures 9, 11 and 12 of the COVID-19 case. Figure 13 shows an example of the five-node network with no treatment at all for the case of COVID-19. With this, we can compare the effects of the control scheme and how much it lowers the percentage of infected people, which is certainly a good feature of this proposal.
Systems 2022, 10, x FOR PEER REVIEW 2 of 17 Figure 13. Dynamics of the five-node network with no treatment for COVID-19.

Conclusions
This research addressed an impulsive neural-pinning control model for complex networks based on a SIR model, which was previously applied to the case of influenza type A and is now adapted to the case of COVID-19 and a complex network approach in which nodes are considered to be towns' or cities' populations.
The results show that by applying the control to a small percentage of the nodes, the infected class of both diseases is reduced to a level much less than 50%. This represents a great advantage for the better use of resources during pandemics. However, we should not forget that this approach needs more work and validation before it serves as an accurate representation of reality. Some characteristics can be better modeled, such as the way node connections are presented as well as the interaction that nodes have through these nodes. Another important validation is to run tests along with real data to make comparisons. The presented results encourage us to continue this research line, and the missing details remain now as a work in progress.
Another important feature is that the proposed control scheme does not know the dynamic model, and by using the neural identifier, we approximate the necessary values for the controller to work. Acknowledgments: Authors thank the Universidad de Guadalajara for support in the development of this research.

Conflicts of Interest:
The authors declare no conflicts of interest. Figure 13. Dynamics of the five-node network with no treatment for COVID-19.

References
Though these results are encouraging, the model still needs to be validated and compared against real data of cities or towns populations. Through a time series of data from different population zones, we can verify the behavior of our model. This work remains in progress.

Conclusions
This research addressed an impulsive neural-pinning control model for complex networks based on a SIR model, which was previously applied to the case of influenza type A and is now adapted to the case of COVID-19 and a complex network approach in which nodes are considered to be towns' or cities' populations.
The results show that by applying the control to a small percentage of the nodes, the infected class of both diseases is reduced to a level much less than 50%. This represents a great advantage for the better use of resources during pandemics. However, we should not forget that this approach needs more work and validation before it serves as an accurate representation of reality. Some characteristics can be better modeled, such as the way node connections are presented as well as the interaction that nodes have through these nodes. Another important validation is to run tests along with real data to make comparisons. The presented results encourage us to continue this research line, and the missing details remain now as a work in progress.
Another important feature is that the proposed control scheme does not know the dynamic model, and by using the neural identifier, we approximate the necessary values for the controller to work.