Introduction

Temporal networks have been recognized as a powerful tool to model complex systems with time-varying interactions1,2,3. A large body of literature concentrates on analyzing the activation dynamics of nodes and links in such networks. The inter-event time (the waiting time between two consecutive interaction events, IET) is a canonical measure of temporal patterns, and it is known to have profound effects on individual behavior4,5,6,7 and dynamical processes occurring on networks8,9,10,11,12. A variety of empirical datasets, such as email and mobile communications13,14,15, epidemic transmission16,17,18, and human mobility19,20, exhibit non-Poisson activity patterns, known as burstiness4,21,22. These IET patterns are characterized by periods of frequent activation interleaved with long periods of silence. Empirical networks often exhibit burstiness in both the activity of individuals (nodes) as well as interactions (edges)23,24,25.

It has proven difficult to construct synthetic temporal networks whose properties are similar to the bursty behavior seen in empirical temporal networks26. Previous approaches can be divided into two categories: structure-based modeling, and contact-based modeling. The former approach applies dynamical processes to static underlying topologies, such as random walks27,28, link dynamics29, and inhomogeneous Poisson processes30. For example, Barrat et al. used random itineraries on weighted underlying networks to generate time-extended structures with bursty behavior28. The latter approach uses a stream of contacts generated by certain realistic mechanisms, such as social appeal31, individual resource32, and memory33. For example, Perra et al. proposed the activity-driven model34, in which each node, isolated in the beginning, becomes active with a probability proportional to its own activity potential and forms links with other nodes. Several related models have been proposed based on the activity-driven framework35,36. Despite a large body of studies in constructing temporal networks, they usually fail to reproduce the same level of burstiness as empirical datasets, and they lack mathematical guarantees for the behavior of the synthetic network. These goals require a model to generate bursty behavior simultaneously in the activity of both nodes and links, while the level of burstiness in nodes and links is allowed to be easily modified in a reasonable parameter space.

In this study, we provide an analytical framework to systematically construct temporal networks on both static and time-varying underlying topologies. Our construction algorithm can reproduce the burstiness of both nodes and edges in four empirical datasets, including social interactions in rural Malawi, colleague relationships in an office building over two years, and friendship relations in a high school. The assumptions of our model can also be tested in the empirical datasets. Our construction thus serves as an efficient method to generate realistic temporal networks that can then be used to investigate dynamical processes (such as evolutionary dynamics, social contagion, or epidemics) on temporal networks.

Our approach to constructing temporal networks uses a spanning-tree method. Spanning trees are widely recognized as an important family of sparse sub-graphs since they tend to govern dynamical processes on full graphs37,38,39,40. For example, in social networks, the backbone of an aggregated communication topology is often constructed as the union of shortest-path spanning trees, on which information flows fastest39. As a result, a large portion of directed edges are bypassed by faster indirect routes in the tree. In studies of food webs40, spanning trees are defined as the flows from the environment to every species. The links in or out of the tree are denoted as ‘strong’ or ‘weak’ links, related to delivery efficiency or system robustness and stability.

Results

We introduce a spanning-tree method for constructing temporal networks on any underlying topology, which restricts the interaction pattern between pairs of individuals. The activity of every single node and link is a binary-state process, switching between active and inactive. We use inter-event time (IET) distribution, which measures the time intervals between consecutive activations, to quantify the activity patterns of nodes and edges.

Our method allows for both static and time-varying underlying topologies. The underlying topology represents physical limitations on pairwise interactions, where an interaction between two individuals is possible only when there is a link between them in the underlying topology. Here we first consider static underlying topologies, in which the activation dynamics on a given topology is much faster than the evolution of the underlying topologies, such as the time-varying traffic flow on a relatively stable road network. We consider three classes of topologies in order of increasing complexity: two-node topologies, tree topologies, and finally arbitrary structured topologies. After studying static topologies, we will subsequently consider cases when the underlying topology itself also changes over time.

Two-node systems

We begin with a basic unit of a networked system – a two-node system, which is composed of nodes x and y and a link z between them (see Fig. 1a). The nodes and edges are either active or inactive at each discrete time step. We assume that the state updating of x follows a renewal process \({\{{X}_{n}\}}_{n\ge 0}\) and assigns x a probability mass function F(Δt) as its target IET distribution (see Supplementary Information section 1). The random variable Xn equals 1 if x is active at time n, otherwise Xn = 0. Likewise for node y and edge z, which have respective target IET distributions G(Δt) and H(Δt), and respective renewal processes \({\{{Y}_{n}\}}_{n\ge 0}\) and \({\{{Z}_{n}\}}_{n\ge 0}\). The initial state of x, y, z is active (i.e., X0 = Y0 = Z0 = 1). The goal is to construct a two-node temporal network that satisfies the target IET distributions of x, y, and z.

Fig. 1: Schematic illustration of constructing temporal networks on different underlying topologies.
figure 1

Each node/link switches between two states, active (solid circle/line) and inactive (dashed circle/line), and all nodes and links are set to be active initially. a The basic unit of a network system is a two-node system with nodes x, y, and a link z connecting them. At the beginning of temporal network construction, three probability mass functions F(Δt), G(Δt), H(Δt) are given as the expected IET distributions for x, y, z, where Δt represents the time interval between two consecutive activations. Then, the activity of x, y, z is driven by the renewal processes with the corresponding expected IET distributions. We constrain that z is active only if both x and y are active. b An extension of two-node systems is tree systems, in which nodes are divided into two categories, a root (r) and leaves (a1, a2, b1, b2). The state of nodes and links is updated by sequentially executing the algorithm over each two-node system from the root (r-a1 and r-a2) to the outermost leaves (a1-b1 and a2-b2). c There is at least one spanning tree for any static underlying topology. The links in the spanning tree are called trunks (purple lines) and the links outside the spanning tree are called branches (blue lines). The states of nodes and trunks are updated first, and then the states of branches are established according to the state of the nodes on both sides.

By definition, we say that edge z is active when x, y are both active (i.e., Zn = XnYn). Furthermore, we assume that, given the trajectory of x until n, the probability of x being active at time n + 1 is independent of the trajectory of y until n, that is,

$${\mathbb{P}}({X}_{n+1},{{{{{{{{\bf{Y}}}}}}}}}^{(n)}| {{{{{{{{\bf{X}}}}}}}}}^{(n)})={\mathbb{P}}({X}_{n+1}| {{{{{{{{\bf{X}}}}}}}}}^{(n)})\cdot {\mathbb{P}}({{{{{{{{\bf{Y}}}}}}}}}^{(n)}| {{{{{{{{\bf{X}}}}}}}}}^{(n)}),$$
(1)

where X(n) is a random vector of length n + 1, equal to \({({X}_{0},{X}_{1},...,{X}_{n})}^{{{{{{{{\rm{T}}}}}}}}}\). The vector X(n) records the whole history of states of x through time n, and so does Y(n). Given these assumptions, we can show that when all targeted distributions are identical (i.e., F = G = H) the system must be completely synchronous, that is, all of x, y, z are either active or inactive at each time step (see Supplementary Information section 2).

Given the state of the first n times (from time 0 to n − 1), the conditional probability that node x is active at time n is given by

$${\mathbb{P}}({X}_{n}=1| {X}_{n-1}={w}_{x}^{(n-1)},...,{X}_{0}={w}_{x}^{(0)}) := {p}_{x}({{{{{{{{\bf{w}}}}}}}}}_{x}^{(n-1)},\, 1)=\frac{F(n-m)}{\mathop{\sum}\nolimits_{i\ge n-m}F(i)}.$$
(2)

where \({{{{{{{{\bf{w}}}}}}}}}_{x}^{(n-1)}={({w}_{x}^{(0)},...,{w}_{x}^{(n-1)})}^{{{{{{{{\rm{T}}}}}}}}}\in {\{0,1\}}^{n}\) records all historical states of node x before time n, called x’s trajectory, and \(m=\max \{k\le n:w_x^{(k)}=1\}\) represents the last activation time of x. Analogous conditional probabilities apply to y and z, and it is straightforward to show that each element of \({{{{{{{{\bf{w}}}}}}}}}_{z}^{(n-1)}\) equals the product of the corresponding elements of \({{{{{{{{\bf{w}}}}}}}}}_{x}^{(n-1)}\) and \({{{{{{{{\bf{w}}}}}}}}}_{y}^{(n-1)}\).

We propose an algorithm to construct two-node temporal networks such that the IET distributions of x, y, z will match the desired targeted distributions F, G, H and the desired total time duration ttol. At each time step t = n + 1 (0 ≤ n ≤ ttol − 1), we calculate four probabilities with Eq. (2),

$${p}_{1} ={\mathbb{P}}({X}_{n+1}=1,\, {Y}_{n+1}=1| {{{\bf{X}}}}^{(n)},\, {{{\bf{Y}}}}^{(n)})={p}_{z}({{{{{{{{\bf{w}}}}}}}}}_{z}^{(n)},\, 1),\\ {p}_{2} ={\mathbb{P}}({X}_{n+1}=1,\, {Y}_{n+1}=0| {{{\bf{X}}}}^{(n)},\, {{{\bf{Y}}}}^{(n)})={p}_{x}({{{{{{{{\bf{w}}}}}}}}}_{x}^{(n)},\, 1)-{p}_{z}({{{{{{{{\bf{w}}}}}}}}}_{z}^{(n)},\, 1),\\ {p}_{3} ={\mathbb{P}}({X}_{n+1}=0,\, {Y}_{n+1}=1| {{{\bf{X}}}}^{(n)},\, {{{\bf{Y}}}}^{(n)})={p}_{y}({{{{{{{{\bf{w}}}}}}}}}_{y}^{(n)},\, 1)-{p}_{z}({{{{{{{{\bf{w}}}}}}}}}_{z}^{(n)},\, 1),\\ {p}_{4} ={\mathbb{P}}({X}_{n+1}=0,\, {Y}_{n+1}=0| {{{\bf{X}}}}^{(n)},\, {{{\bf{Y}}}}^{(n)})=1+{p}_{z}({{{{{{{{\bf{w}}}}}}}}}_{z}^{(n)},\, 1)-{p}_{x}({{{{{{{{\bf{w}}}}}}}}}_{x}^{(n)},\, 1)-{p}_{y}({{{{{{{{\bf{w}}}}}}}}}_{y}^{(n)},\, 1).$$
(3)

These four probabilities represent the conditional probabilities for the four possible states of nodes x and y, given the previous states of nodes x and y (i.e., \({{{{{{{{\bf{w}}}}}}}}}_{x}^{(n-1)}\) and \({{{{{{{{\bf{w}}}}}}}}}_{y}^{(n-1)}\)). Specifically, p1 represents the probability that edge z is active at time t = n + 1; p2 (or p3) represents the probability that z, y are inactive but x is active; p3 represents the probability that z, x are inactive but y is active; and p4 represents the probability that x, y, z are all inactive at time t. Next, we determine the state of x and y at t, in order. The probability that x is active is \({p}_{x}({{{{{{{{\bf{w}}}}}}}}}_{x}^{(n)},1)\). If x is active, the probability of y being active is \({p}_{1}/{p}_{x}({{{{{{{{\bf{w}}}}}}}}}_{x}^{(n)},1)\). Otherwise, the probability becomes \({p}_{3}/(1-{p}_{x}({{{{{{{{\bf{w}}}}}}}}}_{x}^{(n)},1))\). Finally, we update the trajectory of z by the relation \({w}_{z}^{(t)}={w}_{x}^{(t)}{w}_{y}^{(t)}\). The construction stops when t = ttol. Algorithm 1 in Supplementary Information outlines the above procedure. It is worth noting that the activation order of x and y does not affect the IET distributions of x, y, z.

Although the algorithm is specified for an arbitrary combination of target IET distributions (F, G, H), these distributions must satisfy an implicit condition in order to guarantee the consistency of the construction. For example, if the target distributions specify that the link z is activated more frequently than the nodes x and y, then no construction is possible, because the link is active only when both nodes are active. This would result in at least one of the probabilities pi (i = 1, 2, 3, 4) in Eq. (3) being less than 0 during the construction. We say that the combination (F, G, H) of target distributions is consistent if pi (i = 1, 2, 3, 4) belong to [0, 1] for all possible trajectories \({{{{{{{{\bf{w}}}}}}}}}_{x}^{(n)}\) and \({{{{{{{{\bf{w}}}}}}}}}_{y}^{(n)}\) with any length n. When a two-node system is consistent, the algorithm is well-defined, and it ensures that the IET distributions of x, y, z will satisfy the targets F, G, H, respectively (see Supplementary Information section 2).

Tree systems

The construction for two-node systems can be naturally extended to tree systems, which consist of a number of interconnected two-node systems (Fig. 1b). We randomly select a node as the root r and classify the remaining nodes (i.e., leaves) according to their distance from r. We choose a desired target IET distribution for each node and link. At each time step, we first determine the state of r, which is only related to its own trajectory. Then, every leaf one step away from r (a1 and a2 in Fig. 1b) forms a two-node system with r, and the states of these leaves are determined by Algorithm 1. Next, all leaves one step away from r form two-node systems with their corresponding leaves two steps away from r [(a1, b1) and (a2, b2) in Fig. 1b]. Analogously, the states of all leaves are updated within a two-node system in order of their distance from r. Algorithm 2 in Supplementary Information summarizes this procedure.

This procedure requires an additional assumption of conditional independence – that for a pair of two-node systems sharing a node, if the state of the common node is given then the activity of the other two nodes is independent. As shown in Fig. 1b, we present two examples, (r, a1, a2) and (r, a1, b1), fulfilling this condition. The former indicates that the activity of nodes with the same distance from r (i.e., a1, a2) is independent given the state of their common node (i.e., r), which is closer to the root. The latter indicates that the activity of a node (i.e., b1) is not affected by the node that is more than one step away (i.e., r), given the state of the intervening node (i.e., a1).

It is straightforward to show that a tree system is consistent if all two-node systems in the tree are consistent. When a tree system is consistent, the IET distribution of every single node/link generated by this construction is guaranteed to match its corresponding target distribution (see Supplementary Information section 2).

Spanning-tree based construction

For any static (but arbitrary) underlying topology, we can always find a spanning tree (Fig. 1c). A link is called a trunk if it is in the spanning tree, and it is called a branch otherwise. In our construction, we first randomly select a spanning tree and the root of the tree, and then choose a target IET distribution for each node and trunk. Next, we execute Algorithm 2 on the spanning tree, so that all nodes and trunks will update their states to achieve the targeted IETs. The state of each branch is then active when the nodes on both ends are active. As a result, the activity of the entire system is determined by its spanning tree. Algorithm 3 in Supplementary Information summarizes this procedure. We say that the system is consistent when its spanning tree system is consistent.

Synthetic temporal networks

To test our algorithm, we construct temporal networks with one of two activity patterns—bursty activity patterns and Poisson activity patterns. Bursty patterns arise when there is a simultaneous bursty activity in node and links activity, and Poisson pattern arises in settings such as bank queuing systems41 and spreading dynamics42. In particular, we choose target IET distributions of nodes and trunks that are power-law distributions for bursty activity patterns, given by

$$p({{\Delta }}t;\alpha ) \sim {{\Delta }}{t}^{-\alpha }\quad (\alpha \, > \, 1).$$
(4)

And we choose discrete exponential distributions for Poisson-like activity patterns, given by

$$p({{\Delta }}t;\alpha ) \sim \int\nolimits_{{{\Delta }}t-1/2}^{{{\Delta }}t+1/2}\alpha {e}^{-\alpha x}{{{{{{{\rm{d}}}}}}}}x\quad (\alpha \, > \, 0),$$
(5)

where Δt represents the inter-event time and α the exponent. The respective survival functions are given as

$${\mathbb{P}}(T \, > \, {{\Delta }}t) \sim {{\Delta }}{t}^{-\alpha+1}$$
(6)

with exponent α − 1 and

$${\mathbb{P}}(T \, > \, {{\Delta }}t) \sim {e}^{-\alpha {{\Delta }}t}$$
(7)

with exponent α.

In the main text, we focus on a simple case when all nodes (trunks) have a common exponent αpmf (βpmf), and we use the aggregated IET distribution21,22,23, which counts the IETs of all nodes or links, to quantify the intensity of activity. In Supplementary Information, we also consider the IET distributions of every single node and link (Supplementary Fig. 1) and we investigate the relationship with the aggregated IET distributions. We also explore a more general case in which the exponents of nodes and trunks are sampled independently from a distribution (Supplementary Fig. 2).

We begin our analysis by constructing temporal networks with bursty activity patterns. We derive a necessary and sufficient condition for system consistency, which applies to any network length ttol (see Methods Eq. (14) and Supplementary Information for details). As examples, we consider two pairs of exponent setups, (αpmf, βpmf) = (2.00, 1.90) and (αpmf, βpmf) = (1.80, 1.30), and we execute Algorithm 3 over two classes of static underlying topologies, Barabási-Albert scale-free networks43 and Watts-Strogatz small-world networks44. Figure 2a shows the aggregated IET distributions of nodes and links. For both underlying topologies and both parameter setups, the probability mass functions \({\mathbb{P}}({{\Delta }}t)\) and the corresponding survival functions \({\mathbb{P}}(T > \, {{\Delta }}t)\) are well fit by power-law distributions, showing simultaneous burstiness in nodes and links. The best-fit exponent for nodes matches the exponent of the target IET distribution, and the exponent for links is slightly lower than the target exponent, due to the impact of branches (edges outside the spanning tree, where the algorithm is guaranteed to work).

Fig. 2: Aggregated IET distributions of nodes and links on different underlying topologies.
figure 2

We consider the construction of temporal networks on two classes of static underlying topologies, Barabási-Albert scale-free networks (first row) and Watts-Strogatz small-world networks (second row). The targeted exponent of every single node (trunk) is identical, denoted as αpmf (βpmf). We select a pair of high exponents (blue dots) and a pair of low exponents (green dots) for the bursty activity pattern (a) and the Poisson-like activity pattern (b), given as (αpmf, βpmf) = (2.00, 1.90), (1.80, 1.30) and (αpmf, βpmf) = (2.50, 2.00), (1.80, 1.30), respectively. The algorithmic distributions of nodes (circles) and links (squares) are well-predicted by power-law distributions in (a) and by exponential distributions in b. The thick black lines with fitted exponents are plotted for reference. The distributions are the average over 50 independent trials. Parameter settings: network size N = 103, average degree k = 6, and network length ttol = 104 in a and ttol = 103 in b.

Next, we construct temporal networks with Poisson-like activity patterns. If the target distributions for nodes and trunks are Poisson distributions, then we can prove that the system is never consistent (see Supplementary Information section 2). However, it is possible to construct consistent systems when the target IET follows discrete exponential distributions. In this case, we derive a necessary and sufficient condition for system consistency—namely, that the difference of αpmf and βpmf lies in \([0,\ln 2]\), meaning that the activity of nodes must be more frequent than links but not too frequent (see Methods and Supplementary Information for details). Figure 2b shows the aggregated IET distributions along with the exponents of the target distributions (αpmf, βpmf) = (2.50, 2.00) and (1.80, 1.30). All the distributions follow the expected exponential decay.

Comparing the results for the two topologies, we find that the exponents produced by the algorithmic construction are sensitive to the choice of target IET distribution, but are stable to the choice of network topology. To examine this observation more generally, we investigated a wide range of random regular underlying topologies with different average degrees, ranging from 5 to the well-mixed case (i.e., each node linked to all other nodes, see Supplementary Figs. 3 and 4). We find that we can robustly match target IET distributions across all these topologies: the relative deviation between the largest and smallest exponent in algorithmically constructed networks is within 4%.

We can understand why the algorithmic construction for producing a desired IET distribution is not significantly dependent on topology by analyzing the activity of branches. In particular, we prove that the IET distribution of every single branch is approximately a power-law distribution (respectively a discrete exponential distribution) in bursty activity patterns (respectively Poisson-like activity patterns) with uniform upper and lower bounds related only to the target distributions (see Supplementary Information section 3). This is also why the performance of our method is stable with respect to the choice of spanning tree (Supplementary Fig. 5).

Empirical temporal networks

We tested the ability of our algorithm to reproduce the burstiness of activity patterns observed in four empirical datasets, collected by the SocioPatterns collaboration. These four datasets record pairs of face-to-face interactions from different social contexts, ranging from a village in rural Malawi, to an office building and a high school in France. Each dataset is comprised of contact events with timestamps, represented by triplets (t, i, j)—indicating the occurrence of an interaction between individual i and individual j at time t.

It is worth noting that the empirical data record only the communication moments, so that only the active nodes with at least one active neighbor can be detected. In other words, the empirical data are observations of the inter-communication times (ICTs), rather than the IETs of nodes. Nevertheless, we demonstrate that the ICT distribution of single nodes converges exponentially to the IET distribution as the number of neighbors on the underlying topology increases (see Supplementary Information section 4). Since empirical datasets often originate from highly connected populations, the ICT distributions approximate the statistical properties of the corresponding IET distributions.

Before applying our algorithm, we first test whether the assumptions underlying the algorithmic construction are consistent with the empirical datasets. The assumption that the activity of nodes and links is a renewal process is reasonable, compared to the empirical data (Supplementary Fig. 6). However, the strong form of the conditional independence (Eq. (1)) assumed by our construction is rejected for the empirical data (Supplementary Fig. 7). Nonetheless, the empirical data satisfy a weaker form of conditional independence (Supplementary Fig. 8, see Supplementary Information section 5 for details).

After pre-processing the datasets (see Methods), we obtain four empirical temporal networks with population sizes ranging from N = 84 to N = 327 and length from ttol = 7, 375 to ttol = 43, 436 time-steps. For all of these temporal networks, the empirical ICT distributions of nodes and links both exhibit heavy tails, with different decay rates, showing simultaneous burstiness in activity. We fit these empirical ICTs with power-law distribution (Eq. (4)) by maximum likelihood estimation45,46, and we use the fitted distributions as targets for constructing synthetic temporal networks. Figure 3 shows the comparison between the empirical and algorithmically constructed ICT distributions of nodes and links. Our algorithm successfully replicates the qualitative patterns of burstiness observed in empirical datasets. Supplementary Fig. 9 shows the comparison between the IET and ICT distributions of nodes. Since the average degree of these empirical underlying topologies is large, the IET distribution collapses onto the ICT distribution.

Fig. 3: Burstiness in empirical datasets.
figure 3

We analyze four empirical temporal networks of social interactions within and across households among 84 individuals in a village69; colleague relationships among 95 and 219 employees in an office building in two different years (2013 and 2015)25,70; and friendship and educational relationships among 327 students in a high school in Marseilles71. The length of these temporal networks from left to right are 43436, 20129, 21536, and 7375. For each empirical temporal network, we count the aggregated ICT distributions of nodes (solid circles) and links (solid squares), which both present bursty behaviors and are well-predicted by power-law distributions. The thick black lines are power-law distributions with the fitted exponents. We take the fitted distributions as targets and obtain the respective algorithmic distributions of nodes (hollow circles) and links (hollow squares). The algorithmic distributions present the same level of burstiness as the corresponding empirical distributions.

Combination with network evolution

Although some underlying topologies are static, a variety of real-world systems also exhibit topology changes over timescales that are comparable to the activation dynamics on the network. For example, in online social networks, new users can enter the network and engage in new interactions with existing users; or users can switch between online and offline states. As a consequence, temporal changes in activity originate not only from the states of existing nodes and links, but also from the addition and subtraction of nodes and links in the underlying structure. In these cases, the underlying topology (i.e., physical limitations on interactions) is no longer static, but time-varying.

With this as a backdrop, we extend our algorithm from static to dynamic underlying topologies, starting first with networks that grow in size. We introduce a new model that combines our algorithm for constructing temporal networks with the Barabási-Albert model43, which we call the temporal Barabási-Albert model. The construction process is as follows. An underlying topology is initialized with m0 nodes, and the spanning tree is selected randomly. At each time step, the activity state of the existing network updates once with Algorithm 3, then one adds a new node with m ≤ m0 links connected to m different existing nodes following the preferential attachment rule43. All the newly added elements are set to be active, and the states of the older pre-existing elements are updated accordingly. The spanning tree is then updated by adding the new node and a link randomly selected from m new links. At some time point, the underlying topology stops growing, and the construction process continues with g ≥ 0 more steps on the final state of the underlying topology. Figure 4a shows a schematic illustration of the above procedure. Figure 4b shows numerical simulations of the temporal Barabási-Albert model in bursty and Poisson-like activity patterns. We find that the IET distributions of nodes and links are stable with respect to the duration time g, which means that the activity pattern is established during the evolution of the underlying topology, and it is then preserved after the topology is fixed.

Fig. 4: Construction on time-varying underlying topologies.
figure 4

a We consider the temporal network construction with a time-varying topology modeled by the Barabási-Albert model. There are m0 nodes in the initial snapshot. When the underlying topology is evolving, a node with m link(s) enters the network system (snapshot G), and the spanning tree is updated accordingly (snapshot T). When the evolution is stable, the construction process degenerates to that for the static underlying topology. b We consider the impact of the duration time g after network evolution stabilization. Our model produces expected bursty and Poisson-like activity patterns on such a time-varying underlying topology. Furthermore, the activity patterns formed during network evolution (hollow dots) are maintained after evolution stabilization (solid dots). Parameter settings: αpmf = 1.8, βpmf = 1.5, m0 = 3, m = 3, and final network size N = 500.

Aside from overall growth in system size, some systems change underlying topologies without increasing in size, but rather by changes in the links between individuals, even if the total number of links is stable over time. We show that our model is also applicable in this case (see Supplementary Figs. 10 and 11). In addition to changing the location of edges, nodes, and links may also be removed over time, due to aging or other recessionary impacts, which is a counterpart of system growth; a straightforward example is the reverse process of the temporal Barabási-Albert model.

To model these various kinds of network evolution, we have developed a more general procedure for constructing temporal networks on time-varying underlying topologies (see Supplementary Information Algorithm 4). The key to this algorithm is to update the spanning tree in accordance with the evolution of the underlying topology.

Topology of aggregated static networks

In addition to bursty in inter-event times, real-world temporal networks exhibit several other characteristic and distinguishing features28,47. One important feature, distinct from the IET distribution, is the topology of the weighted network generated by integrating snapshots of activity over time. In particular, we can consider the weighted network produced by aggregating active nodes and edges from time t = 1 to time t = tagg (Fig. 5a). The aggregated network is weighted, and we characterize its topology by considering the distribution of weighted node degree, which is a generalization of the node degree distribution.

Fig. 5: Node strength of aggregated temporal networks.
figure 5

a The aggregated network is a weighted network (network Ag) that collates all interactions from the first snapshot, at time t = 1, though the snapshot at time t = tagg. Link weights represent the activation numbers summed over network evolution, which can exceed 1 (such as the orange and green links). b, c The stationary property of node strength distributions on synthetic temporal networks. We consider two (unweighted) underlying topologies: Barabási-Albert scale-free networks (b) and Watts-Strogatz small-world networks (c). For the first topology, the survival function of the degree distribution follows a power-law distribution with an exponent γ ≈ 1.7 (red diamonds). The survival function of the node strength for aggregated networks also follows a power-law distribution with the same exponent as for the underlying topology, regardless of the aggregation duration tagg. For the second topology, we set a baseline aggregated network of aggregation time tbase. For any aggregation duration tagg > tbase, we normalize the survival function of node strength with respect to tbase, and we find that the survival function of the aggregated network collapse onto that of the baseline network, regardless of the duration tagg. Parameters: (αpmf, βpmf) = (2.00, 1.90) for the bursty activity pattern and (αpmf, βpmf) = (2.50, 2.00) for the Poisson-like activity pattern.

Our algorithm for constructing a temporal network with desired IET distributions also can reproduce the stationary property of the associated weighted node degree distribution. In particular, if the node degree distribution of the (unweighted) static underlying topology follows d(x), and if all links have the same activity pattern specified by parameter β, then for a sufficiently large aggregation time tagg we can prove that the weighted node degree distribution produced by our algorithm will satisfy

$${p}_{{t}_{{{\mbox{agg}}}}}(x) \sim \frac{v(\beta )d(xv(\beta )/{t}_{{{\mbox{agg}}}})}{{t}_{{{\mbox{agg}}}}}.$$
(8)

Here v(β) is a function of the parameter β that governs activity patterns (see Supplementary Information section 7 for detailed derivations). Equation (8) shows that, when the underlying topology is a scale-free network (i.e., d(x) follows a power-law distribution), then \({p}_{{t}_{agg}}(x)\) will also follow a power-law distribution with the same exponent as d(x), regardless of the aggregation duration tagg. Figure 5b shows an example of this general mathematical result in the case of a Barabási-Albert scale-free underlying topology.

For an arbitrary (unweighted) node degree distribution d(x), we can still find a normalization method such that the aggregated distribution is insensitive to the duration tagg. The normalization proceeds as follows: First, an aggregated network of aggregation time tbase is selected as the baseline. Then for any aggregated network of aggregation time tagg > tbase, we multiply tbase/tagg by each node strength. When tbase is sufficiently large, the normalized survival function for any tagg > tbase will collapse onto the survival function for tbase (see Supplementary Information section 7 for detailed derivations). We have verified this result on a network with a small-world topology (Fig. 5c).

Finally, we have applied this normalization procedure to the aggregated activity patterns of the four empirical datasets shown in Fig. 3. This analysis verifies that our construction of temporal networks to match empirical IET distributions also matches the stationary property of the weighted node degree in empirical data (Supplementary Fig. 12).

Discussion

Simple models that neglect temporal variation in individual behavior do not suffice to describe the dynamics of many real-life complex systems. A large and growing body of studies suggest that state switching of individuals and interactions plays a significant role in diverse dynamical processes, such as face-to-face communication25, evolutionary dynamics12,48, and network control49. We have proposed an analytical framework and corresponding spanning-tree method to construct temporal networks with specific activity patterns, including bursty and Poisson-like activity patterns. Unlike prior constructions of temporal networks in the literature5,35,36, our algorithm is able to reproduce the simultaneous burstiness of both nodes and edges observed in empirical datasets, from diverse social contexts (Supplementary Fig. 13).

The central ingredient in our construction algorithm—the spanning tree—has been widely recognized as a significant feature in both theoretical50,51,52 and real-world applications of network science53. For example, in path-finding algorithms such as Dijkstra’s algorithm54 and the A* search algorithm55, the shortest paths from a given source node to all other nodes, together with the source node, form a shortest-path tree. These algorithms are widely used in mobile robot covering problems56, for tracking the establishment of oil pipelines57, and for vehicle routing58. The tree structure is the backbone of these networked systems. Other examples include telecommunication networks, including the Internet, where the Spanning Tree Protocol59 and Augmented tree-based routing60 are used to avoid routing loops, to solve the scalability problem, and gain resilience against node failure and link instability. In social networks, spanning tree-based algorithms have been proven effective in detecting communities, one of the most widely studied issues in network science61. Thus our spanning tree-based method for generating specific activity patterns might have implications in several areas of application, which remain to be investigated.

Our analysis of activity patterns on different underlying topologies shows that the algorithmic IET distribution of nodes or edges does not significantly depend on the underlying topology, for a given spanning tree. This result indicates that the macroscopic activity pattern of a general network can be largely determined by the dynamics of its key components, such as its spanning tree. Branches from the spanning tree will cause only small perturbations to the activity pattern, regardless of their number and location, akin to the effects of ’weak links’ in food webs40. As a result, we can construct a temporal network with a desired consistent activity pattern, even if the underlying topology is not precisely known, or even changing in time.

Another straightforward way to measure the burstiness and memory of temporal networks is to calculate the burstiness parameter26 and the auto-correlation function (see Supplementary Information section 8). A larger burstiness parameter means a higher level of burstiness, and a lower absolute value of the auto-correlation function means a weaker dependence on memory. Our results show that our synthetic bursty activity patterns have strong auto-correlation and a positive and high burstiness parameter, while the Poisson-like activity patterns are memoryless and have a negative burstiness parameter (Supplementary Tables 1 and 2, Supplementary Fig. 14).

The past ten years have shown increasing interest in understanding the effects of group interactions and higher-order interactions62,63,64,65,66, meaning behavioral activities that are not limited to just pairs of individuals. A recent study has shown that higher-order interactions in empirical datasets display similar bursty behaviors to pairwise interactions67. And so a natural extension of this work is to study the activity of higher-order interactions in temporal networks. Our approach may provide a method to decompose networks into several elementary components, analogs of spanning trees in the context of hyper-graphs, which remains a direction for future research on the temporal dynamics in groups of interacting agents.

Methods

Mathematical formalization

Here we provide a mathematical model of the two-node temporal network construction, which is a stochastic process \({\{{S}_{m}\}}_{m\ge 0}\) coupling the activity of every unit. Complete mathematical details about the existence of \({\{{S}_{m}\}}_{m\ge 0}\) and the modeling of other systems are provided in the Supplementary Information.

We follow the notation in the Two-node systems section. According to the constraint Zn = XnYn, we construct a stochastic process \({\{{S}_{m}\}}_{m\ge 0}\), which for arbitrary sets of \({t}_{1},...,{t}_{k}\in {\mathbb{N}},k\in {{\mathbb{Z}}}^{+}\) satisfies

$$\begin{array}{rlr}&{\mu }_{{S}_{2{t}_{1}},...,{S}_{2{t}_{k}}}={\mu }_{{X}_{{t}_{1}},...,{X}_{{t}_{k}}},&\\ &{\mu }_{{S}_{2{t}_{1}+1},...,{S}_{2{t}_{k}+1}}={\mu }_{{Y}_{{t}_{1}},...,{Y}_{{t}_{k}}},\\ &{\mu }_{({S}_{2{t}_{1}}\cdot {S}_{2{t}_{1}+1}),...,({S}_{2{t}_{k}}\cdot {S}_{2{t}_{k}+1})}={\mu }_{{Z}_{{t}_{1}},...,{Z}_{{t}_{k}}},\end{array}$$
(9)

and S0 = S1 = 1. Here \({\mu }_{{X}_{{t}_{1}},...,{X}_{{t}_{k}}}\) represents the finite dimensional distribution of \({\{{S}_{m}\}}_{m\ge 0}\) at the time slice (t1,...,tk). \({\{{S}_{m}\}}_{m\ge 0}\) can be viewed as composing of the following sequence

$$({S}_{0},\, {S}_{1},...,{S}_{2n},\, {S}_{2n+1},...)=({X}_{0},{Y}_{0},...,{X}_{n},{Y}_{n},...),$$
(10)

and Zn = S2nS2n+1. \({\{{S}_{m}\}}_{m\ge 0}\) follows the activation order in the main text (i.e., the state of x is determined first). If we exchange the order, the corresponding indexes in Eq. (9) and the sequence of Xn and Yn in Eq. (10) are also swapped.

System consistency

The consistency of the two-node system is equivalent to the existence of \({\{{S}_{m}\}}_{m\ge 0}\). If \({\{{S}_{m}\}}_{m\ge 0}\) is well-defined, the algorithmically produced IET distributions of x, y, z will satisfy the target distributions F, G, H.

We derive the equivalence of the consistency condition for bursty and Poisson-like activity patterns in a two-node system. Let \({p}_{x}^{(n)}={p}_{x}({{{{{{{{\bf{0}}}}}}}}}^{(n-1)},1)\) denote the conditional probability that x is active for the first time at n, where

$${{{{{{{{\bf{0}}}}}}}}}^{(m-1)}={\left(1,\underbrace{0,...,0}_{m-1}\right)}^{{{{{{{{\rm{T}}}}}}}}}$$
(11)

is a trajectory with length m and only one active state occurring at the initial time. For a power-law distribution with exponent α,

$${p}_{x}^{(n)} \, \approx \, 1-{\left(\frac{n+\frac{1}{2}}{n-\frac{1}{2}}\right)}^{-\alpha+1},$$
(12)

and for a discrete exponential distribution with exponent α,

$${p}_{x}^{(n)}=1-{e}^{-\alpha }.$$
(13)

From the definition of the distribution consistency, the equivalence is given as

$${\alpha }_{node}\ge {\alpha }_{link},\,{p}_{x}^{(1)}+{p}_{y}^{(2)} < 1,\,{p}_{x}^{(1)}+{p}_{y}^{(1)} \, < \, 1+{p}_{z}^{(1)}$$
(14)

for bursty activity patterns and

$$0\le {\alpha }_{node}-{\alpha }_{link}\le \ln 2$$
(15)

for Poisson-like activity patterns. Note that these consistency conditions ensure that the algorithm works for any length ttol.

Construction of empirical temporal networks

We generate an unweighted underlying topology \({{{{{{{\mathcal{S}}}}}}}}\) and a temporal network \({{{{{{{\mathcal{T}}}}}}}}\) for each empirical dataset. We first determine the length of \({{{{{{{\mathcal{T}}}}}}}}\) by counting the number of timestamps in the dataset. Then, the snapshot at time t is formed by all contact events with the corresponding timestamps. Finally, we obtain \({{{{{{{\mathcal{S}}}}}}}}\) by aggregating all snapshots, that is, link (i, j) exists on \({{{{{{{\mathcal{S}}}}}}}}\) if individuals i and j interact at least once.