Effects of Community Connectivity on the Spreading Process of Epidemics

Community structure exists widely in real social networks. To investigate the effect of community structure on the spreading of infectious diseases, this paper proposes a community network model that considers both the connection rate and the number of connected edges. Based on the presented community network, a new SIRS transmission model is constructed via the mean-field theory. Furthermore, the basic reproduction number of the model is calculated via the next-generation matrix method. The results reveal that the connection rate and the number of connected edges of the community nodes play crucial roles in the spreading process of infectious diseases. Specifically, it is demonstrated that the basic reproduction number of the model decreases as the community strength increases. However, the density of infected individuals within the community increases as the community strength increases. For community networks with weak strength, infectious diseases are likely not to be eradicated and eventually will become endemic. Therefore, controlling the frequency and range of intercommunity contact will be an effective initiative to curb outbreaks of infectious diseases throughout the network. Our results can provide a theoretical basis for preventing and controlling the spreading of infectious diseases.


Introduction
Throughout history, viruses have been a major factor in the development of societies. Describing the mechanisms of epidemics spreading and predicting their epidemiological trends is the long-standing focus of research with the aim of effectively controlling the spread of diseases [1][2][3].
As we know, the study of complex networks has gradually become a hot issue in the field of complexity disciplines. Scholars have made significant contributions to the study of areas such as transportation, social, financial, and biological networks. As research into complex networks has continued, the spreading of computer viruses in computer networks, contagious diseases in social populations, and public opinion and rumors in social networks can have an egregious effect on the development of human society [4][5][6]. Therefore, the behavior of transmission dynamics on complex networks has become one of the research directions of great interest.
Following the introduction of small-world networks and scale-free networks [7][8][9][10], scientists have studied the many networks that exist in the real world and found that complex networks also have characteristics of community structure. Girvan and Newman have introduced community structure properties in many networks and proposed methods for detecting such structures [11]. The community structure means that the nodes in the network are divided into several groups; i.e., the individuals within the groups are relatively tightly connected, and the individuals between the groups are relatively sparsely connected. In real social networks, individuals form groups because of the same characteristics. In turn, scientists study the dynamics of disease transmission in networks by constructing community network models to mirror real networks [12][13][14][15][16][17][18][19][20][21][22][23][24][25].

Community Network Model
The network model generation algorithm with community structure can be constructed as follows [26,29].
Consider a network containing m communities, and each community contains n 1 , n 2 , · · · , n m nodes, respectively. Here, we assume that the number of nodes in each community is n i .
At the initial moment, the nodes of the network are independent. Each node is connected to m 1 nodes with probability α of intracommunity links, and every two communities have m 2 links.
At each time step, each node in the i-th community is connected to m 3 nodes with probability p in in the same community. Moreover, this node is connected to m 4 nodes with probability p out between different communities. Then, a community network is generated. In what follows, we discuss the effect of the strength of the community structure on the spreading of the epidemic by introducing a modularity coefficient. The modularity coefficient is defined as [27] where e ij is the proportion of connected edges in community i and j to the total connected edges in the network. According to the above network evolution, one can obtain e ii = nαm 1 + np in m 3 nαmm 1 + 1 2 m(m − 1)m 2 + np in mm 3 + np out m(m − 1)m 4 . (2) ∑ j e ij = e ii + ∑ j =i e ij = nαm 1 + np in m 3 + (m − 1)m 2 + np out (m − 1)m 4 nαmm 1 + 1 2 m(m − 1)m 2 + np in mm 3 + np out m(m − 1)m 4 . (3) Substituting Equations (2) and (3) into (1) It can be seen from Equation (4) that the community strength is not only related to the connected rate p in , p out but also to the number of intracommunity and intercommunity links. The following numerical simulations are performed. The parameters are taken as m = 4, n = 500, and α = 0.1. Figure 1 displays the relation between the community strength and the internal and external connection rates of the nodes. From Figure 1, we observe that the same modularity coefficient corresponds to different p in and p out . Moreover, it can be seen that the internal connection rate p in increases as the external connection rate p out increases.
connected edges in the network.
According to the above network evolution, one can obtain  (2) and (3) into (1), we obtain  Figure 1 displays the relation between the community strength and external connection rates of the nodes. From Figure 1, we observe that t larity coefficient corresponds to different in p and out p . Moreover, it can internal connection rate in p increases as the external connection rate o p   Figure 2a shows that when the external connection rate p out is fixed, the modularity coefficient increases as the internal connection rate p in increases. Figure 2b shows that when the internal connection rate p in is fixed, the modularity coefficient decreases as the external connection rate p out increases. It implies that an increase in the frequency of connections between communities leads to a less distinct community structure in the network.  Figure 2b shows that when the internal connection rate in p is fixed, the modularity coefficient decreases as the external connection rate out p increases. It implies that an increase in the frequency of connections between communities leads to a less distinct community structure in the network. Figure 3a,c display the effect of the number of connected edges of each node within the community on the modularity coefficient. The result is that the higher the number of connected edges, the stronger the community strength. Moreover, Figure 3b,d reflect the increase in the number of connected edges between communities, thus making the community structure inconspicuous. However, Figure 3a,b show that the number of connected edges at the initial moment has a smaller effect on the modularity coefficient. This means that it will not play a decisive role in the strength of the community structure.   Figure 3a,c display the effect of the number of connected edges of each node within the community on the modularity coefficient. The result is that the higher the number of connected edges, the stronger the community strength. Moreover, Figure 3b,d reflect the increase in the number of connected edges between communities, thus making the community structure inconspicuous. However, Figure 3a,b show that the number of connected edges at the initial moment has a smaller effect on the modularity coefficient. This means that it will not play a decisive role in the strength of the community structure.
the external connection rate out p increases. It implies that an increase in the frequency of connections between communities leads to a less distinct community structure in the network.  Figure 3a,c display the effect of the number of connected edges of each node within the community on the modularity coefficient. The result is that the higher the number of connected edges, the stronger the community strength. Moreover, Figure 3b,d reflect the increase in the number of connected edges between communities, thus making the community structure inconspicuous. However, Figure 3a,b show that the number of connected edges at the initial moment has a smaller effect on the modularity coefficient. This means that it will not play a decisive role in the strength of the community structure.

Model Description
In this subsection, we consider an epidemic network model with two communities. It is assumed that the individuals in each community will be in three different states: susceptible (S), infected (I), and recovered (R). Parameters S i,k , I i,k , and R i,k are defined as the density of susceptible, infected, and recovered individuals with degree k at time t, where i indicates the i−th community, i = 1, 2. Table 1 denotes the explanation of the key parameters in the transmission of infectious diseases. Here, we assume that all parameters are positive. In order to further explain, the transformation between the states of the infectious disease in the two communities is described as follows. The Figure 4 shows the infectious disease transmission in complex network with two communities.
In this subsection, we consider an epidemic network model with two communities. It is assumed that the individuals in each community will be in three different states: susceptible (S), infected (I), and recovered (R). Parameters ,  Table 1 denotes the explanation of the key parameters in the transmission of infectious diseases. Here, we assume that all parameters are positive.  In order to further explain, the transformation between the states of the infectious disease in the two communities is described as follows. The Figure 4 shows the infectious disease transmission in complex network with two communities. Based on the above community network model, the SIR epidemic transmission model is established as the following equations: Based on the above community network model, the SIR epidemic transmission model is established as the following equations: where n i,k represents the total number of individuals of degree k in the i−th community, k = 1, 2, . . . , d, d is the maximum degree, n i denotes the whole number of individuals in the i−th community, and N is the total number of individuals in the network, satisfying N = n 1 + n 2 . We define the power-law degree distribution in the whole network as It is well known that the degree distribution in the i−th community satisfies and the average degree in the whole network is In Equation (5), denotes the probability that a randomly chosen link of a node is connected to an infected node at time t: where a = n 1 k 1 n 1 + k 2 n 2 . Similarly, where b = n 2 k 1 n 1 + k 2 n 2 .

The Basic Reproduction Number
This subsection focuses on the investigation of the basic reproduction number R 0 via the next-generation matrix scheme. In order to obtain the infection matrix F and the internal evolution matrix V, we translate Equation (5) into the following format: where the infection matrix F and the internal evolution matrix V are given: Then, the infection matrix of the system at the disease-free equilibrium E 0 (1, 0, 0, . . . , 1, 0, 0) can be obtained: . . , 6, and F d×d ij , i = 3, . . . , 6, and j = 1, 2, . . . , 6 are zero matrix. The internal evolution matrix of the system at the disease-free equilibrium E 0 (1, 0, 0, . . . , 1, 0, 0) is given by 6j , and j = 1, 3, 4, 5 are zero matrices according to the principle of the next-generation matrix, where R 0 = ρ(FV −1 ), which denotes the spectral radius of the matrix FV −1 .
Defining C = FV −1 , we have C d×d 1j , (j = 3, . . . , 6), C d×d 2j , (j = 3, . . . , 6), C d×d ij , and (i = 3, . . . , 6, j = 1, . . . , 6) are zero matrices, C d×d In the following, we determine the matrix C of the spectral radius: It is found that the matrix C has 2d − 2 eigenvalues equal to 0 by applying similar transformation to the matrix C. The remaining two eigenvalues satisfy From the determinant (12), the characteristic equation can be obtained as Therefore, the discriminant of the roots of quadratic Equation (13) is Entropy 2023, 25, 849 9 of 15 The roots of the quadratic equation; that is, the eigenvalues of the matrix C, are Thus, the basic reproduction number of the whole network is expressed as [34] Equation (16) shows that the probability of being connected in the inner and outer communities plays a positive role in the basic reproduction number. According to the above analysis, the following theorem is obtained.
Theorem 1: For system (5), if the basic reproduction number R 0 < 1, the disease-free equilibrium is stable and the disease will die out in two communities. If the basic reproduction number R 0 > 1, the disease-free equilibrium is unstable and the epidemic can occur in two communities.

The Impact of Community Structure on the Spreading of Infectious Diseases
In the following, we study the influence of community structure on the process of spreading infectious diseases. Here, we focus on the variation in the basic reproduction number and infection density.

The Influence of the Connection Rate on the Basic Reproduction Number
Firstly, we study the impact of the connection rate within and between the communities on the basic reproduction number. The parameters are taken as k 1 = 9.08, k 2 = 8.83, δ 1 = 0.05, δ 2 = 0.1, γ 12 = 0.5, and γ 21 = 0.35.
Fix parameter p out = 0.2; Figure 5 shows the spatial-temporal distribution of the basic reproduction number in the network with the infection and connection rates within the community. Let parameter p in = 0.2; Figure 6 shows the spatial-temporal distribution of the basic reproduction number in the network with the infection rate within the community and the external connection rate. These figures represent that the internal connection rate and the external connection rate are positively correlated with the basic reproduction number. Comparing Figures 5 and 6, it is observed that the external connection rate has a greater impact on the basic reproduction number for the network.
Equation (16) shows that the probability of being connected in the inner and outer communities plays a positive role in the basic reproduction number. According to the above analysis, the following theorem is obtained.
Theorem 1: For system (5), if the basic reproduction number 0 1 R  , the disease-free equilibrium is stable and the disease will die out in two communities. If the basic reproduction number 0 1 R  , the disease-free equilibrium is unstable and the epidemic can occur in two communities.

The Impact of Community Structure on the Spreading of Infectious Diseases
In the following, we study the influence of community structure on the process of spreading infectious diseases. Here, we focus on the variation in the basic reproduction number and infection density.

The Influence of the Connection Rate on the Basic Reproduction Number
Firstly, we study the impact of the connection rate within and between the communities on the basic reproduction number. The parameters are taken as  Figure 6 shows the spatial-temporal distribution of the basic reproduction number in the network with the infection rate within the community and the external connection rate. These figures represent that the internal connection rate and the external connection rate are positively correlated with the basic reproduction number. Comparing Figures 5 and 6, it is observed that the external connection rate has a greater impact on the basic reproduction number for the network.
(a) (b) Figure 5. (a,b) The spatial-temporal distribution of 0 R with  and in p .

The Influence of the Connection Rate and Connected Edges on Infection Density
In this section, we discuss the impact of the connection rate and the number of connected edges within and outside the communities on the transmission of infectious diseases. The parameter takes the value 100 n  , and the initial infected node (0) 1 I  .   it means that intercommunity contact increases, which then also increases the rate and scale of the spreading of infectious diseases throughout the network. In reality, the multiple cross-provincial movements of individuals lead to frequent external connections, with the result that infectious diseases spread on a large scale across the country. Thus, it seems that reducing the number of trips is an effective way to control the spreading of infectious diseases.

The Influence of the Connection Rate and Connected Edges on Infection Density
In this section, we discuss the impact of the connection rate and the number of connected edges within and outside the communities on the transmission of infectious diseases. The parameter takes the value n = 100, and the initial infected node I(0) = 1. Figure 7 shows the variation in infection density with the internal connection rate in the community when p out = 0.2. One can see that the greater the internal connection rate in the community, the more rapidly the density of infected individuals grows. The reason is that individual-to-individual contact becomes frequent within the community, and if an infected individual appears at this time, it is more likely for the infected individual to spread the virus to susceptible individuals, which leads to an increase in the size of the infection in the community as a whole. It is also found that p in can affect the peak time in single communities.
(a) (b) Figure 6. (a,b) The spatial-temporal distribution of 0 R with  and out p .

The Influence of the Connection Rate and Connected Edges on Infection Density
In this section, we discuss the impact of the connection rate and the num connected edges within and outside the communities on the transmission of in diseases. The parameter takes the value 100 n  , and the initial infected node ( I Figure 7 shows the variation in infection density with the internal connection the community when 0.2 out p  . One can see that the greater the internal connect in the community, the more rapidly the density of infected individuals grows. The is that individual-to-individual contact becomes frequent within the community an infected individual appears at this time, it is more likely for the infected indiv spread the virus to susceptible individuals, which leads to an increase in the siz infection in the community as a whole. It is also found that in p can affect the pe in single communities. it means that intercommunity contact increases, which then also increases the r scale of the spreading of infectious diseases throughout the network. In reality, t tiple cross-provincial movements of individuals lead to frequent external conn with the result that infectious diseases spread on a large scale across the country. seems that reducing the number of trips is an effective way to control the sprea infectious diseases.   Figure 8 describes the variation in the infection density with the external connection rate when p in = 0.5. It can be observed that if the external connection rate p out increases, it means that intercommunity contact increases, which then also increases the rate and scale of the spreading of infectious diseases throughout the network. In reality, the multiple cross-provincial movements of individuals lead to frequent external connections, with the result that infectious diseases spread on a large scale across the country. Thus, it seems that reducing the number of trips is an effective way to control the spreading of infectious diseases. In what follows, we investigate the effect of the number of connected edges within communities and between communities on the transmission of infectious diseases, re spectively. Figure 9 shows    Observing the red solid line and the blue dashed part in Figures 7 and 8, it is known that when p out increases by 0.05, the density of infection can increase by about 0.03. When p in increases by 0.15, the density of infection only increases by less than 0.02. Based on the above data, one obtains that intercommunity connection plays a crucial role in the spread of infectious diseases.
In what follows, we investigate the effect of the number of connected edges within communities and between communities on the transmission of infectious diseases, respectively. Figure 9 shows the variation in infection density with the number of connected edges within the community for the case of R 0 < 1. It can be observed when the number of new connected edges m 3 of nodes within the community increases, the speed of infection and the size of the outbreak increase. Thus, it can be concluded that the more susceptible people an infected person in the community comes in contact with, the wider the spread of the infection within the network, and ultimately the greater the number of infected people. Based on the above data, one obtains that intercommunity connection plays a crucial role in the spread of infectious diseases.
In what follows, we investigate the effect of the number of connected edges within communities and between communities on the transmission of infectious diseases, respectively. Figure 9 shows     Figure 10 indicates the variation in infection density with the number of connected edges between communities for the case of R 0 > 1. From this figure, one can observe that the higher the number of connected edges between communities, the faster the speed of the infection. When infected individuals move between communities, they come into contact with many individuals from various other communities. The result shows that the speed of the spreading of infected individuals, as well as the final size of the infectious disease, also increases.
The above analysis implies that reducing the movement of individuals across provinces can control large-scale outbreaks of infectious diseases in certain conditions.  Figure 11 gives the curve of the de each state of the infectious disease with time for different community structures.
Comparing the infection density curves in Figure 11, the basic reproduction n 0 1 R  , the infection density of the network with more connected nodes wit community, will continue to increase until it reaches a steady state. This implies virus is not spreading massively, so the curve of the infection density in the gradually decreases to a steady state. As we know, intercommunity activities play an important role in the sprea infectious diseases. Here we combine Equations (4) and (16) to investigate the e community strength on the spread of infectious diseases. Figure 12 shows the va curve of community strength with the basic reproduction number, where 0 In addition, we consider the number of nodes within the communities is n 1 = n 2 = 100. The number of new connected edges added by individuals at each time step within the two communities is m 1 3 = 8, m 2 3 = 5. Figure 11 gives the curve of the density of each state of the infectious disease with time for different community structures. The above analysis implies that reducing the movement of individuals across provinces can control large-scale outbreaks of infectious diseases in certain conditions.
In addition, we consider the number of nodes within the communities is  Figure 11 gives the curve of the density of each state of the infectious disease with time for different community structures.
Comparing the infection density curves in Figure 11, the basic reproduction number 0 1 R  , the infection density of the network with more connected nodes within the community, will continue to increase until it reaches a steady state. This implies that the virus is not spreading massively, so the curve of the infection density in the graph gradually decreases to a steady state. As we know, intercommunity activities play an important role in the spreading of infectious diseases. Here we combine Equations (4) and (16) to investigate the effect of community strength on the spread of infectious diseases. Figure 12   Comparing the infection density curves in Figure 11, the basic reproduction number R 0 > 1, the infection density of the network with more connected nodes within the community, will continue to increase until it reaches a steady state. This implies that the virus is not spreading massively, so the curve of the infection density in the graph gradually decreases to a steady state.
As we know, intercommunity activities play an important role in the spreading of infectious diseases. Here we combine Equations (4) and (16) to investigate the effect of community strength on the spread of infectious diseases. Figure 12 shows the variation curve of community strength with the basic reproduction number, where α = 0.1 and p in = 0.2.
From Figure 12, we can find that the basic reproduction number decreases as the modularity coefficient Q increases. This implies that the stronger the community structure, the less widespread the spread of infectious diseases will be. In fact, this conclusion holds, but only if the internal connection rate p-in and the number of inner edges are constant and the external connection rate p-out and the number of intracommunity edges are decreasing. Therefore, the possibility of a virus outbreak at the social level as a whole is small. When the community structure is weak enough, the basic regeneration number is greater than 1, and eventually the epidemic evolves into an endemic disease. opy 2023, 25, x FOR PEER REVIEW From Figure 12, we can find that the basic reproduction numbe modularity coefficient Q increases. This implies that the strong structure, the less widespread the spread of infectious diseases will b clusion holds, but only if the internal connection rate p-in and the num are constant and the external connection rate p-out and the number edges are decreasing. Therefore, the possibility of a virus outbreak at whole is small. When the community structure is weak enough, the number is greater than 1, and eventually the epidemic evolves into an From the above analysis, we can summarize that the strength of t affect the final form of the infectious disease, i.e., whether it is erad endemic disease.

Conclusions
This paper presents a modified community network model consi tion rate of nodes and the number of connected edges between comm this model, an SIR infectious disease transmission model with two com is constructed, which is closer to real networks. Furthermore, the tran of epidemics are analyzed via theoretical analysis and numerical simu show that the higher the frequency of susceptible nodes being infec quent contact of individuals within the community, the easier the infe spread within the community. When the external connection rate of creases, the movement of people between communities becomes frequ the transmission of the infection throughout the network. In addition connected edges of communities increase, the infectious disease sprea communities, and the number of infected individuals in the entire massively. From the above analysis, we can summarize that the strength of the community can affect the final form of the infectious disease, i.e., whether it is eradicated or forms an endemic disease.

Conclusions
This paper presents a modified community network model considering the connection rate of nodes and the number of connected edges between communities. Based on this model, an SIR infectious disease transmission model with two community structures is constructed, which is closer to real networks. Furthermore, the transmission dynamics of epidemics are analyzed via theoretical analysis and numerical simulation. Our results show that the higher the frequency of susceptible nodes being infected due to the frequent contact of individuals within the community, the easier the infectious disease will spread within the community. When the external connection rate of the community increases, the movement of people between communities becomes frequent, which leads to the transmission of the infection throughout the network. In addition, when the external connected edges of communities increase, the infectious disease spreads rapidly between communities, and the number of infected individuals in the entire network increases massively.
In conclusion, controlling unnecessary movement of people and minimizing visits to crowded spaces are effective measures to curb the transmission of infectious diseases. This is also in line with our current epidemic prevention policy of not going out of town unless necessary and reducing the number of trips. In the future, we intend to investigate mathematical properties of the epidemic model and further explore the impact of datadriven models for multiplex networks.  Institutional Review Board Statement: Not applicable.

Data Availability Statement:
The datasets generated and analyzed during the current study are available from the corresponding author on reasonable request.