Introduction

Disease or virus spreading on complex networks, because of its broad relevance to health care, social, economical, and political sciences as well as information technologies, has been an active area of research on contemporary network science and engineering1,2,3,4,5,6,7,8. Traditional models of spreading dynamics on networks are memoryless Markovian in the sense that, for all individuals in the network, both contracting a virus and recovering from it are viewed as a Poisson process. The time interval between two successive contracting events and that between two adjacent recovery events follow an exponential distribution with a constant rate—the arrival rate of the respective Poisson process. Associated with the exponential distribution is the memoryless property: any future waiting time does not depend on the previous waiting time. This property fits with that of a memoryless Markovian process as, what matters in order to predict the future is the current state, not the history of the process. The Markovian assumption greatly facilitates the development of mathematical theories of spreading process on complex networks5,7 through, e.g., a mean-field type of analyses1,9,10,11 of the standard susceptible-infected-susceptible (SIS) or susceptible-infected-recovered (SIR) process. There has been increasing empirical evidence and modeling effort that the occurrences of contacts associated with human activities are non-Markovian temporal processes with a heavy tailed inter-event time distribution12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33. A Markovian description of network spreading dynamics is thus ideal and provides only an approximate picture of the real world.

The past decade has witnessed a growing interest in non-Markovian spreading dynamics on complex networks34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50. The failure of the Markovian framework in describing human interactions in relation to disease spreading was noted quite early, and it was found that the deviation from the exponential distribution of the inter-event time to being heterogeneous can impede spreading35. A non-Markovian SIR model with arbitrary time distributions of infection and recovery was solved through the approach of dynamical message passing37. It was also found that a heavy-tailed waiting time distribution can slow down the prevalence decay39. An SIR model with fixed recovery time but with a heavy-tailed infection time distribution was studied with the finding that temporal heterogeneity in the contact process can significantly suppress epidemic spreading40. A relatively significant alteration of the outbreak threshold was reported for non-Markovian type of SIS infection events and certain equivalence between non-Markovian and Markovian models through redefining the effective infection rate was pointed out41,42. Two basic dynamical rules governing a non-Markovian type of SIS spreading process were uncovered43. More recently, a method was proposed to estimate the effective infection rate for non-Markovian type of spreading dynamics47.

A common theoretical tool to deal with network spreading dynamics is mean-field analysis. The earlier version of the mean-field theory assumed that all nodes in the network are regarded as statistically equivalent9. To account for the non-homogeneous nature of real world networks, a heterogeneous mean field theory was developed in which the nodes with the same degree are considered as equivalent1. A more systematic approach to fully capturing the network topology was articulated—the so-called quench mean-field approximation10,11. To take into account dynamic correlations, the method of pairwise approximation can be exploited51,52,53,54 which centers about analyzing the evolution of the states of nodal pairs. An approximate master equation theory can lead to more accurate theoretical predictions and can be reduced to the pair-wise approximation theory and the mean field theory through proper approximations55. A mean-field analysis based on the pair approximation for non-Markovian SIR dynamics on networks was recently developed45,46,48.

Our work is motivated by two considerations. The first concerns about the development of a general theoretical framework to deal with non-Markovian processes. In particular, in spite of the previous studies, a comprehensive framework to analyze and understand the full dynamical evolution of non-Markovian spreading processes is still lacking. Especially, in the existing literature on network spreading dynamics, Markovian or non-Markovian, a central focus has been on the final steady state of the system, with the transient dynamics leading to the final state largely ignored. In nonlinear dynamical systems, transient behaviors have been recognized as relevant as or even more important than the final state. For example, transient chaos arises commonly in nonlinear dynamical systems and is typically more ubiquitous than attractors (final states)56. In ecological systems, transient dynamics have been long recognized as the main source on which empirical observations rely and are thus a key driving force of natural evolution57,58,59,60,61. For non-Markovian type of network spreading dynamics, we lack a theory to describe both transient dynamics and final steady state. The second motivation is that, since Markovian spreading processes, while ideal, are amenable to rigorous mathematical analyses and thus often afford a complete understanding of the detailed underlying dynamics, it is of great interest to uncover conditions under which a non-Markovian process is equivalent to or can be approximated by a Markovian one.

In this paper, we articulate a first-order mean field theory for SIS dynamics with non-Markovian infection and recovery processes. We define the probability density function of state age of node (or of edge) and derive the corresponding partial differential equations that govern the evolution of the density functions. We demonstrate that the theory can predict well both the transient behaviors and the steady states of non-Markovian spreading on synthetic and empirical networks. A key finding is that the edge activation rule determines whether there is an equivalence between non-Markovian and Markovian SIS dynamics, and we show that a specific type of activation rule can lead to an exact equivalence. For non-Markovian processes that are not equivalent to Markovian ones, a relatively large infection density of the whole network makes the process closer to being Markovian. With the ability to analyze transient dynamics, the developed theoretical framework not only leads to a picture of the entire evolution process of non-Markovian spreading dynamics, but also results in a deeper understanding of the conditions under which a non-Markovian process is equivalent to a Markovian one.

Results

Non-Markovian spreading dynamics on complex networks

In the classical, Markovian SIS model, a node in a network can be in the susceptible or infected state. An infected node can pass on the virus to any of its susceptible neighbors at certain transmission rate and return to the pool of susceptible nodes at a fixed recovery rate. Because of the Markovian and memoryless nature of the model, transmission of disease and recovery of nodes both are Poisson processes, i.e., both the infection and recovery time are exponentially distributed. In contrast, in a non-Markovian epidemic process with memory, neither the infection nor the recovery time follows an exponential distribution. Instead, such distributions are typically “fat-tailed” due to the highly heterogeneous nature of various human behaviors12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33.

For a non-Markovian epidemic process, the infection and recovery rates are generally time dependent. To gain insights into defining these rates, we begin with a key quantity: the infection age (or susceptibility age) τ of a node, which is the time elapsed from the birth of its current state, i.e., an infected state or a susceptible state, to the current time t. If a node becomes infected at time t − τ and has not recovered by time t, its infection age at time t will be τ. An infected node decays spontaneously into the susceptible state after a random time τ whose probability distribution is ψrec(τ), indicating that the infected node will recover during the infinitesimal infection age interval (τ, τ + dτ) with the probability ψrec(τ)dτ. Similarly, the activation age (or non-activation age) κ of an edge can be defined, where the active edges host statistically independent stochastic infection processes of the same distribution ψinf(κ). That is, the probability that an active edge transmits the disease during the infinitesimal active age interval (κ, κ + dκ) is ψinf(κ)dκ. If a susceptible node has more than one active edge, an infection process will take place independently along each active edge.

The time dependent recovery and infection rates can then be evaluated43,47 based on the distributions ψrec(τ) and ψinf(κ). In particular, if an event has not taken place by a time since the process was initiated, it will take place in the next time interval with a conditional probability. The recovery and infection rates are thus given by, respectively,

$$\omega _{{\mathrm{rec}}}(\tau ) = \frac{{\psi _{{\mathrm{rec}}}(\tau )}}{{{\Psi} _{{\mathrm{rec}}}(\tau )}}$$
(1)

and

$$\omega _{{\mathrm{inf}}}(\kappa ) = \frac{{\psi _{{\mathrm{inf}}}(\kappa )}}{{{\Psi} _{{\mathrm{inf}}}(\kappa )}},$$
(2)

where Ψrec(τ) and Ψinf(κ) are the corresponding survival probabilities. Especially,

$${\Psi} _{{\mathrm{rec}}}({\tau} ) = \int_{\tau } ^{ + \infty } {{\psi} _{{\mathrm{rec}}}({\tau} {\prime} ){\mathrm{d}}\tau {\prime}}$$
(3)

is the probability that the infected node will not recover before the infection age τ and

$${\Psi} _{{\mathrm{inf}}}(\kappa ) = \int_{\kappa} ^{ + \infty } {\psi _{{\mathrm{inf}}}(\kappa \prime ){\mathrm{d}}\kappa \prime }$$
(4)

is the probability that the active edge never transmits the disease in the range of the active age from 0 to κ. Substituting Ψrec(τ) and Ψinf(κ) into Eqs. (1) and (2), we obtain

$${\Psi} _{{\mathrm{rec}}}(\tau ) = e^{-{\int}_{0}^{\tau} \, \omega _{{\mathrm{rec}}}(\tau {\prime}){\mathrm{d}}\tau {\prime}}$$
(5)

and

$${\Psi} _{{\mathrm{inf}}}(\kappa ) = e^{-\int_{0}^{\kappa} \, \omega _{{\mathrm{inf}}}(\kappa {\prime}){\mathrm{d}}\kappa {\prime}}$$
(6)

The recovery and infection time distributions can thus be expressed, respectively, as

$$\psi _{{\mathrm{rec}}}(\tau ) = \omega _{{\mathrm{rec}}}(\tau )e^{ - \int_{0}^\tau {\omega _{{\mathrm{rec}}}(\tau \prime )\mathrm{d}\tau \prime } },$$
(7)

and

$$\psi _{{\mathrm{inf}}}(\kappa ) = \omega _{{\mathrm{inf}}}(\kappa )e^{ - \int_{0}^\kappa {\omega _{{\mathrm{inf}}}(\kappa \prime )\mathrm{d}\kappa \prime } }.$$
(8)

In the special case of memoryless Markovian model, the temporal processes follow the Poisson statistics, where the distributions are exponential with their respective constant rate.

For epidemic spreading on a network, there are various mechanisms to activate edges. We focus on the two basic mechanisms to generate active edges43,47. In general, an undirected edge can be regarded as being equivalent to two directed edges in the opposite directions, and a directed edge with starting node j and ending node i is denoted as i ← j. For the first mechanism (type-I), which is the same as rule 1 in ref. 43, one defines a directed link i ← j as an active edge when node j is an infected node and node i is susceptible. If an active edge i ← j transmits the disease, the healthy node i will turn into the infected state and the edge i ← j will become non-active. For the second mechanism (type-II), which is the same as that in ref. 47, a directed link i ← j is defined as an active edge when node j is an infected node regardless of the state of node i. Once the active edge i ← j transmits the disease, node i will turn into the infected state if it is susceptible, or nothing happens to node i if it is already infected. At the same time, the active edge i ← j will become a new active edge with active age κ = 0. Figure 1 shows the cases in which the active age of an active edge is zero. In the special case of non-Markovian process where ψinf(κ) follows an exponential distribution and the infection rate ωinf(κ) is a constant independent of time, the SIS models constructed according to the two respective mechanisms are equivalent.

Fig. 1
figure 1

Two mechanisms to activate edges. For the first mechanism (type-I), there are two cases in which the state age of an active edge is set to zero: a the event is driven by the generation of infected node, b it results from the generation of an susceptible node. For the second mechanism (type-II), there are four independent scenarios for setting zero the age of an active edge: c, d the event occurs because of the generation of an infected node, e, f it is caused by the transmission of the disease. Blue dashed and red solid circles represent susceptible and infected nodes, respectively. Purple dashed and orange solid arrows denote nonactive and active edges, respectively. Each state transition takes place in an infinitesimal time interval dτ or dκ, where dτ = dκ

First-order mean-field theory for non-Markovian spreading

To describe the full dynamical evolution of non-Markovian epidemic spreading on networks, we articulate a theoretical framework based on the approach of first-order mean-field analysis. Specifically, we begin by defining Ii(τ; t) and Si(τ; t) as the probability density functions that node i stays in the infected and susceptible state aged τ at time t, respectively48. The probability of node i being in the infected state aged from τ to τ +  is thus Ii(τ; t). In the time interval (t, t + dt), node i returns to the susceptible state with probability ωrec(τ)dt and the probability that the state of the node remains unchanged is 1 − ωrec(τ)dt. After the infinitesimal time interval dt has elapsed, the age of node i and that of the active edge i ← j both will increase by the amount dt. We thus have dt = dτ = dκ. At time t + dt, the probability density function that node i still remains in the infected state aged τ + dτ is given by

$$I_i(\tau + \mathrm{d}\tau ;t + \mathrm{d}t) = [1 - \omega _{{\mathrm{rec}}}(\tau )\mathrm{d}\tau ]I_i(\tau ;t).$$
(9)

This difference equation can be rewritten as a partial differential equation:

$$(\frac{\partial }{{\partial \tau }} + \frac{\partial }{{\partial t}})I_i(\tau ;t) = - \omega _{{\mathrm{rec}}}(\tau )I_i(\tau ;t).$$
(10)

Since the infected node i with infection age ranging from 0 to +∞ can switch into the susceptible state of age zero insofar as there is a recovery, the probability density function that node i returns to the susceptible state aged τ = 0 is

$$S_i(0;t + \mathrm{d}t) = \int_{0}^{ + \infty } {\omega _{{\mathrm{rec}}}(\tau )I_i(\tau ;t)\mathrm{d}\tau } .$$
(11)

To describe the time evolution of Si(τ; t), we assume that the ages of two connected nodes are uncorrelated. The probability density function that node i in the susceptible state of age τ is infected by node j at time t can be written as Φij(τ; t). During the time interval (t, t + dt), the susceptible node i aged τ is infected by its neighbors with the probability \(\mathop {\sum}\limits_{j = 1}^N {a_{ij}{\Phi} _{i \leftarrow j}(\tau ;t)\mathrm{d}\tau }\), where N is the network size and aij is the ijth element of the network adjacency matrix. We thus get the partial differential equation governing the evolution of Si(τ; t) as

$$\left(\frac{\partial }{{\partial \tau }} + \frac{\partial }{{\partial t}}\right)S_i(\tau ;t) = - S_i(\tau ;t)\mathop {\sum}\limits_{j = 1}^N {a_{ij}{\Phi} _{i \leftarrow j}(\tau ;t)} .$$
(12)

Since a susceptible node i with any susceptibility age ranging from 0 to +∞ can be infected and switches into the infected state aged zero as a result of the infection process, the probability density function that node i enters into the infected state aged τ = 0 is

$$I_i(0;t + {\mathrm{dt}}) = \int_{0}^{ + \infty } S_i(\tau ;t) \sum\limits_{j = 1}^N {a_{ij}{\Phi} _{i \leftarrow j}(\tau ;t)} {\mathrm{d}}\tau.$$
(13)

For different activation mechanisms of active edges, namely, type-I and type-II, the forms of Φij(τ;t) are different. For type-I mechanism, once an infected node j and a susceptible node i appear on both ends of an edge, the directed edge i ← j will be activated or, equivalently, the edge will enter into an active state aged κ = 0. Ignoring the dynamical correlation between any pairwise nodes, the age of the active edge is determined by the smaller age of the connected nodes, min(τ, τ′), where τ and τ′ are the susceptibility age of node i and the infection age of node j, respectively. We thus have

$${\Phi} _{i {\leftarrow} j}(\tau ;t) = \int_{0}^{ + \infty } {\omega _{{\mathrm{inf}}}[\min (\tau ,\tau \prime )]I_j(\tau \prime ;t)\mathrm{d}\tau \prime } ,$$
(14)

where ωinf[min(τ, τ′)] is the infection rate of the active edge whose age is equal to the smaller one of the end nodes.

For type-II mechanism, the age of the active edge i ← j depends on the infected node j only, and we have

$${\Phi} _{i \leftarrow j}(\tau ;t) = \int_{0}^{ + \infty } {\eta (\tau \prime )I_j(\tau \prime ;t)\mathrm{d}\tau \prime } ,$$
(15)

where the infection rate η(τ) of the infected node j aged τ satisfies the integral equation

$$\eta (\tau ) = \int_{0}^\tau {\eta (\tau \prime )\psi _{{\mathrm{inf}}}(\tau - \tau \prime )\mathrm{d}\tau \prime + \psi _{{\mathrm{inf}}}(\tau )} .$$
(16)

The solution of Eq. (16) can be written as

$$\eta (\tau ) = \int_{\sigma - i\infty }^{\sigma + i\infty } {\frac{{\hat \psi _{{\mathrm{inf}}}(s)}}{{1 - \hat \psi _{{\mathrm{inf}}}(s)}}e^{s\tau }\mathrm{d}s} ,$$
(17)

where \(\hat \psi _{{\mathrm{inf}}}(s)\) is the Laplace transform of ψinf(τ):

$$\hat \psi _{{\mathrm{inf}}}(s) = \int_{0}^{ + \infty } {\psi _{{\mathrm{inf}}}(\tau )e^{ - s\tau }\mathrm{d}\tau }$$
(18)

Supplementary Fig. 1 in Supplementary Note 2 presents the analysis of η(τ) for type-II edge activation mechanism.

Equations (10) and (12) govern the time evolution of non-Markovian SIS spreading dynamics in general, with the boundary conditions given by Eqs. (11) and (13). The state transition processes can be described as the probability flows between the infected and susceptible states determined by the functions Ii(τ; t) and Si(τ; t), as well as those within each state. A schematic illustration of the various probability flows is shown in Fig. 2. The initial conditions for Eqs. (10) and (12) are the initial probability distributions of each node:

$$I_i(\tau ;0) = \rho _i(\tau )$$
(19)

and

$$S_i(\tau ;0) = \chi _i(\tau ),$$
(20)

where ρi(τ) and χi(τ) are the probability densities of the ages of node i being in the infected and susceptible state, respectively.

Fig. 2
figure 2

Schematic representation of probability flows. Each illustration is divided into blocks of width  → 0, and the area of each block represents the probability that node i is in the corresponding state aged from τ to τ + dτ. a Two distributions, Ii(τ; t) and Si(τ; t), of node i at time t. b Each block losses probability ωrec(τ)Ii(τ; t)dτ or \(S_i(\tau ;t)\mathop {\sum}\limits_{j = 1}^N {a_{ij}\Phi _{i \leftarrow j}(\tau ;t)} \mathrm{d}\tau\) and converges to \({\int}_0^{ + \infty } {\omega _{{\mathrm{rec}}}(\tau )I_i(\tau ;t)\mathrm{d}\tau }\) and \({\int}_0^{ + \infty } {S_i(\tau ;t)\mathop {\sum}\limits_{j = 1}^N {a_{ij}\Phi _{i \leftarrow j}(\tau ;t)} \mathrm{d}\tau }\), respectively. c Each block moves one step to the right, and the empty blocks Si(0;t + dt) and Ii(0;t + dt) are filled with the probabilities \({\int}_0^{ + \infty } {\omega _{{\mathrm{rec}}}(\tau )I_i(\tau ;t)\mathrm{d}\tau }\) and \({\int}_0^{ + \infty } {S_i(\tau ;t)\mathop {\sum}\limits_{j = 1}^N {a_{ij}\Phi _{i \leftarrow j}(\tau ;t)} \mathrm{d}\tau }\), respectively. d The distributions Ii(τ; t + dt) and Si(τ; t + dt) at time t + dt

Transient behaviors

To test the power of our mean-field theory to predict transient behaviors in non-Markovian processes, we carry out Monte Carlo simulations47,62 of SIS dynamics on different types of networks (see “Methods” for details). To be general, in the simulations, we set ψinf(κ) and ψrec(τ) to be the long-tailed, Weibull type of distribution as

$$\psi _{{\mathrm{inf}}}(\kappa ) = \frac{{\alpha _{\mathrm{I}}}}{{\beta _{\mathrm{I}}}}(\frac{\kappa }{{\beta _{\mathrm{I}}}})^{\alpha _{\mathrm{I}} - 1}e^{ - (\frac{\kappa }{{\beta _{\mathrm{I}}}})^{\alpha _{\mathrm{I}}}}$$
(21)

and

$$\psi _{{\mathrm{rec}}}(\tau ) = \frac{{\alpha _{\mathrm{R}}}}{{\beta _{\mathrm{R}}}}(\frac{\tau }{{\beta _{\mathrm{R}}}})^{\alpha _{\mathrm{R}} - 1}e^{ - (\frac{\tau }{{\beta _{\mathrm{R}}}})^{\alpha _{\mathrm{R}}}},$$
(22)

where (αI, αR) are the shape parameters and (βI, βR) are scale parameters. A smaller value of the shape parameter and/or a larger value of the scale parameter corresponds to more extensive heterogeneity of the age distribution.

Figure 3 shows, for three different types of networks, the evolution of the infected density of the entire network over time, where the density value predicted by the mean-field theory is calculated with \(I(t) = \mathop {\sum}\limits_{i = 1}^N {I_i(t)} /N\). Initially, 1% of the nodes are randomly chosen to be the infection seed and their infection ages are all zero. A small αI value for which the distribution ψinf(κ) is strongly heterogeneous will lead to a large-scale disease outbreak, due mainly to the small mean infection time. In Fig. 3a–c, the Monte-Carlo simulation results and the theoretical predictions for the type-I activation mechanism are presented for Erdös-Rényi (ER) random, Barabási-Albert (BA) scale-free, and Hamsterster networks, respectively. The Hamsterster network is a real-world social network in the human society63. Figure 3d–f shows the comparison results of the temporal evolution of the infected density for processes with type-II activation mechanism. The mean-field predictions of the time evolution are generally in good agreement with those of non-Markovian type of SIS spreading dynamics on random (homogeneous), scale-free (heterogeneous), and Hamsterster (real-world) networks.

Fig. 3
figure 3

(Color online) Comparison of time evolution between simulated and theoretical results. Panels in the first and second rows (ac and df), respectively, are for the type-I and type-II mechanisms. The three columns from left to right are for ER random, BA scale-free, and Hamsterster networks, respectively. In all panels, the solid symbols represent the results of simulations which are averaged over 100 realizations for random and scale-free networks, and over 400 realizations for the Hamsterster network. The open symbols represent the results of theoretical solutions obtained from Eqs. (10)–(13). The symbols diamonds, circles, triangles, and stars correspond to αI = 0.5, 1, 2, 4, respectively. The random and scale-free networks have size N = 104 and mean degree 〈k〉 ≈ 10, and the Hamsterster network has N = 2426 and 〈k〉 ≈ 13.7. The insets in panels a, d show the extinction process with αI = 4. Other parameters are βI = 1, αR = 2, and βR = 0.5

However, in some cases (e.g., αI = 4 for ER random networks), there are some discrepancies between the predictions from the first-order mean-field theory and the simulation results [c.f., insets in Fig. 3a, d], due to the exclusion of any dynamical correlation. For a more accurate description of non-Markovian spreading processes, the dynamical correlation in the evolution of states of connected nodal pairs must be taken into account. To meet this challenge, we articulate a second-order mean field approach and show that it is capable of predicting the simulation results more accurately than the first-order theory, even for extreme situations where the disease decays rapidly [e.g., the αI = 4 case in Supplementary Fig. 2c, d]. The second-order theory indicates that, in general, dynamical correlation such as temporal correlation between active edges can significantly affect the accuracy of the mean-field analysis (see Supplementary Fig. 2 and Supplementary Note 3 for details). Due to the limitation of computational feasibility, we have tested the predictions of the second-order mean field theory for homogeneous networks. To extend the study to heterogeneous networks is currently infeasible due to the extreme high computational complexity required to treat all possible nodal pairs separately.

We further investigate the effects of infection time distribution and degree distribution on the transient time in Supplementary Notes 4 and 5, respectively. For a certain network topology and a given edge activation mechanism, a larger value of the shape parameter αI leads to a longer transient phase. Intuitively, a narrower distribution of the infecting activities makes it easier for the system to reach a final steady state. (Supplementary Fig. 3 displays results on transient time versus αI). For fixed values of the structural and dynamical parameters, random networks lead to longer transients, due mainly to the lack of hub nodes that can act as “super-spreaders”. We find that a smaller value of the power-law exponent and a larger value of the lower-cutoff degree can lead to a shorter transient lifetime, indicating that hub nodes in a scale-free network can expedite spreading processes of the non-Markovian type. Supplementary Fig. 4 presents systematic results on the transient lifetime versus the values of the power-law exponent and the lower-cutoff degree.

Equivalence between non-Markovian and Markovian spreading

To establish the conditions under which an equivalence between non-Markovian and Markovian type of SIS spreading dynamics arises, we analyze the steady-state behavior. For non-Markovian type of SIS spreading dynamics for t → +∞, we define the following asymptotic probability density functions:

$$\tilde I_i(\tau ) = \mathop {{\lim }}\limits_{t \to + \infty } I_i(\tau ;t),$$
(23)
$$\tilde S_i(\tau ) = \mathop {{\lim }}\limits_{t \to + \infty } S_i(\tau ;t),$$
(24)
$${\tilde{\Phi}} _{i \leftarrow j}(\tau ) = \mathop {{\lim }}\limits_{t \to + \infty } {\Phi} _{i \leftarrow j}(\tau ;t).$$
(25)

From Eqs. (10) and (12), we obtain the differential equations for the probability density functions in the steady state as

$$\frac{{{\mathrm{d}}\tilde I_i(\tau )}}{{\mathrm{d}\tau }} = - \omega _{{\mathrm{rec}}}(\tau )\tilde I_i(\tau ),$$
(26)
$$\frac{{{\mathrm{d}}\tilde S_i(\tau )}}{{\mathrm{d}\tau }} = - \tilde S_i(\tau )\mathop {\sum}\limits_{j = 1}^N {a_{ij}\tilde {\Phi} _{i \leftarrow j}(\tau )} .$$
(27)

In the steady state, the probabilities that a node is newly infected and that a node recovers are equal11, so we have

$$\tilde I_i(0) = \tilde S_i(0).$$
(28)

In the steady state, the probabilities that node i is in the infected state and in the susceptible state are, respectively,

$$\tilde I_i = \int_{0}^{ + \infty } {\tilde I_i} (\tau )\mathrm{d}\tau$$
(29)

and

$$\tilde S_i = \int_{0}^{ + \infty } {\tilde S_i} (\tau )\mathrm{d}\tau .$$
(30)

For type-I activation mechanism, we can obtain a relation between the probabilities of node i being in the infected and susceptible state as

$$\frac{1}{{\tilde I_i}} = \frac{1}{{\tilde S_i}}\mathop {\sum}\limits_{n = 1}^{+\infty} {\delta _{{\mathrm{eff}}}\vartheta ^{(n)}(0)(\frac{1}{{\mathop {\sum}\limits_{j = 1}^N {a_{ij}\tilde I_j} }})^n} ,$$
(31)

or

$$\frac{1}{{\tilde I_i}} = \frac{1}{{\lambda _{{\mathrm{eff}}}^ \ast \tilde S_i\mathop {\sum}\limits_{j = 1}^N {a_{ij}\tilde I_j} }} + \frac{1}{{\tilde S_i}}\mathop {\sum}\limits_{n = 2}^{+\infty} {\delta _{{\mathrm{eff}}}\vartheta ^{(n)}(0)(\frac{1}{{\mathop {\sum}\limits_{j = 1}^N {a_{ij}\tilde I_j} }})^n} ,$$
(32)

where the effective recovery rate is

$${\delta} _{{\mathrm{eff}}} = \frac{1}{{{\int}_0^{ + \infty } {{\Psi} _{{\mathrm{rec}}}(\tau )\mathrm{d}\tau } }},$$
(33)

ϑ(τ) is the inverse of the function Ω(τ) given by

$${\Omega} (\tau ) = \delta _{{\mathrm{eff}}}\int_{0}^\tau {\int_{0}^{ + \infty } {\omega _{{\mathrm{inf}}}[\min (\tau \prime ,\tau \prime\prime )]{\Psi} _{{\mathrm{rec}}}(\tau \prime )\mathrm{d}\tau \prime } \mathrm{d}\tau \prime\prime } ,$$
(34)

and ϑ(n)(0) is the nth derivative of ϑ(τ) at τ = 0 and \({\lambda} _{{\mathrm{eff}}}^{\ast}\) is defined as

$${\lambda} _{{\mathrm{eff}}}^{\ast} = 1/[{\delta} _{{\mathrm{eff}}}{\vartheta} ^{(1)}(0)].$$
(35)

The procedure to derive Eqs. (31) and (32) is detailed in Supplementary Note 1.

For type-II activation mechanism, the relation between the probabilities can be obtained as

$$\tilde I_i = \lambda _{{\mathrm{eff}}}\tilde S_i\mathop {\sum}\limits_{j = 1}^N {a_{ij}\tilde I_j} ,$$
(36)

where λeff is the effective infection rate with the specific form

$$\lambda _{{\mathrm{eff}}} = \int_{0}^{ + \infty } {\eta (\tau )\Psi _{{\mathrm{rec}}}(\tau )\mathrm{d}\tau } .$$
(37)

Substituting Eq. (17) for η(τ) into Eq. (37), we have

$$\lambda _{{\mathrm{eff}}} = \frac{1}{{2\pi i}}\int_{C} {\frac{{\hat \psi _{{\mathrm{inf}}}(s)\hat \psi _{{\mathrm{rec}}}( - s)}}{{1 - \hat \psi _{{\mathrm{inf}}}(s)}}\frac{{\mathrm{d}s}}{s}} ,$$
(38)

where \(\hat \psi _{{\mathrm{inf}}}(s) = {\int}_0^{ + \infty } {\psi _{{\mathrm{inf}}}(\tau )e^{ - s\tau }\mathrm{d}\tau }\), \(\hat \psi _{{\mathrm{rec}}}(s) = {\int}_0^{ + \infty } {\psi _{{\mathrm{rec}}}(\tau )e^{ - s\tau }d\tau }\), and C is a contour that encloses the entire Re(s) > 0 region42,64 (see Supplementary Note 2 for details).

Under what conditions can one expect the non-Markovian SIS dynamics to reduce to Markovian dynamics in the steady state? To address this question, we note that the equivalence requires that the non-Markovian steady-state equations be written42,47 in the form of Eq. (36), or

$$\frac{1}{{\tilde I_i}} = \frac{1}{{\lambda _{{\mathrm{eff}}}\tilde S_i\mathop {\sum}\limits_{j = 1}^N {a_{ij}\tilde I_j} }}.$$
(39)

For non-Markovian SIS spreading dynamics with type-II activation mechanism, such an equivalence does exist.

However, for processes with type-I activation mechanism, because of the high-order terms (n ≥ 2) in Eq. (32), in general an equivalence to Markovian dynamics cannot be expected. Nonetheless, under certain conditions, an approximate equivalence can arise. In particular, if both ϑ(1)(0) and ϑ(n)(0)(n ≥ 2) have a finite value, a large value of \(\mathop {\sum}\limits_{j = 1}^N {a_{ij}\tilde I_j}\) will dominate the right-hand side of Eq. (32), making the high-order terms \({\sum}_{n=2}^{+ \infty} \vartheta^{(n)}(0)(1/{\sum}_{j = 1}^{N} {a_{ij}{\tilde {I}}_{j}} )^{n}\) negligibly small. The approximation depends on the local nodal properties, which is typically valid locally for large degree nodes and high infected density of neighboring nodes. For the small-degree nodes, the high-order terms in Eq. (32) can no longer be neglected. In general, the validity of the approximation for the whole network depends not only on the infection density but also on the network structure, and the approximate equivalence holds if the small-degree nodes are not abundant in the network. If there is an appreciable fraction of small-degree nodes in a strongly heterogeneous network, the approximate equivalence would fail. Otherwise, the effective infection rate can be approximated as

$$\lambda _{{\mathrm{eff}}} \approx \lambda _{{\mathrm{eff}}}^ \ast .$$
(40)

Furthermore, when the infection process is Markovian regardless of whether the recovery process remains non-Markovian or Markovian, there exists an equivalence between non-Markovian and Markovian types of SIS dynamics with the following equality (see Supplementary Note 1):

$$\lambda _{{\mathrm{eff}}} = \lambda _{{\mathrm{eff}}}^ \ast .$$
(41)

For non-Markovian SIS dynamics which can be equivalent to Markovian dynamics, the outbreak threshold is given by65

$${\lambda} _{\mathrm{c}}^{{\mathrm{eff}}} = \frac{1}{{{\Lambda} _{{\mathrm{max}}}}},$$
(42)

where Λmax is the maximum eigenvalue of the network adjacency matrix. For processes with type-I mechanism where there is no equivalence between non-Markovian and Markovian dynamics, it is generally difficult to identify a relevant parameter to characterize the phase transition associated with disease outbreak.

To test when an equivalence between non-Markovian and Markovian spreading processes arises, we focus on the effects of the infection time distribution on the stationary infected density with both types of edge activation mechanisms. We first consider the case of type-II mechanism. We set αI = 0.5, 1, 2, 4, αR = 2, and βR = 0.5 and adjust λeff by changing βI through Eq. (37). Figure 4 shows the simulation results on random, scale-free and Hamsterster networks, which are the same as the networks in Fig. 3. It can be seen that, regardless of the network structure, the stationary infected density agrees well with both the result from Markovian process simulation and the analytical solution of the Markovian dynamics from Eq. (39) or (36). The theoretical thresholds calculated from Eq. (42) on random, scale-free, and Hamsterster networks are 0.096, 0.040 and 0.020, respectively, which are quite close to the simulated values of the threshold in Fig. 4. (Supplementary Fig. 5 in Supplementary Note 6 provides a comparison of stationary probability density distribution between simulation and theoretical prediction).

Fig. 4
figure 4

Demonstration of equivalence. Comparison of stationary infected density with type-II activation mechanism between non-Markovian and Markovian processes for a random b scale-free, and c Hamsterster networks which are the same as the networks in Fig. 3. Solid, dashed, dotted, and dot-dashed curves represent the results for αI = 0.5, 1, 2, 4, respectively, and the triangles and circles correspond to simulation results from the Markovian process and the analytical solutions, respectively. Other parameters are αR = 2 and βR = 0.5

We now turn to the type-I case. For αI = 1, the distribution of infection time is exponential, making the underlying non-Markovian process completely equivalent to a Markovian process with the effective recovery rate δeff and effective infection rate λeff given by Eqs. (33) and (41), respectively. Indeed, we find that, as λeff is increased, or, equivalently, as βI is decreased, the infected density for the non-Markovian process with type-I activation mechanism agrees with the theoretical value of the corresponding Markovian process (Supplementary Fig. 6 in Supplementary Note 7 shows the results). For αI ≠ 1, the exact equivalence breaks down. However, under certain conditions, an approximate equivalence can still be expected. To obtain the approximate equivalence, we analyze the effect of higher-order terms in Eq. (31) for non-Markovian process with type-I activation mechanism. For simplicity, we assume that ψrec(τ) is from Eq. (22) but ψinf(τ) is a Beta distribution:

$$\frac{1}{{B(\sigma ,\gamma )}}\kappa ^{\sigma - 1}(1 - \kappa )^{\gamma - 1}$$
(43)

with σ = 1. We have

$$\psi _{{\mathrm{inf}}}(\kappa ) = \gamma (1 - \kappa )^{\gamma - 1},$$
(44)

where 0 ≤ κ < 1 and ωinf(κ) = γ/(1 − κ). Especially, Eq. (44) turns into a uniform distribution ψinf(κ) = 1(0 ≤ κ < 1) for γ = 1. We set αR = 0.5, 1, 2, 4 and βR = 0.5, and adjust ϑ(n)(0) by changing the value of γ. From Eqs. (34), (31) and (44), for a fixed value of αR, the proportional relationship among all ϑ(n)(0) can remain invariant through a proper modification in the value of γ. In particular, an increase in the value of θ multiplying γ will result in an increase in the value of ωinf(τ) by θ times. As a result, every value of Ω(τ) will increase by the same factor θ. For n ≥ 0, the quantity ϑ(n)(0) will decrease by the factor of θ, making the proportional relationship unchanged. From Eq. (40), we obtain the approximate effective infection rate as λeff ≈ γ/δeff. Figure 5 demonstrates a significant deviation in the stationary infected density, when its values are relatively small, of the non-Markovian process from that of the Markovian process with the effective infection rate λeff. However, as the values of λeff and \(\tilde I\) are increased, the results for the non-Markovian process gradually converge to those for the Markovian process. For a large value of αR, the values of ϑ(n)(0) for n ≥ 2 are reduced, decreasing the gap between the results from the non-Markovian and Markovian processes. Simulation results on strong heterogeneous networks also verify these results (see Supplementary Fig. 7 in Supplementary Note 8 for details).

Fig. 5
figure 5

Demonstration of approximate equivalence. Shown are the stationary infected density with type-I activation mechanism for a random, b scale-free, and c Hamsterster networks, which are the same as the networks in Fig. 3, for βR = 0.5. Solid, dashed, dotted, and dot-dashed curves represent the results for αR = 0.5, 1, 2, 4, respectively. Triangles and circles denote the results from the Markovian process and its analytical solution, respectively. An approximate equivalence arises in the regime of large infected density

Discussion

Disease or virus spreading dynamics in networked systems in the real world are non-Markovian in that the temporal sequences of the occurrences of the key events underlying the spreading process do not follow a Poisson distribution. The non-Poisson behaviors make mathematical analyses of the spreading dynamics difficult, hindering their understanding. It is desired to develop a theoretical framework for non-Markovian spreading dynamics on complex networks. An issue of interest concerns about the inter-relation between non-Markovian and Markovian dynamics. Especially, while Markovian spreading processes with the Poisson characteristic are not a true reflection of real world situations, rigorous analyses and a relatively comprehensive understanding of the underlying dynamics are possible, as demonstrated in the past two decades5,7. A curiosity driven and practically significant question is then under what conditions will a non-Markovian process be equivalent to a Markovian one. And, if such an equivalence does not exist, to what extent can a non-Markovian process be approximated by a Markovian one? In spite of previous work on non-Markovian spreading dynamics on complex networks34,35,37,39,40,41,42,43,44,45,46,47,48, these issues have not been addressed satisfactorily, which motivated our current work.

We have developed a first-order mean field theory to solve both the transient phase and steady states of non-Markovian, SIS type of spreading dynamics. The theory can be used to assess accurately the difference between non-Markovian and Markovian dynamics, for any network structure. A finding is that, whether there is an equivalence between non-Markovian and Markovian processes depends on the specific edge activation mechanism. There are situations where non-Markovian SIS type of dynamics cannot be understood in terms of equivalent Markovian dynamics. We have identified one generic condition under which a complete equivalence between non-Markovian and Markovian processes holds: absence of any temporal correlation on active edges. When the correlation cannot be ignored due to the influence of susceptible nodes on active edges, the equivalence no longer holds. However, an approximate equivalence may still hold for the whole network, depending on the infection density and the network structure. We have found that, in the regime of relatively large infected density, a non-Markovian process can be approximated by a Markovian one for heterogeneous networks if small-degree nodes are not abundant in the network. All these findings were enabled by the theory developed in this paper.

While we have focused on non-Markovian, SIS type of spreading dynamics, a hope is that our mean-field theory can be extended to other types of dynamics such as SIR spreading or even cascading processes. Our work suggests the importance of accurately identifying the edge activation mechanisms responsible for spreading processes in the real world, which are key to determining whether an equivalence to Markovian dynamics exists so as to gain a deeper understanding of the underlying spreading process. Besides the two edge activation mechanisms, other types of edge activation mechanisms have been studied in the literature. For example, rule 2 in ref. 43 prescribes that the age of an active link is solely determined by the age of the infected node, which bears certain similarity but not identical to type-II edge activation studied in this paper. For this edge activation mechanism, an equivalence between non-Markovian and Markovian processes holds (see Supplementary Note 9 and Supplementary Figs. 810 for details). The issues of dynamical correlation and network communicability66 are also critically important to non-Markovian spreading dynamics, for which a theoretical framework, e.g., a higher-order mean field framework, is lacking. An interesting question is whether the equivalence holds in the higher-order mean field framework or in a transient process. For example, when the system is in transient, the distribution of the state age varies with time, making invalid dimension reduction in the analysis of the infection and susceptible probabilities. At the present, it is not feasible to determine whether there is an equivalences between non-Markovian and Markovian processes in the transient regime.

Methods

Random number generation

Taking ψinf(κ) for example, its survival probability distribution is expressed as \(\Psi _{{\mathrm{inf}}}(\kappa ) = {\int}_\kappa ^{ + \infty } {\psi _{{\mathrm{inf}}}(\kappa \prime )\mathrm{d}\kappa \prime }\). In order to obtain a random number κ, we generate a random number p uniformly distributed between zero and one and solve the equation

$$\Psi _{{\mathrm{inf}}}(\kappa ) = p.$$
(45)

For the Weibull distribution in Eq. (21) and the Beta distribution in Eq. (44), the value of κ is given by

$$\kappa = \beta _{\mathrm{I}}(\ln \frac{1}{p})^{1/\alpha _{\mathrm{I}}}$$
(46)

and

$$\kappa = 1 - p^{1/\gamma },$$
(47)

respectively. We calculate the elapsed time τ with the distribution ψrec(τ) in a similar way.

Simulation method

In a network, each infected node or active edge is marked with an event-time defined as the absolute time when the infected node will recover or when the active edge will transmit the disease. The event-times of susceptible nodes and non-active edges are set as +∞. All nodes and edges are assigned to a min-heap according to their event-times. Once the event-time of a node or an edge has changed, its position will be shifted in the min-heap instantaneously. Thus, the event-time of the node or edge at the root must be minimum. At each step, it is only necessary to make the node or edge at the root of the min-heap recover or transmit the disease62, respectively.

For an infected node located at the root, meaning that the recovery event of the node will occur first among all the events including recovery and disease-transmitting events in the network, we update the absolute time t to the event-time of the node and let the node recover. The event-time of the node then turns into +∞. This recovery event will lead to state changes of some edges connected to the node. If some edges become active, we assign them new event-times κ + t, where κ is a random number generated from the distribution ψinf(κ) and t is the current absolute time. The new event-time means the active edge will transmit disease at the absolute time κ + t. If some edges become non-active, their event-times become +∞.

If an active edge is located at the root, i.e., the disease transmission event of the edge will occur first among all the events, we update the absolute time t to the event-time of the edge, and then let the edge transmit disease. This transmission event can lead to a series of state changes of some nodes or edges and, consequently, the event-times of the new active and non-active edges are renewed to κ + t and +∞, respectively. In addition, the event-time of a new infected node will be updated to τ + t, where τ follows the distribution ψrec(τ).