{'fraction_non_alphanumeric': 0.03181714136228377, 'fraction_numerical': 0.009548412412936138, 'mean_word_length': 4.838487972508591, 'pattern_counts': {'":': 0, '<': 1, '<?xml version=': 0, '>': 2, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Impact of temporal network structures on the speed of consensus formation in opinion dynamics

Opinion dynamics on networks has wide applications to empirical and engineered systems and profound prospects in the general study of complex systems. Many efforts have been devoted to understanding how opinion dynamics is affected by network topology. However, human social interactions are best characterized as temporal networks in which ordering of interactions cannot be ignored. Temporal activity patterns including heterogeneous contact strength and interevent times, turnover edge/node dynamics and daily patterns could have significant effects that would not be captured by static aggregate network representations. In this paper, we study the effects of such temporal patterns on the speed of consensus formation in various models of continuous opinion dynamics using three empirical human face-to-face networks from different real-world settings. We find that static, aggregated networks consistently overestimate the speed of simulated consensus formation while weight heterogeneity associated with frequency of interactions has an inhibitory effect on consensus formation relative to the behavior on unweighted networks. Moreover, the speed of consensus formation is found to be highly sensitive to nodal lifetimes, suggesting that randomization protocols that dramatically alter the distribution of lifetimes cannot be relied upon as reference models. On the other hand, temporal patterns including burstiness of interevent times and the lifetime of edges are found to have insignificant effects on consensus formation.


Introduction
Social interactions may have significant influence on decision-making and opinion formation on networks [1] with implication to political affiliation [2,3] and rumor spreading [4]. In social networks, individuals adjust their opinions based on mutual interactions and group discussions. Consensus may result in which all individual hold the same opinion. Alternatively, polarization and fragmentation in which multiple opinion clusters form, could occur as well. The effects of network structure and, particularly, temporal sequencing of interactions on such opinion dynamics are the concern of this paper.
Opinion dynamics on static network topologies have been explored in terms of iterated maps applied to discrete [2,5,6] or continuous representations of opinions [7]. The maps defined by Deffuant et al [8] and Hegselmann and Krause [9] account for topology by, in the first case, randomly selecting an edge with probability proportional to its network weight and updating the corresponding pair of nodes or, in the second case, updating all nodes simultaneously using weighted averages of neighboring opinions [6]. The Deffuant model has attracted a large amount of attention of researchers from communities of sociophysics and network science. It was first applied to complete graphs such as square lattices [8] and subsequently to generative networks by Barabási-Albert, Erdős-Rényi, and Watts-Strogatz mechanisms [10,11,12,13]. It was also modified to adaptive networks where the breaking and rewiring processes of links are introduced [11,3]. Recently, the Deffuant model was applied to empirical data sets [14]. Various generalizations include smoothing of so-called confidence bounds to avoid discontinuous jumps in opinion differences [15], as well as heterogeneous and time-dependent confidence bounds [16,17].
Unti recently, few studies have considered the opinion dynamics on temporal networks in which the ordering of interaction is properly accounted for [18,19]. Temporal networks are a natural framework for describing human face-to-face interactions because the spatial proximity between two individuals is timevarying. It has been demonstrated that temporal patterns like contact orders [20], burstiness [21], and lifetimes [22,23] could have significant effects on dynamics on networks, and may yield totally different results from static network representations. We are aware of only limited work on voter models (with binary opinions) on temporal networks [24,25,19]. Even less attention has been put on dynamic models of continuous opinions on temporal networks, with the sole exception of a recent paper that explored continuous opinion dynamics on synthetic activity-driven networks [26]. Motivated by this, we use three publicly-available empirical data sets representing various examples of human proximity interactions to investigate how temporal patterns affect consensus formation speeds in continuous opinion dynamics.
The rest of this paper is organized as follows. In section 2, we review the Deffuant and Hegselmann/Krause models and generalize these to temporal networks. We choose to characterize the speed of consensus formation in terms of the dynamics of the expectation of the mean square opinion difference across the network. In section 3, we give basic information of three empirical networks and highlight their temporal structures. In section 4.1, we compare the consensus speed on aggregated unweighted and weighted networks to probe the effects of edge weights. Comparison of the speed of consensus formation on temporal networks and the corresponding aggregated weighted networks is presented to highlight the potential issues of static models. In section 4.2, we carefully examine the effects of temporal patterns on the speed of consensus formation using several different reference models. A brief summary and discussion is considered in the concluding section 5.

Models of opinion dynamics
We begin by defining a collection of iterated maps whose finite-duration dynamics model changes in the distribution of opinions across a network described in terms of a static or time-dependent topology.

Static networks
Consider first a static, weighted, connected graph on a network with N nodes, E edges, and Laplacian L. Let L (ij) denote the Laplacian associated with the unweighted graph obtained by removing all edges but that connecting nodes i and j, such that L (ij) = 0 if no such edge exists in the original graph. It follows that L (ij) is obtained by setting the weight of the edge connecting nodes i and j to 1 and the weights of all other edges to 0. Let x = [x 1 , . . . , x N ] ⊤ ∈ R N denote the vector of opinions across the network. We assume that updates to x are governed by a linear, possibly non-autonomous, discrete map of the form If n denotes the discrete duration of the corresponding dynamics, then where T n0 = T n−1 ...T 0 is the corresponding opinion transition matrix and x(0) is the initial opinion across the network. Different update schemes yield different forms of the opinion transition matrix. In the original Deffuant model [8], opinions are updated sequentially in pairs by selecting a network edge (ij) randomly at each iteration. Here, if the distance |x i (k) − x j (k)| between the corresponding two nodal opinions exceeds a predefined confidence bound ǫ, then x(k + 1) = x(k). In contrast, when |x i (k) − x j (k)| ≤ ǫ, where the convergence parameter µ represents the tendency of nodes to align their opinions with those of their neighbors. In this paper, we assume that µ ∈ (0, 1). In this case, shows that the opinion difference of the two nodes is reduced as a result of the interaction. If we ignore the confidence bound ǫ, then it follows from Eq. (3) that Since the selected edge sequence is a random sequence with replacement, the corresponding sequence of Laplacian matrices is also a random sequence with replacement. If we assume that the initial opinion is selected from some probability distribution that is independent of the distribution of Laplacian matrices, then the expected value where E L (i k j k ) = L, for k = 0, . . . , n − 1, due to replacement. The expectation of the opinion transition matrix then equals If the probability of an edge being selected is proportional to its weight, then where w (ij) denotes the weight of the edge connecting nodes i and j. In the special case that the network is unweighted (i.e., if w (ij) equals either 1 or 0), then L = L/E. In either case, it follows from the appendix that T n0 is a row-stochastic matrix.
In the Hegselmann-Krause model [9,27], the opinions of all nodes in a static network are updated simultaneously according to the deterministic dynamics and x i (k + 1) = x i (k) otherwise. Here, the a ij 's are the entries of the network adjacency matrix. While the Deffuant model captures pairwise interactions within large populations, the Hegselmann-Krause model describes situations where opinion dynamics are a result of group conversations, for example, in formal meetings [27].
In the remainder of this section, we propose four generalizations of these models to finite-duration dynamics on time-dependent networks. In later sections, we proceed to analyze the effects of temporal patterns on the opinion dynamics obtained by applying these generalizations to publicly-available network data sets. Since we focus on the speed of consensus formation, we simplify our analysis by ignoring the confidence bound ǫ.

Time-dependent networks
Consider a sequence G = {G l } of m unweighted graphs on a network with N nodes, and let {L l } denote the corresponding sequence of Laplacians. Let e l denote the number of edges in G l and let M = l e l . Let G u denote a time-aggregated, unweighted, static topology on the same network with Laplacian L u , such that every edge in G u occurs at least once in the sequence G, and every edge in G l , for l = 1, . . . , m, occurs in G u . Although individual graphs in the sequence G may be disconnected, we assume that G u is connected.
Let G w denote a time-aggregated, weighted, static topology on the same network with Laplacian L w , whose edges are identical to those in G u , but with nontrivial weights corresponding to the number of occurrences of each edge in the sequence G. It follows that G w is also connected.
As a baseline approach, we first consider the application of the stochastic Deffuant model (3) to the static networks G u and G w with likelihood of selection of an individual edge proportional to its weight. The results from the previous section then apply with L equal to L u and L w , respectively. In either case, the expected transition matrices are row-stochastic matrices. For comparison with the stochastic update model described next, we let n = M .
Alternatively, we retain the ordering inherent in the original sequence G by first applying stochastic Deffuant updates to the graph G 1 as many times as the number of edges in G 1 , then applying stochastic Deffuant updates to the graph G 2 as many times as the number of edges in G 2 , and so on, until the sequence is exhausted. It follows that From the appendix we conclude that the matrix T M0 is again a row-stochastic matrix. Finally (cf. [26]), we consider the application of deterministic synchronous updates to all nodes in G 1 , followed by the application of deterministic synchronous updates to all nodes in G 2 , and so on, until the sequence is exhausted. In this case, we let N l,i denote the set of neighbors of the ith node in the lth graph and define if |N l,i | = 0, and x i (l + 1) = x i (l) otherwise, for i = 1, . . . , N . In this case, where w l is a diagonal matrix with ith diagonal element 1/|N l,i | if |N l,i | = 0 and 0 otherwise. It again follows from the analysis in the appendix that T m0 is a row-stochastic matrix. We note that when µ = 1, each synchronous update (11) coincides with the Hegselmann-Krause model without confidence bound. In [26], the generalization in (11) is applied to activity-driven networks, in which each consecutive graph is generated synthetically from a reference collection of unconnected nodes by "activating" individual nodes with some probability according to a given distribution and connecting each active node to a finite number of other randomly chosen nodes. In contrast, in our study, we focus on applying the update model in (11) to empirical network data in order to characterize the corresponding temporal structure. Specifically, in Section 4.2, we apply each of the generalized update models to the sequence of graphs {G l } m l=1 obtained from individual time stamps associated with start times of interactions in three empirical data sets and their randomized reference networks.

Consensus formation
In the special case that all components of the initial opinion vector x(0) are governed by identical independent probability distributions with mean m, it follows from row-stochasticity that where T ij denotes the (i, j)th component of any of the opinion transition matrices or, in the case of stochastic updates, their expectations. The expected opinion thus remains equal to the expectation of the initial opinion consistent with the possibility of consensus formation.
The dynamics of consensus formation across the network may be quantified in terms of the mean square opinion distance between two different nodes [28] with corresponding expectation In the special case of the deterministic update model in (11), where m represents the second moment of the distribution of initial opinions. No such explicit expressions are available to evaluate E(d(k)) for the stochastic update models. This must instead be obtained by appropriate numerical sampling and simulation.

Basic information and statistics
We apply our analysis to three publicly-available, empirical, time-dependent network data sets, here labeled "Conference" [29], "High school" [30], and "Hospital" [31]. These datasets have different spatial and temporal characteristics. For example, the "Conference" data set corresponds to a homogeneous topology, while the "High-school" data set exhibits community structure. Temporal patterns in the "High-school" and "Conference" data sets follow relatively strict and repetitive schedules, while activities in the "Hospital" network data set are less regular.
All three data sets were collected from face-to-face proximity contacts of individuals with wearable sensors. Data is recorded as contact sequences, with each entry identifying two interacting nodes and their contact timestamp. The sampling resolution in each data set is 20 seconds. From a sequence of contacts, we infer a sequence of interactions. Specifically, any pair of contacts on an edge with inter-contact times equal to the sampling resolution are condensed into a single interaction. In our analysis, each data set is associated with a sequence of graphs obtained from the start times of such interactions.
In the "Conference" network, we observed that one node has only one neighbor, while all remaining nodes have more than 10 neighbors. Coordination dynamics and diffusive dynamics are highly sensitive to the presence of outliers with significantly smaller degree than the rest of the nodes [32,28]. For this reason, the outlier node and related links in the "Conference" network were deleted in refs. [32,28]. Due to the close relations between consensus dynamics and coordination [33,34], this outlier node and the corresponding network edge were therefore excluded from our analysis as well. Table 1 lists basic information about the three data sets before and after elimination of the outlier node in the "Conference" data set and condensation of contacts into interactions. (113) 2195 (2196) 9864 (20818)

Temporal patterns on nodes and edges
In time-aggregated representations of temporal networks, the weight of an edge is given by the total number of interactions between the pair of connected nodes. The distribution of edge weights for the three empirical networks is presented in Fig. 1(A). We observe scale-free distributions implying heterogeneous strengths of ties between nodes in each network.
We explore the temporal characteristics of each network by defining node/edge interevent times (IETs) as the time gaps between start times of consecutive interactions associated with individual nodes or edges. Figures 1(B) and 1(C) show the corresponding distributions across all nodes for each of the three data sets. As with the edge weights, we find that both node and edge IETs have broad, fat-tailed distributions, indicating bursty temporal structures [19].
A further temporal characterization is afforded by the distributions of edge lifespans for the three empirical networks shown in Fig. 1(D). Here, the lifespan of an edge is the duration between the start times of the first and last interactions occurring on that edge. As seen in the figure, all three networks display heterogeneous distributions of edge lifespans. Such heterogeneity has also been observed in human telecommunication networks [35] and insect proximity networks [36], and suggests that the so-called turnover picture gives a better description of the edge dynamics than the ongoing picture [22].
A more nuanced description applies to the node lifespans, defined by the duration between the start times of the first (activation) and last (deactivation) interactions associated with each node. In the turnover picture, we expect nodes to enter and leave the networks dynamically. In contrast, in the ongoing picture, most nodes are present and active throughout the sampling time. Following [23], we define the normalized activation time, deactivation time, and lifespan of a node as follows where t a and t d are the activation and deactivation times (relative to the start of sampling) and ∆T is the sampling time. As can be seen in Fig. 2, the "High school" network is best characterized by the ongoing picture. In contrast, "Hospital" exhibits significant turnover dynamics with a majority of nodes entering and leaving the network at times interior to the sampling window. The "Conference" network falls somewhere between these two extremes, with about half of all nodes not continuously present.

Numerical results
We proceed to analyze the dynamics of consensus formation using the expectation E(d(k)) on each of the three empirical datasets using the four distinct update models introduced in Section 2. Throughout, we assume that the components of the initial opinion vector are governed by a uniform distribution on [0, 1] with mean m = 1/2 and second moment m = 1/3.

Initial characterization
Following the methodology in Section 2.2, we first apply the stochastic Deffuant model (3) to the aggregated topologies G u and G w to explore the influence of edge weights. The corresponding results in Fig. 3 were obtained by averaging d(k) at each of M steps over 100 different simulations with µ = 0.8. The figure shows that E(d(k)) decreases with k in both static representations, indicative of a trend toward consensus. The average mean square opinion distance on the unweighted network is much smaller than on the weighted network, suggesting that weight heterogeneity inhibits consensus formation. This inhibitory effect can be explained by the weakness of strong ties [37,38], as nodes connected by strong ties are less likely to also make contact with other nodes. More careful observation suggests the E(d(k)) on the unweighted network decays exponentially with k. In comparison, as shown by the solid curves in Fig. 3, consensus formation appears to be significantly slower for opinion dynamics modeled by the sequential application of stochastic Deffuant updates to each of the graphs G l as described in Section 2.2. We attribute this observation to the preservation of temporal structures such as burstiness of interevent times and lifetimes of edges and nodes, all of which are destroyed in the aggregated networks G u and G w . We will carefully examine how temporal structures affect the speed of consensus formation in the next subsection.

Impact of temporal patterns
In order to study the effects of temporal patterns on the speed of consensus formation, we make comparisons with network realizations of randomized reference models that destroy the temporal patterns but preserve aggregated topology. As summarized in Table 2, each successive reference model listed below destroys additional temporal structure.  • Permuted-time model with preserved node lifetime (PTN) [39,23]: Start times of interactions are randomly permuted if the activation and deactivation times of each node are preserved after permutation. Permutations that change node lifetimes are rejected. Note that node lifetimes are automatically preserved in PTE while PTN changes edge lifetimes. Burstiness of edge IETs and of node IETs is destroyed by PTN.
• Permuted-time model (PT) [40,21]: Start times of interactions are randomly permuted without constraint. Neither node nor edge lifetimes are preserved. Burstiness of edge IETs and of node IETs are destroyed by PT.
• Randomized-time model (RT) [40,21]: Start times of interactions are replaced by random numbers generated from a uniform distribution over the same sampling window as the corresponding empirical network. Neither node nor edge lifetimes are preserved. Burstiness of edge IETs and of node IETs are destroyed by RT. RT further destroys daily patterns. We can compare simulation results on empirical networks and their PTE networks to study the effects of bursty edge IETs. Further, comparison of results on PTE and PTN can be used to probe the effects of bursty node IETs and edge lifetimes. In addition, comparison of results on PTN and PT highlight the effects of node lifetimes. Finally, we can compare results on PT and RT to reveal the effects of daily patterns and weekly patterns. We note that although PT has been widely used to study the effects of burstiness in temporal networks, it assumes that edges and nodes are described by the ongoing picture, which does not always hold in empirical networks. The potential bias of PT has been systematically explored in ref. [23]. In this study, we generate 10 realizations per empirical network and reference model.
For the deterministic update model (11), E(d(k)) is given by (15) and (16). Figure 5 shows variations in E(d(k)) with increasing k in the case that µ = 0.8. We observe that the three empirical networks and their PTE and PTN reference models yield close results, suggesting that burstiness of IETs and edge lifetimes have no significant effects on the speed of consensus formation. In contrast, changes to node lifetimes in PT result in significantly smaller expected values of the mean square distance, likely associated with an extension of node lifetimes to the sampling window by this reference model. RT yields slower decay compared with PT. When RT is applied, m typically increases significantly and approaches M . Since the total number of interactions is preserved after randomization, the number of edges in each graph will be reduced, typically to 1. This reduction of interaction strength results in the slower decay of RT. Indeed, even if the timestamps of interactions are randomly selected only from daytime, E(d(k)) decays more slowly for RT than for PT. Thus, we cannot probe the effects of daily patterns by comparing simulation results using the synchronous update model on PT and RT. The dependence of E(d(m)) on µ is shown in Fig. 6. As with the data in Fig. 5, we see an insignificant influence of burstiness and edge lifetimes, given the close agreement between the empirical values and the predictions from the PTE and PTN reference models. Indeed, within the small variations in the figure, we find that the extent of consensus predicted by PTE is slightly larger than for the empirical network in the case of the "Conference" data set and larger values of µ, and slightly smaller than for the empirical network in the case of the "High school" data set for intermediate values of µ. Thus, like epidemic spreading and diffusion dynamics, burstiness can induce both speed-up and slow-down effects [41,42,20].
As can be seen in Fig. 6, the predicted E(d(m)) is reduced significantly for PT compared with PTN. We attribute this enhancement of consensus formation to an extension of nodal lifetimes to the sampling window of the data set. Indeed, the reduction is particularly pronounced in the case of the "Conference" and "Hospital" data sets for which nodes enter and leave the network dynamically, and more limited in the case of the "High school" data set which is well described by the ongoing-node picture. Indeed, the significant reduction that nevertheless occurs for the "High school" data set highlights the sensitivity of consensus formation speeds with respect to node lifetimes, as only a small fraction of nodal lifetimes are changed by PT in this data set. This sensitivity can be explained by the concurrency nature of consensus formation. In particular, nodes that do not enter a network at the beginning of the sampling window will cause fluctuation and oscillation of convergence toward consensus, while nodes that leave early have low chances to achieve consensus. It is instructive to investigate the expected terminal mean square distance on RT, given by E(d(m)) with the updated value of m that results from each application of RT. As seen in Fig. 6, the predictions are very close to those for PT. Both PT and RT extend the lifetimes of nodes to the sampling window. The coincidence between PT and RT again suggests that the rate of consensus formation is mainly determined by the lifetime of nodes rather than the nature of edge and node IETs.
For the dynamics given by applying stochastic Deffuant updates to the graph sequence {G l }, E(d(k)) must be obtained by numerical sampling and simulation. Figure 7 shows variations in E(d(k)) with increasing k in the case that µ = 0.8, obtained by averaging over 100 realizations of the initial opinion vector and edge selection sequences. As in the case of the deterministic update model in the previous subsection, the results for the empirical networks match closely with the preditions of the PTE and PTN reference models while PT results in a significant reduction of the expected mean square distance. This is consistent with the observation that the speed of consensus formation is mainly determined by nodal lifetimes. In contrast to the earlier result, RT yields faster decay compared with PT. We attribute this to the likelihood, in the case of PT, that some interactions in a graph will not be selected by the algorithm, while this possibility is essentially eliminated in RT because most graphs have a single interaction. Such missing interactions can slow down consensus formation.
The dependence of E(d(M )) on µ is shown in Fig. 8. As with the data in Fig. 6, the differences between empirical networks and reference models are generally amplified as µ is increased. We again observe insignificant effects of IETs and apparent sensitivity to nodal lifetimes.

Further discussions and conclusions
This paper has explored the effects of temporal patterns in face-to-face interaction networks on the speed of consensus formation using suitably constructed models of opinion dynamics. Key observations include a slowing down of consensus formation associated with edge weight heterogeneity in models applied to static aggregated topologies, and sensitivity to nodal lifetimes in models applied to graph sequences the preserve temporal ordering. In particular, the extension of nodal lifetimes associated with commonly used randomized reference models can significantly overestimate the speed of consensus formation. Notably, no significant effects were found of burstiness of IETs or edge lifetimes.
Our results provide an important counterpoint to observations in ref. [28] on changes to consensus formation associated with PT reference models. The authors conclude that the randomization of contact orders associated with PT can accelerate consensus formation. However, as observed in this paper, changes to contact order that preserve nodal lifetimes, as generated by the PTN reference model, are not associated with accelerated consensus formation. Instead, it appears that the acceleration observed by ref. [28] is a consequence of the extension of nodal lifetimes to the full sampling window that results from PT.
We note that Deffuant models are not restricted to opinion dynamics but can be applied to problems of coordination [28,33] and synchronization [34,43]. For example, in [28], the original Deffuant model with µ = (1 − exp(−2τ ))/2 ∈ (0, 0.5) was applied to a problem of continuous-time coordination. We believe that the generalizations developed in this paper, providing for enhanced rates of consensus formation by appropriate tuning of µ and/or accounting for the effects of group conversations in empirical data sets, can be of similarly significant value to consensus problems in multi-agent coordination, e.g., formation control of mobile robots. Future work should investigate the influence on consensus formation in temporal networks from group conversations.
The confidence bound ǫ was ignored in our study to simplify the analysis. However, as observed in ref. [14], variations in the time for convergence to steady-state are small for ǫ > 0.5, since this typically consists of only one opinion group. We therefore expect that the conclusions of this paper apply also to models that include confidence bounds with ǫ > 0.5. For ǫ < 0.5, we expect a fragmentation of the opinion dynamics with a steady-state consisting of several distinct opinion groups with consensus within each group [8,14]. We leave a study of the influence of temporal structure on such fragmentation to future work.
Finally, we note a number of opportunities to generalize the analysis in this paper, for example, by considering heterogeneity of initial opinions and convergence parameters. There is also value in investigating the dependence of the consensus dynamics on outlier nodes [32] with the aim to identify mechanisms for detecting nodes that delay overall convergence.

Acknowledgements
This material is based upon work supported by the National Science Foundation under Grant No. BCS-1246920.

Appendix A. Row-stochastic matrices
Let {w (k) } n k=1 ∈ R N ×N be a sequence of diagonal matrices and {L (k) } n k=1 ∈ R N ×N be a sequence of Laplacian matrices, such that is a row-stochastic matrix, i.e., N j=1 T ij = 1, ∀i ∈ {1, ..., N } and the elements of T lie in the interval [0, 1]. Using the result of this lemma, it is straightforward to conclude that the expectations for the transition matrices associated with each of the four models of opinion dynamics on time-dependent networks derived in section 2.2 are also row-stochastic matrices.