{'fraction_non_alphanumeric': 0.03002539697609836, 'fraction_numerical': 0.01013505494766324, 'mean_word_length': 4.877790178571429, 'pattern_counts': {'":': 0, '<': 1, '<?xml version=': 0, '>': 1, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Dynamic Graph Metrics: Tutorial, Toolbox, and Tale

The central nervous system is composed of many individual units -- from cells to areas -- that are connected with one another in a complex pattern of functional interactions that supports perception, action, and cognition. One natural and parsimonious representation of such a system is a graph in which nodes (units) are connected by edges (interactions). While applicable across spatiotemporal scales, species, and cohorts, the traditional graph approach is unable to address the complexity of time-varying connectivity patterns that may be critically important for an understanding of emotional and cognitive state, task-switching, adaptation and development, or aging and disease progression. Here we survey a set of tools from applied mathematics that offer measures to characterize dynamic graphs. Along with this survey, we offer suggestions for visualization and a publicly-available MATLAB toolbox to facilitate the application of these metrics to existing or yet-to-be acquired neuroimaging data. We illustrate the toolbox by applying it to a previously published data set of time-varying functional graphs, but note that the tools can also be applied to time-varying structural graphs or to other sorts of relational data entirely. Our aim is to provide the neuroimaging community with a useful set of tools, and an intuition regarding how to use them, for addressing emerging questions that hinge on accurate and creative analyses of dynamic graphs.


Introduction
The mammalian brain is a complex system, composed of many individual units (cells, neural ensembles, voxels, or areas) that are intricately connected with one another [1]. Understanding this system requires complementary studies from both reductionistic and holistic perspectives [2]. Reductionistic approaches are critically necessary to understand the structure and function of individual units, while holistic approaches are critically necessary to understand how those individual units function in the context of others. Historically, constructing and testing hypotheses regarding systems or subsystems of interconnected units has proven challenging, in large part due to a dearth of appropriate theories and associated computational tools [3]. Recent developments in network science [4] provide a wealth of potentially useful solutions to this problem by representing complex systems as graphs in which nodes (units) are connected by edges (interactions). This network representation forms a natural mathematical framework in which to couch holistic inquiries into the nature of the brain [5,6] and can be flexibly applied to neural data collected across spatial and temporal scales [7], across species [8], and across cohorts [9,10].
One canonical form of interest to neuroscientists is the functional graph in which cells, neural ensembles, voxels, or areas are connected to one another by estimates of their functional (rather than structural) interactions. At the neuronal scale, a functional edge might be an estimate of similarity in firing patterns [11], while at the large scale, it might be an estimate of similarity in BOLD time series [12] or ECOG signals [13,14,15]. Irrespective of spatial scale, when considering how to build a functional network representation from neural data, one is faced with the natural question of whether a single representation will suffice, or whether an ensemble of representations is required. Early but very important work in this field focused on constructing a single representation [16,17,18,19], in which an edge summarized functional interactions between two neural units over a fixed time period. However, this approach is incompatible with the emerging interests in understanding the network dynamics -and not just its structurethat support cognition [20]. Indeed, querying (i) fluctuations in an animal's emotional or cognitive state [21,22,23], (ii) the manner in which an animal transitions between tasks [24,25], or (iii) the variations in functional network architecture that are characteristic of perception and processing [26], learning [27,28], development [29,30], aging [18,31], or disease progression [32] all require an assessment of a network's dynamics.
The last several years have seen a proliferation of approaches to quantitatively describe time-varying patterns of functional connectivity [33,34,7]. One set of powerful tools comes from engineering approaches including independent components analysis, machine learning, and causal inference, while another set comes more from the field of pure and applied mathematics and specifically graph theory. In some ways the distinction between these two types of approaches is reminiscent of the distinction between model-free versus model-based learning [35]: graph theory-based approaches assume a formal graph model of the data, while other approaches seek to learn a model directly from the data. Though each approach has its benefits, we focus our exposition here on the graph-based approach due to the recent explosion of tools developed by the applied mathematics community to study dynamics graphs -also called temporal networks [36]. These advances form a potentially powerful toolset for the contemporary neuroscientist, paving the way to more sophisticated approaches to data analysis and to hypothesis development.
Here we offer a didactic piece that describes dynamic graphs, discusses how to visualize them, surveys dynamic graph measures, and demonstrates their application to a previously published neuroimaging data set. We devote slightly less real estate to tools that have already been applied to neuroimaging data, and slightly more real estate to tools that have not yet been applied in this area. Along with this exposition, we offer a publically-available MATLAB toolbox [37] so that the reader can immediately apply these measures to their own data to address their own hypotheses. The piece can be thought of as a mathematical reference and does not attempt to provide new neurophysiological insights (we leave the latter to future forays by interested readers). Finally, we note that although we illustrate these tools in the context of time-varying functional brain graphs, the toolset is flexible and can be applied to questions regarding time-varying structural or morphometric graphs as well.
The remainder of this paper is structured as follows. First, we describe different ways of visualizing dynamic graphs and discuss the advantages and disadvantages of each. Next, we discuss how to encode a dynamic graph and then describe several basic dynamic graph notions and measures including time-respecting paths, latency, and centrality. We then move on to a discussion of null models and additional measures including temporal small-worldness and dynamic modular structure. Finally, we outline a few natural scenarios in which dynamic graphs could be constructed to address hypotheses regarding brain structure and function as well as the neurophysiological mechanisms of behavior and disease.

Visualizing dynamic graphs
Given data as a dynamic graph, a first inclination is to find a way to visualize the information. For simplicity we will assume this graph is undirected and binary, and that edges can exist at any of some finite number of timepoints. We may naturally imagine viewing the dynamic network as a movie where edges and nodes come in and out of view. Since a movie is not always feasible (for example in research papers), we might look to study the frames, or snapshots of the dynamic network at each timepoint, as seen in Fig. 1a. While this approach certainly captures information from the time dimension, it becomes less helpful as the number of timepoints increases. Particularly for sparse networks, it may be more useful to visualize a collapsed, static graph (Fig. 1b), specifically the time-aggregated graph, where edges exist between two nodes if they are connected at any point in the dynamic network [36]. Note this time-aggregated graph is created from a dynamic network describing the data, instead of a more traditional approach of creating a single graph from multiple time points which averages out the dynamics. Here edge weights could be assigned by the time of edge appearance or frequency of edges within the dynamic network. We then gain a more succinct and holistic view of the dynamic network, yet lose comprehension of temporal structure. As a third option, we could also explicitly visualize the time dimension by plotting the dynamic network as a sequence of edges or contacts over time, giving a circuit board-like view (Fig. 1c). This approach is optimal for small, sparse dynamic networks, though quickly becomes overwhelming as the number of nodes and contacts grows. More methods for visualization exist, but, for the optimal representation, one should consider the size and density of the given data.
One example of data suitable for a dynamic network encoding is functional magnetic resonance imaging (fMRI) data. Here we illustrate dynamic graph approaches using fMRI scans collected as individu-als learned to play a sequence of finger movements [38]. The time-dependent levels of neural activity from N = 112 cortical and subcortical brain regions were estimated from indirect measurements of bloodoxygen-level dependent (BOLD) signal collected over ten time windows in each of four training sessions. Functional connectivity between brain regions was estimated with a magnitude squared coherence of wavelet coefficients [39], resulting in an N × N coherence matrix for each time window in each training session. While prior studies have examined these coherences matrices as fully weighted graphs, for the didactic purposes of this tutorial we simplify the data by binarizing the dynamic network, keeping only the top 10% of entries in each coherence matrix. Prior analyses of this data provided insight into how individuals learned on short (within one session) and long (across sessions) timescales [38,40,41,42]. For this type of data, a fourth type of visualization is available, namely visualizations that place nodes in their true anatomical locations and draw lines between connected nodes. In Fig. 1d we show this exact type of visualization for a dynamic network from one individual from the first session as a sequence of brain graphs. We choose to color nodes according to prior observations on these same data: the presence of two groups of densely connected brain regions, a group of motor regions, which we color in green, and a group of visual regions which we color blue [38]. All other regions, shown in red, were not found to have any particular allegiance to either module.

Basic measures
In this section, we discuss how to encode a dynamic graph and then describe several basic dynamic graph notions and measures including time-respecting paths, latency, and centrality.

Encoding data as a dynamic graph
Data to be analyzed as a dynamic graph may arrive in different formats, including a sequence of matrices or a list of edges and times. Thus, before we begin any calculations, we might wish to transform the information into a standard -and efficiently storedobject. For a static graph, this is simply G = (V, E), where the graph G is defined by a set of vertices V and edges E : V × V → R. For a dynamic graph, we could record G 0 , G 1 , . . . G T for each time-point t = 0, 1, . . . , T , but it is more memory-efficient to  [38]. Green regions correspond to a functional module composed of motor areas, blue regions correspond to a functional module composed of visual regions, and red regions correspond to areas that were not in either the motor or visual module. record instead the list of contacts and the time at which these occur. For a dynamic network, a contact is a triple (i, j, t) indicating the existence of an edge between nodes i and j (or from node i to node j in the directed case) at time t. Then the set of contacts in our dynamic network is called the contact sequence and this is how we will record and work with our dynamic network. Note this can be expanded to include more information, such as edge weight or time delay required to traverse the edge, by defining contacts to be tuples (i, j, t, w 1 , w 2 , . . . , w k ) for the additional measures w m .
With our dynamic network efficiently encoded, we can begin asking questions about its structure and evolution. At the level of individual nodes, many measures are intuitively generalizable as a function of time, for example the clustering coefficient [43]. Similarly, we can also track global measures -such as efficiency [44] -across time as well. However, not all measures can (or should) be simply extended in this way, because it ignores the evolution of the network from one timepoint to the next. Indeed, by ignoring the temporal dependencies between consecutive graphs, one is assuming that each observation is independent from the others; not only does this lead to inaccuracies in statistical testing and inference [45,46], but it also means that the investigator is unable to identify temporal motifs (analogous to topological motifs studied in static graphs [47,48]) -characteristic changes in or reconfiguration of the network that may happen with some unexpectedly high or low frequency [49,50]. Dynamic graph metrics address these limitations by explicitly accounting for the fact that the set of graphs is ordered in time. Due to their enhanced statistical rigor, we focus solely on dynamic graph metrics in this review. The edges highlighted in green and purple connect as two valid paths in this static network. Yet, we see in Fig. 2a (right) when looking at the sequence of contacts that the purple path is not a valid path in the dynamic network. Said another way, if information was sent from node 3, it could not reach node 8 via this sequence of contacts. Conversely, information from node 8 could reach node 6 by following the sequence of green contacts. Such a collection of contacts is called a time-respecting path. Precisely, a time-respecting path is a sequence of contacts (n 0 , n 1 , t 0 ), (n 1 , n 2 , t 1 ), . . . , (n k−1 , n k , t k−1 ) such that t i < t i+1 for all i = 0, ..., k − 2. Defined in this way, these time-respecting paths must agree with the "arrow of time," thereby making them particularly useful for the study of information flow in dynamic networks.

Time-respecting paths
The notion of a time-respecting path provides important intuitions regarding the similarities and differences between static and dynamic graphs. Returning to the model dynamic network in Fig 2a, note that we have a time-respecting path from node 3 to node 6 and from node 8 to node 6, yet no path exists from node 3 to node 8. Unlike in static graphs, time-respecting paths in dynamic networks are not required to be transitive. That is, if a path from node a to node b exists and a path from node b to node c exists, this does not imply the existence of a path from node a to node c. Thus, when studying systems from both static and dynamic perspectives, it is important to maintain accuracy in interpreting the potential utility of paths for information transmission.
The notion of time-respecting paths can also allow us to study the reachability of a node, which may be an important indicator of its function. For example, a brain region that can be reached from many other regions via time-respecting paths may have a significant role in information integration. Then, the set of nodes that can reach our node of interest also becomes a key feature. For example, in Fig. 2b, we ask which nodes connect to the peach node through timerespecting paths by t = 7. In other words, at t = 7, which nodes could be the source of the peach node's view of the system? This is called the source set of the peach node, and those within this set are circled in peach once they participate in a time-respecting path to the peach node. We have chosen a specific timepoint in this example, but one could record this at each point in time. Then for each node, the size and composition of the source set could inform that node's function. In our example empirical fMRI network, throughout one session we calculate the size and makeup of the source set for nodes in the visual and motor groups (Fig. 2c). We see that a larger fraction of the visual group (blue) than the motor group (green) is part of the source set for visual regions and conversely for the motor regions. This intuitively makes sense, as we might expect visual regions to be contacted by many visual regions and vice versa for the motor regions.
We could now invert the source set concept and look forward instead of backward in time for a node. Instead of who connects to a node, we can ask who this node can influence? If the gold node in Fig. 2d learns something new just before t = 8, we can look forward in time and find the other nodes with which the gold node can share this new information. We call this the set of influence: the collection of nodes reachable via time-respecting paths beginning no earlier than a given time t, which we illustrate as all nodes circled in gold at the final timepoint in Fig. 2d. Similar to the source set, we can calculate the number and Nodes within this set indicated with a gold ring at the time at which they can first be reached by the gold node. (e) Composition of the set of influence calculated from nodes within the visual (left) and motor (right) groups. As in (c), the fraction of all regions (gray), visual regions (blue), and motor regions (green) are plotted against time. Solid lines in (c) and (e) mark the average over subjects and trials, and shaded regions represent two standard deviations from this average. 5 makeup of this set as we vary t. In our example empirical fMRI data, we see that, as time increases, the visual regions influence many of the visual and motor regions, while the motor regions are more often connecting to strictly motor regions. With a deferential nod to notions from astrophysics, Holme and Samaraki describe these two sets, the source set and the set of influence for a node at a particular time, together as "light cones" which either could have affected the current state of the node or will be affected by the current state of the node [36].

Latency and centrality
The notions in the previous section provided us with information about the connectivity of nodes in a dynamic graph. Next we turn to questions related to the speed at which those nodes might communicate. In a static network, the number of edges within a path defines the path length, while in a dynamic network we can additionally record the duration of the path. We call the difference in time between the first and last contact the temporal path length [51]. For particularly efficient systems, one might expect information to travel along the shortest -or more precisely, the fastest -path within the dynamic network. Then, the distance between two nodes can be measured with temporal path length. We use the term latency (or temporal distance [51]) of nodes i and j to refer to the shortest time it takes to move from node i to node j.
Defining latency as the measure of shortest distance (note now in a temporal sense) allows us to extend notions of centrality to dynamic networks. Recall that in a static network, the betweenness centrality of a node can be defined as the fraction of shortest paths passing through that node, or with σ j,k being the number of shortest paths between nodes j and k and σ j,k (i) being the number of shortest paths passing through node i [52,53]. Using the definition of temporal path length, we can compute the same notion but for dynamic networks [54] by swapping the shortest path for the fastest path within a specified time window. In this way, we see the temporal betweenness centrality can be written as if we let σ j,k (t) be the number of fastest paths from node j to node k beginning no earlier than time t.
In Figure 3a, we illustrate these concepts for the toy dynamic graph shown in Figure 1a-c. Specifically, we show dynamic network features used in the calculation of betweenness centrality for a single node in the graph: highlighted nodes and edges participate in fastest paths involving the node of interest. An interesting alternative definition of temporal betweenness centrality swaps the fastest time-respecting paths for the shortest topological time-respecting paths: those with the fewest hops throughout the dynamic network [36]. While quantifying and understanding the shortest paths between nodes could be quite interesting, we might also wish to measure how far all other nodes are from a node of interest. In static graphs, we know this as closeness centrality, defined as where d(i, j) is the distance (path length) between node i and node j, and N the number of nodes in the network. When considering dynamic graphs, we could simply swap d(i, j) here for the latency between node i and node j, which takes into account the whole dynamic network. But if information is given to node i at some time t, it might be more relevant to measure how fast this information from node i will reach the rest of the nodes. For this reason, we define the forward latency τ (i, j, t) as the time it takes to reach node j from node i via a time-respecting path beginning no earlier than t [51]. If node i and node j are disconnected, τ (i, j, t) = ∞. Now we can substitute τ (i, j, t) for d(i, j) in Eq 3 to recover the temporal closeness centrality, for node i and time t [55,56,57,58]. Because in practice we often observe disconnected nodes, we alter Eq. 4 slightly by taking the mean of the inverse distance which allows us to account for disconnected nodes more cleanly [51].
While several other notions of centrality exist for temporal networks [59], we will describe only two  more in this review, chosen based on their theoretical relevance to neuroimaging data and neuroscientific hypotheses. Within a complex system such as the brain, we often simplify information pathways by assuming that only paths of shortest length or shortest time are essential. However, it is intuitively plausible that information can in fact follow any and all paths, but perhaps those of longer length are less critical than paths of shorter length.
To formalize this idea, we can assign a weight α k to paths of length k, α ∈ (0, 1). This gives a richer perspective on how well node i could potentially communicate with node j. Following [28], we compute the product of matrix resolvents P := (I − αA(1))(I − αA (2))...(I − αA(T )), (6) for the binary matrices A(1), A(2) . . . , A(T ) encoding the binary temporal slices of the network at each timepoint. To avoid underflow and overflow, P is normalized so that the entry Q i,j describes the ability of node i to communicate with node j through paths of all lengths. Then we have the broadcast centrality of node i, and flipping the direction by summing over the rows we recover the receive centrality of node i, describing the ability of all other nodes to communicate with node j. Together these two measures quantify how well nodes can reach and be reached by others along paths of all lengths. Returning to our example empirical dynamic graph obtained from fMRI data, we observe the highest broadcast centrality in a broad swath of posterior parietal cortex extending to the posterior temporal fusiform cortex. By contrast, we observe the highest receive centrality in a broad swath of somatomotor and premotor cortex extending to the anterior supramarginal gyrus. Note that these anatomical distributions are complementary to but not redundant with the anatomical distributions of betweenness centrality and closeness centrality, which tend to display high values in frontal cortex and motor cortex. These differences are due to inherent differences in the underlying mathematical formulation: the broadcast and receive centrality capture the two sides of dynamic communicability [60] and can be used to probe how individual brain regions distribute information across the network and across time.

Null models and additional measures Null models
While summary statistics of dynamic networks offer insight into the temporal network structure, it is also critical to determine whether the architecture we observe differs significantly from that expected under an appropriate statistical null model. Addressing this question requires that we define and exercise dynamic network null models. For static graphs, common null models include the Erdös-Rényi random graph model [61], the ring lattice [62], and the configuration model [63], to name a few. In principle, each of these static graph models can be extended to temporal graph models. However for simplicity, here we will focus only on the two most common dynamic network null models.
The degree-preserving configuration model is popular in studies of static graphs because it retains an important aspect of the graph's topology: its degree sequence. However, in a dynamic graph the problem becomes a bit more difficult: we have both edge connectivity and the time dimension which could be randomized. To construct a null model that is most similar to the configuration model for static graphs, we will perform a random rewiring of edges occurring at the same timepoint. More explicitly, for each timepoint t we imagine the static graph G t . We visit each edge of G t and randomly reassign one end node of this edge to another node within G t , as seen in Fig. 4a. We call this the randomized edges (RE) model following [36]. Importantly, this null model preserves the contact time component. An alternative is to instead randomize the time at which each contact occurs, giving us the so-called randomly permuted times (RP) model (Fig. 4b). This model destroys the true temporal contact patterns while preserving overall event rates [36].
To further illustrate how the RE and RP models alter the temporal structure observed in the original dynamic network, we can calculate the temporal cor- , (10) for one subject in the example empirical dynamic graph estimated from fMRI data and for the RP and RE models that were generated from this same graph [64]. Intuitively, we can think of C i as the average topological overlap of node i's neighbors between two successive timepoints. As expected, we see in Fig 4c that both the RP and RE models have lower values of C than the original dynamic network, indicating that the dynamic graph of the true data is smoothly reconfiguring while the dynamic graphs of the null models are not.

Temporal small-worldness
One context in which null models become particularly important is in testing and quantifying the smallworldness of dynamic graphs. Over the last decade, evidence has continued to mount suggesting that neural systems across different species and spatial scales display small-world properties in both structure and function [65,66]. Yet, little is known about whether or not these systems have temporal small-worldness.
We can recall that the common manner in which one calculates small-worldness for static graphs depends upon estimating the clustering coefficient and the characteristic path length for the original network and appropriate null models [67,68,69]. Naturally, if we could generalize each of these to include the time dimension, then we could straightforwardly calculate small-worldness for dynamic graphs as well. First, following [64] we use the temporal correlation coefficient in place of the clustering coefficient. If a brain region has a high temporal correlation coefficient, then its neighbors persist throughout time in a predictable manner, thereby indicating robust local connections. Next we extend the average shortest path length to temporal networks, giving us the characteristic temporal path length, or where recall d(i, j) refers to the temporal distance (or latency) between two nodes in the network [64]. Now that we have a measure of temporal clustering and of temporal path length, we next turn to the question of whether those values are different than that expected in a random network null model. Specifically, we recall that networks are said to show the small-world property if c/c rand l/l rand > 1 where c rand is the static clustering coefficient expected in a random network null model and l rand is the static characteristic path length expected in a random network null model. Extending this notion to dynamic graphs, we can use either the RE or the RP model as the dynamic network null model, and then compute the temporal small worldness as C/C RE L/L RE or C/C RP L/L RP where C is the temporal correlation coefficient and L is the characteristic temporal path length. In Figure 4c we apply these notions to the example empirical dynamic graph estimated from fMRI data, and observe that the temporal small-worldness decreases with increasing number of trials practiced.

Temporal Community Structure
The measures we have discussed thus far have been either focused on individual nodes in the graph or on global, summary statistics of the graph as a whole. Yet an important feature in many networks, particularly in networks representing neurophysiological systems, is mesoscale architecture [70]. Perhaps the most commonly studied type of mesoscale architecture in such networks is community structure [71,72,73]: where nodes can be sorted into groups displaying dense intra-group connectivity and sparse intergroup connectivity. Multiple methods for extending community detection to dynamic networks exist [74,75,76,77,7], and we refer the reader to these resources for more detailed discussions of these methods. Here, we assume that one has applied a dynamic extension of community detection techniques to one's data and has an estimate of each node's affiliation to communities as a function of time. Under these assumptions, we will focus on three metrics that can be used to characterize the fine scale changes of communities across time.
First, given a community assignment as in Fig. 5a, we expect some nodes to likely remain within a single community for all timepoints, while others may change communities often. Within the brain, a node that changes communities multiple times may be modulating multiple processes [78] and may consequentially be essential for dynamic and adaptive processes [46]. For example, in the toy dynamic graph displayed in Fig. 5b, we see the orange node changes communities three times within the time window, while the blue node remains within the same community. We can quantify this property with the notion of node flexibility, defined as the number of times that a node actually changed communities, normalized by the number of times the node could have changed communities. That is, if node i changed communities m times, the flexibility of node i is where recall T is the number of timesteps. Then the flexibility F of the dynamic network is the average of f i over all nodes [46]. According to this definition, we see the orange node in Fig. 5b has high flexibility, while the blue node has low flexibility. Yet, simply counting the number of community affiliation swaps for a given node may mask important information. If, for instance, a node of interest swaps back and forth between only two communities, it will have high flexibility but if many other communities exist we cannot infer that it participates in many processes. We see that the node marked in blue in Fig. 5c switches between communities 2 and 3 six times throughout the course of the network (Fig. 5a, bottom) while the orange node of Fig. 5c switches only four times, yet it is at least once a member of all four communities. To better describe this difference we can define node promiscuity as for node i which participates in k of K total communities [79]. Then the promiscuity Ψ of the dynamic network is the average of all ψ i . Intuitively, while flexibility may give one a basic intuition regarding how changeable the community structure is, promiscuity gives one an understanding of how distributed a node's allegiances are to all communities over time.
Since we can measure how nodes change communities across time, we now might ask how groups of nodes change (or do not change) communities. We can assume brain regions that most often change communities in a coordinated fashion are more likely to be involved in the same processes. We define node cohesion as the number of times a node changes communities mutually with another node [80]. We illustrate this notion pictorially in Fig. 5d, where the two orange nodes change communities together, while the blue nodes switch communities independently of each other. In this case, we say the orange nodes are cohesive and the blue nodes are disjoint (or have a low cohesion strength). Using these measures we can probe community dynamics at a finer scale than is possible using community assignments alone.

Contexts for the Application of Dynamic Graph Metrics
Now that we have described dynamic graph metrics from a mathematical point of view and have illustrated their application to both toy networks and empirical dynamic graphs estimated from fMRI data, we now turn to outlining and discussing a few natural scenarios in which dynamic graphs could be constructed to address hypotheses regarding brain structure and function, as well as the neurophysiological mechanisms of behavior and disease. These scenarios are not meant to be comprehensive, but are simply meant to provide the reader with some intuitions about potential application areas.
Cross-scale, Cross-species. While we have illustrated these techniques and tools in the context of an fMRI data set, it is important to note that the field of network neuroscience -which could benefit greatly from dynamic graph tools -extends far beyond human imaging [1]. Arguably even more fundamental are the connectivity patterns characteristic of neuronal circuits, which are measureable, manipulable, and dissectable in non-human animals. This small-scale circuitry displays rich network architectures that can vary over time, development, and species [8] and can be explained to some extent by gene coexpression [81]. Indeed, prior evidence demonstrates that local cortical circuits display highly nonrandom features of synaptic connectivity [82,83], characterized by motifs [48], distant-dependent architecture [84], redundancy [85], and modularity [86]. A particularly interesting set of questions lies in whether and how dynamic graph architectures are conserved across species and to what extent they vary. One might hypothesize that temporal small-worldnesslike static small-worldness -may be a common design principle across mammalian brains [65,66], arbitrating a dynamic tradeoff between temporal cost and temporal efficiency [87].
Cognitive Processes. Many cognitive processes are explicitly thought of as dynamic processes, requiring time-dependent changes in information acquisition or retrieval, followed by processing or encoding, to enable responses or decisions. Recent work has demonstrated that functional network architecture in the human brain changes appreciably during such tasks, particularly in those that require higher-order cognitive processing like memory [24,88], attention [23,89], learning [90,27,28,91], cognitive flexibility [24], and task-switching [92]. These types of processes are therefore naturally encoded in dynamic graphs in which the layers of the graph represent time windows, and the edges in the graph represent functional (or effective) connections between neural signals measured from fMRI, EEG, MEG, ECoG, or fNIRS in humans, or calcium transients, local field potentials, etc. in non-human animals. A particularly interesting open question is whether and how these processes are modulated by mood [21] and/or levels of arousal [93]. One might hypothesize that mood instability could manifest as decreases in the temporal correlation coefficient and increases in the temporal path-length, leading to a more random temporal graph. This hypothesis could be tested in future work.
Development and Aging. While cognitive pro-cesses are accompanied by changes in functional network architecture over relatively short time scales (seconds, minutes, hours), other natural processes evolve over relatively long time scales (months, years, decades). Normal human development and aging are examples of such long-term processes, and recent evidence has begun to map out changes in both structural and functional brain network architecture that track with age [94]. Whether the time frame is fetal development [95,96], child and adolescent development [29,30], or the full lifespan [31,97], patterns of connectivity reconfigure in a manner that at least partially explains changes in cognitive abilities. A particularly striking example is the emergence of cognitive control over development, which has inspired a range of network-based theories pointing towards a critical role for variations in network structure [98,99], network function [100,101], and network dynamics [102]. The dynamic graph metrics discussed here offer an interesting and novel framework in which to better probe the relationship between network change and the emergence of cognitive control in fronto-parietal circuitry. In particular, one might hypothesize that the receive centrality of the fronto-parietal network decreases over development, while the broadcast centrality (possibly marking the potential for top-down control) of this same network increases over development. Future work could test this hypothesis explicitly and also test whether the temporal trends in broadcast and receive centrality differ in children with psychosis [103,104] and those with executive function deficits [105]. Disease Processes, Disease Progression, Response to Therapy. While child-onset psychosis is one condition that may be characterized by altered network dynamics, other neurological disorders and psychiatric disease may also display similar or inherently different sorts of changes [10,106]. Indeed, recent evidence has demonstrated alterations in the functional network architecture most characteristic of individuals with Alzheimer's disease, Parkinson's disease, and epilepsy to name a few [9]. Interestingly, network architecture can be used to track seizure dynamics [15,13,14] or the progress of atrophy and dementia [32]. Less is known about whether and how network architecture or dynamics could be used to track rehabilitation after stroke [107] or response to therapeutic interventions including physical therapy [108], brain stimulation [109,110], and neurofeedback [111,112,113]. Some work suggests that changes in motor behavior are characterized by reconfiguration of functional network modules [46,38] and that modularity predicts a person's response to cognitive training after brain injury [114]. It would be interesting to explicitly test whether the reconfigurations that are most benefitial to stroke rehabilitation are characterized by high flexibility, promiscuity, or cohesion, and whether the relationship between rehabilitation and network reconfiguration is always linear or is better characterized as an inverted U-shaped curve.
Extensions to Other Sorts of Graphs. While we have focused our exposition on functional dynamic graphs, it is important to note that dynamic graphs can be constructed from many other sorts of data as well. Perhaps the simplest example is a dynamic graph constructed from structural (diffusion imaging tractography) data acquired either over age [31] or training [115]. But one could also consider setting aside the brain entirely and studying network patterns in symptomatology, covariance in markers of mood, or patterns of behavior [116,117], where dynamic graphs could provide insight into skill acquisition or adaptive decision-making.

Conclusion
In summary, we have provided a tutorial on what a dynamic graph actually is, how to visualize it, and how to characterize it. In particular, we describe several basic dynamic graph notions and measures including time-respecting paths, latency, centrality, clustering, characteristic temporal path length, and dynamic modular structure, and we also discuss null models and measures that depend on them, such as temporal small-worldness. We outline a few natural scenarios in which dynamic graphs could be usefully constructed and studied, and we provide a publicallyavailable MATLAB toolbox to enable the reader to immediately apply these tools to their data. Our aim is to provide the neuroimaging community with both tools and intuition and to support the growing interest in addressing neuroscientific questions that hinge on detailed analyses of dynamic graphs.
PHY-1554488, BCS-1631550). The experiments performed to generate these data were supported by PHS grant NS33494 to Scott T. Grafton; experiments were performed by Nicholas F. Wymbs. The content is solely the responsibility of the authors and does not necessarily represent the official views of any of the funding agencies.

Receive centrality
Given node j, receive centrality is defined r(j) := N i=1 Q i,j [28].

Temporal correlation coefficient
Let A i,j (t) be the connectivity of nodes i, j at time T . Then for node i, [64].

Characteristic temporal path length
For a dynamic network, letting d(i, j) be the temporal distance between nodes i, j.

Temporal small worldness
Let C, C rand be the average temporal correlation coefficient and L, L rand the temporal characteristic path length for the dynamic network and randomized model, respectively. Then the temporal small worldness is C/C rand L/L rand [64].

Flexibility
For node i, the flexibility is where m is the number of times node i change communities [46].

Promiscuity
The promiscuity of node i is with k the number of communities of which node i is a member and K the total number of communities in the dynamic network [79].

Cohesiveness
The number of times a node changes communities mutually with another node [80].