From Large Deviations to Semidistances of Transport and Mixing: Coherence Analysis for Finite Lagrangian Data

One way to analyze complicated non-autonomous flows is through trying to understand their transport behavior. In a quantitative, set-oriented approach to transport and mixing, finite time coherent sets play an important role. These are time-parametrized families of sets with unlikely transport to and from their surroundings under small or vanishing random perturbations of the dynamics. Here we propose, as a measure of transport and mixing for purely advective (i.e., deterministic) flows, (semi)distances that arise under vanishing perturbations in the sense of large deviations. Analogously, for given finite Lagrangian trajectory data we derive a discrete-time-and-space semidistance that comes from the “best” approximation of the randomly perturbed process conditioned on this limited information of the deterministic flow. It can be computed as shortest path in a graph with time-dependent weights. Furthermore, we argue that coherent sets are regions of maximal farness in terms of transport and mixing, and hence they occur as extremal regions on a spanning structure of the state space under this semidistance—in fact, under any distance measure arising from the physical notion of transport. Based on this notion, we develop a tool to analyze the state space (or the finite trajectory data at hand) and identify coherent regions. We validate our approach on idealized prototypical examples and well-studied standard cases.

Keywords Large deviation · Coherent sets · Lagrangian data · Mixing . Mixing distance . Transport distance Mathematics Subject Classification Primary 37N10 · 60F10; Secondary 60J22 · 76F25 · 05C12 · 37M10 1 Introduction Transport in Dynamical Systems Instrumental to understanding the essential behavior of complicated non-autonomous flows is to grasp how transport is happening in them. This leads on a qualitative level to objects that prohibit transport, commonly named transport barriers; often originating from the geometric picture for autonomous systems and that trajectories are unable to cross co-dimension 1 invariant manifolds (Haller 2000(Haller , 2001Beron-Vera 2012, 2013). For periodically forced systems, invariant manifolds enclose regions called "lobes" that get transported across these periodically varying manifolds (MacKay et al. 1984;Rom-Kedar and Wiggins 1990).
On a quantitative level, one searches for surfaces of small flux (Balasuriya et al. 2014;Karrasch 2016;Froyland and Koltai 2017), so-called partial barriers (Wigner 1937;Meiss 1992). Instead of characterizing regions that do not mix with one another via enclosing them by boundaries of low flux, there are approaches that aim to describe these sets directly. Such set-oriented concepts are strongly interwoven with the theory of transfer operators (Perron-Frobenius and Koopman operators) and comprise almost-invariant sets (Dellnitz and Junge 1999), ergodic partitions (Mezić and Wiggins 1999) in autonomous, and coherent sets (Froyland et al. 2010;Froyland 2013) in the non-autonomous cases.
Distinctive attention has been given to coherent sets, which are a (possibly timedependent) family of sets having little or no exchange with their surrounding in terms of transport and are robust to small diffusion over a finite time of consideration (Froyland 2013(Froyland , 2015. Natural examples include moving vortices in atmospheric (Rypina et al. 2007;Froyland et al. 2010), oceanographic (Treguier et al. 2003;Dellnitz et al. 2009;, and plasma flows ). In such applications, one would like to be able to find coherent sets even in the cases when a dynamical model that can be evaluated arbitrarily often is not available, only a finite set of Lagrangian trajectory data (passive tracers moving with flow with positions sampled at discrete time instances). This problem has received lot of attention in recent years, and a diverse collection of tools has been developed to tackle it (Budišić and Mezić 2012;Allshouse and Thiffeault 2012;Froyland and Padberg-Gehle 2015;Allshouse and Peacock 2015;Williams et al. 2015;Hadjighasem et al. 2016;Banisch and Koltai 2017;Schlueter-Kuck and Dabiri 2017;Padberg-Gehle and Schneide 2017;Rypina and Pratt 2017;Fabregat et al. 2016;Froyland and Junge 2017).
While other current methods aim at collecting trajectories into coherent sets, in Banisch and Koltai (2017) it has been proposed to go one step further and analyze the connectivity structure of the state space under transport and mixing with "transport coordinates" and the "skeleton of transport". Very similar observations have been made earlier in Budišić and Mezić (2012) in the infinite-time limit for periodically forced systems. While coherent sets (and transport barriers) aim at partitioning the state space, the skeleton is aiming at "spanning" the state space with respect to transport. In this respect, coherent sets can be associated with distinct "extremal regions" of the skeleton. Here we will only use this idea of extremality, more precisely that coherent sets are "maximally far" from one another, as measured by transport. To this end, we will need to measure "farness" of dynamical trajectories.
Several dynamical distance measures have been put forward already to measure the "distance" or "dissimilarity" of trajectories or initial states in dynamical systems (Mezić and Banaszuk 2004;Budišić and Mezić 2012;Froyland and Padberg-Gehle 2015;Hadjighasem et al. 2016;Fabregat et al. 2016;Karrasch and Keller 2016). The majority of them are shown to serve their purpose well in revealing coherent structures efficiently and reliably. However, they are either heuristic in the sense that they are not derived from the physical notion of transport and mixing, or no discretizations to finite scattered trajectory data have been developed.
The purpose of this paper is thus twofold. On the one hand, we develop a distance measure (a semidistance) between trajectories that is derived from the physical notion of transport and mixing subject to diffusion of vanishing strength, and we also derive a discretized distance measure for finite (also possibly sparse and incomplete) Lagrangian data that is consistent with its continuous counterpart in the limit of infinite data. On the other hand, we construct a tool to analyze with such distances the structure of the state space under transport, especially to find coherent sets. This tool makes use of the idea that coherent sets are some sort of extremal regions on a spanning structure with respect to transport, although in this work we will not investigate this "skeleton" in its entirety.

Finite Time Coherent Sets
Let us consider the ordinary differential equation (ODE) on some bounded X ⊂ R d and on a finite time interval [0, T ] for some T > 0. Throughout the paper, we will assume that v : [0, T ] × X → R d is a continuous velocity field tangential at the boundary, such that the flow of (1), denoted by φ s,t [·], 0 ≤ s, t ≤ T , is a diffeomorphism on appropriate subsets of X . For t < s we flow backward in time: φ s,t = φ −1 t,s . Many different notions to characterize coherent sets have been proposed in the literature. Central to all of these notions is the idea that coherent sets should be robust under noise; without such a requirement, any non-intersecting characteristic of a singleton could be considered a coherent set. To this end, one typically perturbs the ODE (1) by a random noise (Denner et al. 2016;Froyland and Koltai 2017;Karrasch and Keller 2016), leading to the Itô stochastic differential equation (SDE) 1 dx (ε) t = v (t, x (ε) where {w t } t∈[0,T ] is a Wiener process (Brownian motion) with generator φ → 1 2 φ, reflecting boundaries, and starting from w 0 = 0 (deterministically) and ε > 0 is, at least for now, a given small constant. In fact, the rigorous mathematical formulation of an SDE with reflecting boundaries can be quite subtle, see Andres (2009). We ignore this issue as it does not affect our analysis.
According to the definition of finite time coherent pairs (Froyland et al. 2010;Froyland 2013;Koltai et al. 2016), two sets A, B ⊂ X are coherent for times 0 and T if most mass from set A is likely to end up in set B, and most mass ending up in set B is likely to originate from set A, that is, Naturally, for practical purposes one would need to choose how small ε and how large these probabilities should be. As the systems we are dealing with are often deterministic by nature, and there is no "physically straightforward" choice of the diffusion strength ε, our first aim is to remove some of this indeterminacy by quantifying what it means for probabilities to be close to 1 for small ε, in terms of large deviations as we explain below. 2 However, it turns out that the forward and backward conditions (3) are essentially equivalent in the large-deviation regime, and even worse, the largedeviation limits of (3) hardly give any quantitative information about how coherent two sets might be, as discussed in Appendix A. To conclude, the large deviations of conditions (3) do not yield sensible conditions for coherence.

Large-Deviation-Based Semidistances
In the current paper, we take a different approach. We study semidistances that quantify how unlikely it is for mass to flow from one point to another. These are semidistances in the sense that they satisfy all properties of a metric except for the triangle inequality. In the first part of this paper, in Sects. 2 and 3, we show how such semidistances can arise naturally from probabilistic arguments via large-deviation principles, as we explain below. In the second part, in Sects. 4 and 5, we discuss how (general) semidistances can be used to analyze coherent sets, and we apply the concepts of this paper to a number of examples. In Sect. 2, we derive two different semidistances from the large deviations of two probabilities. The first one is related to the probability that the endpoint x (ε) T of the random path is φ 0,T [y], given that it starts in x (ε) 0 = x, for any two initial positions x, y ∈ X . As ε → 0, the process can no longer deviate from the deterministic flow of (1), and hence this probability will converge to 0 whenever x = y. In fact, it converges exponentially fast (Freidlin and Wentzell 1998) for some function μ T (x→y) ≥ 0, where this statement and notation are made precise in Sect. 2.1. Such exponential convergence results are called large-deviation principles, and μ T (x → y) is the large-deviation rate. The less probable it is to reach one point from another, the larger the rate between them. The first semidistance is then obtained via symmetrization: We call this the cross semidistance, since it arises from mass flowing from x to φ 0,T [y] and mass flowing from y to φ 0,T [x] simultaneously and independently, see Fig. 1. The second semidistance arises as the large deviations of the probability for two independent random trajectories x (ε) , y (ε) starting at x and y, respectively, to meet at or before time T (Fig. 2): where the meeting semidistance is given by By this procedure, we find two semidistances μ cross T and μ meet T that can be used as a measure of "farness" of points x, y, which will be low for points in the same coherent set, and high otherwise. Since both arise from large-deviation principles, they have a nice additional interpretation as a probabilistic cost or free energy that needs to be paid in order to deviate from the expected flows; such interpretation is common in statistical physics, see for example Onsager and Machlup (1953).
Nevertheless, we will see that in order to calculate these costs explicitly, the velocity field v needs to be known. As discussed above, this is in practice seldom the case; mostly one can only assume to have discrete-time snapshots of the positions of a limited number of floaters. With this in mind, we derive similar cost functions as above, that are based on such a finite data set only. This will be the content of Sect. 3. First, the dynamics is discretized in time and space by conditioning a usual time-stepping method for the SDE (2) on the event that the random continuous trajectories are to be found in the set of known floater positions at the K ∈ N given time instances. As above, we then derive two large-deviation semidistances ν cross K (x, y) and ν meet K (x, y) that have a clear probabilistic interpretation, that can be used to characterize coherent sets, and that are based on the finite data set rather than on the explicit velocity field. In fact, we will show that these discrete-space-time semidistances are really specific discretizations of the continuous-space-time semidistances μ cross T and μ meet T . As shown in Sect. 3.4, they can be computed as shortest path lengths in a time-dependent weighted graph. We give an algorithm to compute these shortest paths in Appendix B.
Let us stress that these semidistances are defined for deterministic dynamical systems. The random perturbation that is factored out by the large-deviation principle is merely acting as a catalyst to help quantify how strongly distinct trajectories mix-or, we should rather say how poorly, as the transport from one trajectory to another is inversely proportional to their semidistance.
Coherence Analysis with Semidistances In Sect. 4, we describe how in general a semidistance on finite Lagrangian data can be used to analyze coherence. Key to our method is the notion of cornerstone: a point that is furthest away from all other points. Cornerstones are though of as "endpoints" of a spanning structure, and ideally each cornerstone is in some sense the center of a coherent set. As a next step, trajectories can be clustered around cornerstones to yield coherent sets. Of course, this approach is very close to the k-means-and fuzzy c-means clustering of trajectories with respect to dynamical distances in Hadjighasem et al. (2016);Froyland and Padberg-Gehle (2015), with the important difference that the centers are not chosen by the heuristics of these clustering approaches, but with regard to the properties of coherent sets in the light of transport and mixing.
To exemplify the usefulness of the theory put forth in this paper, in Sects. 4 and 5 we test our approach on a number of standard test cases. Finally, Sect. 6 discusses possible combinations of this work with other concepts.

Large-Deviation Semidistances in Continuous Time and Space
In this section, we study large deviations of the forms (4) and (6). In large-deviation theory, it is often easier to first study large deviations in a larger space. In our setting, we first study the large deviations of paths in Sect. 2.1 before transforming to the large deviations of the endpoints in Sect. 2.2. We end with a discussion of the resulting semidistances μ cross T , μ meet T in Sect. 2.3.

Large Deviations of Paths
We denote paths by w (·) to distinguish them from points w. Let P be the Wiener measure, i.e., the probability that a Brownian path lies in a set U ⊂ C(0, T ; R d ) is P[w (·) ∈ U ]. Recall that there does not exist a canonical probability measure on the space of paths, and so the Wiener measure cannot be identified with a meaningful density. This means that one always needs to consider sets rather than particular realizations of the Brownian path. Nevertheless, large-deviation rates are always local, in the sense that they depend on one realization only (the most likely one in the set U under consideration). This motivates writing w (·) f (·) if w (·) lies in an infinitesimal neighborhood U of the path f (·) . We will make this more precise below.
The large deviations for the SDE (2) are a standard result by Freidlin and Wentzell (1998). This result can be derived via a combination of Schilder's theorem and a contraction principle as we now explain.
We first consider the noise part √ εw t , which clearly converges (almost surely uniformly) to the constant path 0 as ε → 0. The corresponding large-deviation principle is given by Schilder's theorem (Dembo and Zeitouni 1987, Th. 5 for differentiable paths w (·) starting from w 0 = 0 (otherwise the limit will be ∞). 3 Let us assume that the velocity field v(t, ·) is Lipschitz, so for each realization of the Brownian path w (·) = w (·) corresponds a unique solution x (ε) (·) of the SDE, starting from some given x (ε) 0 = x, see (Øksendal 2003, Th. 5.2.1). The contraction principle (Dembo and Zeitouni 1987, Th. 4.2.1) then states that the large-deviation rate of a path x (·) is given by the minimum of (7) over all realizations of the noise that give rise to that path, i.e., for differentiable paths x (·) starting from x 0 = x.

Large Deviations of Endpoints
We now derive the large-deviation principle of the type (4) as discussed in the Introduction. In a sense, the pathwise large deviations (8) encode more information than is needed if we are only interested in the endpoint x (ε) T φ 0,T (y) of the random path.
3 More rigorously, (7) means ε log P √ εw (·) T 0 |ẇ t | 2 dt, where, for technical reasons, this convergence is realized by a liminf lower bound for open sets U and limsup upper bound for closed sets U ; see Dembo and Zeitouni (1987).
Another application of the contraction principle then states that the large-deviation rate for the endpoint is the minimum of (8) over all paths starting from x and ending in that given endpoint φ 0,T [y], that is: This defines the "one-way" rate that we are after. The sum (5) then defines the cross-semidistance μ cross T (x, y) and has a natural interpretation in terms of large deviations: As mentioned in the Introduction, it arises from two independent and simultaneous copies x (ε) t , y (ε) t . By independence, the probability that (x (ε) T , is a product of one-way probabilities, yielding the sum of two one-way rates in the large deviations, see Fig. 1.
A similar argument can be used to derive the meeting large deviations (6). Let x (ε) t and y (ε) t be two independent solutions of the SDE (2), starting from given x and y, respectively. We consider the probability that both trajectories end in a given point, say φ 0,T [z] for some z ∈ R d , see Fig. 2. Assuming independence of the two trajectories, we immediately get However, we are only interested in the probability that the two trajectories meet, and not in the point where they meet. A final contraction principle thus yields: Observe that the two paths could also meet earlier and subsequently follow the same trajectory up until time T with zero cost; the time T thus acts as a maximum time at which the paths should meet.

The Semidistances
We now discuss some metric properties of the rate functionals. Recall from Introduction that we assumed that the flow is a diffeomorphism. Therefore μ T (x → y) = 0 if and only if x = y. It is then easy to see that, for any x, y, and However, the triangle inequality can fail, and so μ cross T and μ meet T are semidistances only.
We point out the following useful relation between the two. Observe that by the definition, μ meet T (x, y) ≤ μ T (x→y) + μ T (y, y) = μ T (x→y), and similarly μ meet T (x, y) ≤ μ T (y→x). Therefore, In order to investigate which semidistance is more suitable to study coherence, one would need to study in which setting the gap μ cross T (x, y)−μ meet T (x, y) becomes large. This is beyond the scope of this paper, but we will show for several examples that both work as they should.
Remark 2.1 (Invariance under time reversal) Note the following invariance property of μ T under time reversal: where ← − μ T is the one-way rate associated with the backward systemẏ t = −v(T −t, y t ). This time-reversal property is retained for the cross-semidistance: μ cross is the same as the cost for the backward trajectories to start in a joint position and end in φ 0,T [x] and φ 0,T [y].

A Simple Example
Let us consider a very simple example, where the domain of interest is the interval [0, L], and there is no dynamics, i.e., v ≡ 0. Its primary purpose is to form our intuition and expectations about how the semidistances work in more complicated settings. In particular, we shall see how the semidistances scale in time and system size.
The system is considered on the time interval [0, T ]. One can then easily see thatẋ t ≡ L/T is an optimal path in (9), thus giving and so μ cross In general, the one-way cost is proportional to the squared distance and inversely proportional to time. This also gives so, in this symmetric situation the meeting distance is half of one-way cost and quarter of the cross-semidistance. We will revisit this example in the next section and will realize that the behavior of the discrete semidistances deviates from the one observed here for continuous space and time.

Large-Deviation Semidistances in Discrete Time and Space
As mentioned in the Introduction, the cost functions μ cross T and μ meet T are difficult to calculate explicitly, and impossible if the velocity or flow field is not explicitly known. In this section, we take a more practical approach. We will assume that the only information at hand is the position at finite times of a finite number I of floaters.
To be more specific, let ..,I ⊂ R d be given positions of floaters i = 1, . . . , I at time kτ for k = 0, . . . , K for some τ > 0. Assuming that the floaters sample from the deterministic flow field φ s,t , we know that for each floater i, If we would add noise to the system, we would find random particles described by the set of SDEs where w (i) are now independent standard Brownian motions. Our strategy is to study the probability that random particles described by the SDEs (12) deviate from the given floater trajectories (11), conditional to the fact that all our knowledge about the otherwise unknown flow field φ s,t comes from the timeand space-discrete set of trajectory data (11). We first approximate the SDEs (12) by discrete-time, continuous-space Markov processes in Sect. 3.1, as it is done in standard time-stepping methods for SDEs (Kloeden and Platen 2010). Next, in Sect. 3.2 we condition these discrete-time processes on the given floater positions. Then we calculate the large-deviation rate for trajectories in Sect. 3.3, and for endpoints in Sect. 3.4. Finally, we end the section with a discussion of the metric properties of the resulting large-deviation rates in Sect. 3.5.

Discrete-Time Approximation
We first focus our attention to one time step kτ → (k + 1)τ of one trajectory i, and temporarily drop the superindex for brevity. Since the noise process is a standard Brownian motion, we know its density, Hence, we have exact information on the purely deterministic part of the SDE by (11) and on the purely noise part by (13). We combine this information by using the following time-stepping approximation for the SDE (2). Fix an α ∈ [0, 1], and let (ξ + k , ξ − k ) k=0,...,K be independent normally distributed R dvalued random variables with unit variance. Given the approximated random positioñ x k at time kτ , we iteratex Here,x + k andx − k+1 are only auxiliary (intermediate) steps. The method (14) is a special case of a splitting method, since the deterministic evolution and purely noise parts of the SDE (2) are handled separately in the distinct steps; here it would be "noise-flownoise".
We would like to stress that our choice of discretization is made on the basis that we can use the available information on the flow given by (11). In the realm of onestep methods for SDEs we are bound to choices of the form (14), because there is no information on the drift other than the flow generated by it on prescribed time intervals [kτ, (k + 1)τ ). Given the form of time-stepping (14), the optimal [in the sense of highest weak consistency order Kloeden and Platen (2010)] approximation of the SDE is obtained by choosing α = 1/2. That is the so-called Strang-splitting (Strang 1968) and has weak order two, while for α = 1/2 we only get order one. 4 Having performed discretization in time, in the next section we derive a discretetime, discrete-space, α-dependent Markov chain that we will use to derive discrete semidistances.

Conditioning on Finite Data
Recall that we considered one discrete-time process (x k ) k=1,...,K with initial conditioñ x 0 = x (i) 0 , and that we suppressed the dependency on i. For each k = 0, . . . , K , we introduce the set of available points at time t = kτ . We now condition the random process on the event that for each realizationx k ∈ A k and for each intermediate pointx This automatically implies conditioning of the other intermediate pointsx − k+1 ∈ A k+1 due to (11). We choose to condition on the intermediate points for practical reasons; otherwise, we would not be able to perform the second step in (14), since the discrete trajectories are our only information about the flow, cf. Remark 3.1 below.
The conditioning on the finite data set results in replacing the discrete-time continuous-space process by a fully discrete-time discrete-space Markov chain that hops between the given trajectories. Therefore, the state of the new Markov chain can be represented by the labels j = 1, . . . , I ; this is particularly useful since the deterministic flow (11) will change the positions but not the labels. Since the resulting process is still Markovian, we can fully characterize its behavior through its transition probabilities for one time-step k → k + 1. We now calculate these transition probabilities, dealing with each step in (14) separately. See Fig. 3 for a sketch.
For the transition fromx k tox + k , where we know the increment distribution (13), note that we are in fact conditioning on a null set, so that the conditional probabilities are sensibly defined as the limits over balls B r (·) of small radii r → 0 around these points. We thus obtain, for any j, = 1, . . . I : and similarly for the transition fromx − k+1 tox k+1 : Since the transition fromx + k tox − k+1 is deterministic (middle equation in (14)), we have that, In words, the process performs the following three subsequent steps for one time step (see Fig. 3): The transition probabilities P k ( j, m) define our new, discrete-time Markov chain (i k ) k=0,...,K on the discrete space {1, . . . , I }. To shorten notation, we will write i (·) := (i k ) k=0,...,K for a discrete path, analogous to the continuous-time setting. By the Markov property, the probability that the Markov chain realizes such a path is simply where we assumed that the chain starts (deterministically) from i 0 .

Large Deviations of Discrete Trajectories
We now study the large deviations of the discrete Markov chain i k . Similarly to the continuous setting from Sect. 2, we start from the large deviations of paths. First we calculate the large deviations for p + k ( j, ) and p − k+1 ( , m). By the Laplace principle (27), We will make this simplification again below. Similarly, we obtain Using these two exponential approximations, we can again use the Laplace principle (27) to find for the jump probability of one time step: Finally, the large-deviation rate of a discrete path is Remark 3.1 Recall that we conditioned on the event that allx k as well as the intermediate pointsx + k lie in the set A k of available points. One might argue that in practice only the pointsx k are measured to lie in A k , while the other two are mathematical constructs that may lie anywhere. However, if we would relax this conditioning and follow the calculations as above, we would find: Since this large-deviation rate still depends on the unknown flow field φ, it cannot be used if only the data of a finite number of floaters is available.

Remark 3.2 (Missing data and non-uniform time-sampling)
Note that the construction works exactly as described above even if information about trajectories is partially missing. The conditioning on the set A k works identically, but now these sets might have different cardinalities smaller or equal I . Observe that our only information about the deterministic flow for times in [kτ, (k + 1)τ ) comes from those trajectories that are available both in A k and A k+1 . If this intersection is empty, we need to skip that time slice completely. This is not a problem, since our choice of sampling time uniformly by the step size τ was solely in order to ease presentation. As the reader has probably observed, the extension for varying time steps τ k is straightforward.

Large Deviations of Endpoints
Analogously to the continuous setting, we study the large deviations of the one-way probability to hop from i to j in discrete time K , and the meeting probability that two independent chains, starting from i and j, respectively, meet by discrete time K or earlier. Since the paths (19) encode more information than the endpoints, we can now easily derive the large deviations of the one-way probability by a contraction principle. Indeed, for any two indices i, j = 1, . . . , I , where J is the discrete-path large-deviation rate (19). Note that J is the shortest path length in a graph with time-dependent edge weights can be given an interpretation in terms of large deviations as in Sect. 2.2. Moreover, following the same argument as in (10), if we take two independent trajectories i (·) and j (·) , then

The Semidistances
It is easily checked that in the discrete setting the properties of a semidistance are also satisfied: . Furthermore, the triangle inequality fails, but we again have the following estimate: Both semidistances can be computed from shortest path costs, where the cost of a path is given by (19). We stress that this expression is fairly simple and depends on the flow field through the known positions of the floaters x ( ) k only. Because of this: (1) these costs can be used in practice if the velocity field is unknown (Sects. 4 and 5); (2) these costs can even be applied to cases where there may not be an underlying velocity field, as for example in discrete-time dynamical system (Sect. 4.1).

Fig. 4 Hopping back and forth (solid line) between two given trajectories (dashed lines)
k K These semidistances can be computed by first computing the one-way rates ν K (i → j) using Algorithm 1, see Appendix B. From these rates, one readily obtains the semidistances via ν K is the cost associated with the backward dynamics. Moreover, this time-reversal property also holds for the cross-semidistance, whereas for the meeting semidistance ν meet Apart from the superior consistency order discussed in Sect. 3.1, the invariance of semidistances under time reversal is another reason for choosing α = 1/2.

Remark 3.4
Other large-deviation-based semidistances are also possible. If one considers the "noise-flow" (i.e., α = 1) time-stepping scheme for the SDE rather than "noise-flow-noise", expression (19) simplifies a bit. As another example of a largedeviation-based semidistance between two given discrete paths {x (i) k , x ( j) k } k=0,...K , one could consider the probability to hop back and forth between the two trajectories, see Fig. 4. In that case, we find in the large-deviation scaling for α = 1: for α = 0 the sum would go from k = 1 to K . Naturally, this is simply the L 2 -distance between two trajectories, as considered earlier in Froyland and Padberg-Gehle (2015). Although this construction is very easy to calculate and its square root is a genuine metric, it is less interpretable as a cost for transport and mixing.
Remark 3.5 It should be noted that the semidistances ν meet K , ν cross K scale quadratically in space; this becomes even more apparent in the example considered in Sect. 3.7. In the case of the L 2 -distance (21), the cost becomes a genuine distance after taking the square root. However, if we take the square roots of ν meet K and ν cross K , the triangle inequality still fails. We therefore stick to the quadratic scaling as this has the most direct interpretation as large-deviation costs.
Remark 3.6 (Eulerian transport vs Lagrangian mixing) When speaking of transport in this paper, we mean "transport (of probability) from a trajectory to another", to express how the dynamics is mixing up regions these two trajectories come in contact with. This can be seen as a Lagrangian perspective. We express with large-deviation rates the unlikeliness of transitions between trajectories, and these are then computed as shortest paths, cf. Sect. 3.4. Deceivingly similar mathematical constructions show up in Ser-Giacomi et al. (2015), where the authors consider "highly probable paths" of non-homogeneous Markov chains, which also leads to a time-dependent shortest path problem. Note, however, that this is orthogonal to our concept, as this is quantifying likeliness. A further important distinction is that their Markov chain is constructed in an Eulerian manner (opposed to our Lagrangian setting), meaning that it describes transport between fixed regions of state space; serving as a discretization of the flow field (Froyland et al. May 2007.

Discretization of the Continuous Semidistances
We now show that the one-way discrete-space-time cost ν K can also be obtained by discretizing the continuous-space-time cost μ T . This means that discretization and derivation of the large-deviation principle are interchangeable operations (if done the right way). We will not be precise about the discretization error; of course one needs to assume that the number of floaters is sufficiently large. We first divide the time interval into subintervals [0, Recall that φ t 0 ,t is the flow associated with v(t, ·), that is, for any t 0 , x, Note in what follows that x (·) is some path, not necessarily a trajectory of the flow. In each interval [kτ, (k + α)τ ), we approximate by finite differences: In each interval [(k + α)τ, (k + 1)τ ), we approximate: Because of the assumption that the flow is one-to-one, we can always write x (k+α)τ = φ kτ,(k+α)τ [x k ] for somex k . We thus obtain: Since the number of floaters {x (i) k } k=0,...,K ;i=1,...,I is large, we can find an x (i) k close tox k , giving This shows that we can either derive the large-deviation rate function in continuous space and discretize this to finite trajectories (as done here), or we can restrict the continuous dynamics to finite trajectory data and derive a large-deviation rate function for that (as done above); we obtain consistent results whichever route we take.

The Simple Example Revisited
Let us now demonstrate how the results of this section apply to the example of Sect. 2.4.

Discrete Time and Continuous Space
Let us first suppose we are given infinitely many "trajectories" of the system, one starting at each point x ∈ [0, L], and they are sampled at discrete time points kτ , k = 0, 1, . . . , K , with τ = T K . From Sect. 3.3 with α = 1/2 we obtain, by writing x = L K , that where we used that the optimal discrete path in (20) is the one making jumps of equal lengths x. Note that the rate function is identical to that in the fully continuous case. Analogously, ν K (0→L/2) = ν K (L/2→L) = L 2 8T , and generally, if |x − y| = δ, then ν K (x→y) = δ 2 2T . The derived semidistances scale similarly. Note that the semidistances converge to zero as T → ∞.

Discrete Time and Space
If we are given a finite number I of equispaced trajectories of this system sampled at the same times as in the previous paragraph, the virtual random walker cannot make arbitrarily small jumps as in the continuous state case, thus since we can take x k ≈ L/K with error O(I −1 ) as I grows. However, if K > I , the smallest jumps are x k = L I , thus Thus, if the observation time of trajectories grows and they are still observed at the same rate (i.e., τ stays constant), the semidistances saturate at L 2 I τ and do not converge to zero as in the continuous time case. Moreover, to reach y = L/2 from x = 0, we still cannot make smaller jumps than x = L I , but now we only require only I /2 of them, such that we obtain ν K (0→L/2) = ν K (L/2→L) = I 2 · (L/I ) 2 τ = L 2 4I τ (for even I , and vanishing error for odd I as I grows).
The main lesson is that while in the continuous space case halving the Euclidean distance makes the semidistance scale by 1 4 , if the spatial resolution of trajectories is coarse, the discrete semidistance scales only by 1 2 . In general, if |x − y| = δ, then on a coarse resolution grid it takes about δ x jumps to travel between these two points, and we obtain ν Note that x and τ are constant quantities, and thus the one-way discrete cost scales linearly in the Euclidean distance between the two points, as opposed to quadratic scaling in the continuous space case.

Coherence Analysis with Semidistances
Let us assume that we are given a set of discrete time and space trajectories {x ( j) k } j=1,...,I,k=0,...,K , and a (semi)distance d. We now describe how such semidistances can be used to distinguish and analyze coherent sets from the finite data. We shall work with an unspecified semidistance d, but of course the semidistances that we have in mind are ν cross K and ν meet K that we derived in the previous section. Other-not large-deviation based-distance measures could be used just as well, as we discuss below. Nevertheless, the semidistances should not be completely arbitrary; we assume that they share the behavior of ν meet K and ν cross K that we discuss in Sects. 4.1 and 4.2. To illustrate the ideas, we first analyze the behavior of two one-dimensional prototypical examples. These examples show the difference between two types of regions: "mixing" and "static" (also known as "regular"). In these one-dimensional and simple examples, one can easily determine the regions and whether they are mixing or static from the semidistances. One example has two invariant sets under the dynamics, which is (measure-theoretically and topologically) mixing on both of them. The other has two static regions, where the mutual physical distance of trajectories does not change under the dynamics, and these regions are separated by a third, mixing region.
After this we proceed with a more involved model: a two-dimensional periodically forced double-gyre flow, where the boundaries of the separate regions are no longer as clear-cut as in the one-dimensional example. Nevertheless, we will show that one can identify the separate regions via the tools that we present next.
To this end, we introduce the notion of cornerstones, representing possible coherent sets or mixing regions, and then discuss how to find them and when to stop searching for them. Finally, to obtain coherent sets, we assign the trajectories to cornerstones. The notion of fuzzy affiliations will be used to express the uncertainty whether a trajectory close to the boundary of a set belongs to it or not. Note that in the case of finite data such an uncertainty is always present.

Two Illustrative Model Cases
Two Invariant, Mixing Subdomains As mentioned in Sect. 3.5, we may also apply the techniques developed in this paper to a discrete-time dynamical system. To gain some intuition for the behavior of the semidistances at mixing regions, we consider the discrete-time system on the unit interval X = [0, 1] and one-step flow map, see The sets X 1 = [0, 1 2 ], X 2 = ( 1 2 , 1] are invariant, i.e., φ −1 (X 1 ) = X 1 and φ −1 (X 2 ) = X 2 , and φ is simply the circle-quadrupling map on each of these sets, i.e., it is mixing on the single components. Consequently, 5 for (Lebesgue-)almost every pair x, y ∈ X i , i = 1, 2.  Fig. 6 Two trajectories of the map φ of length 200 steps, starting in X 1 and X 2 , respectively. Theory shows that they come arbitrary close, eventually. Here they get the closest at time step 193, shown by a circle Thus, ν K (i→ j) → 0 as K → ∞, because if x i , x j are both in X 1 or both in X 2 , then (22) shows that their trajectories get arbitrarily close eventually. If the trajectories start in different halves of [0, 1], then 6 lim inf thus the jump from one trajectory to another gets arbitrarily cheap. See Fig. 6. The transport semidistances between any two points within the same region are very small, at least if the time window is large enough. This behavior is typical for mixing regions. In fact, since the two mixing regions are only separated by one point, it is relatively cheap to move from one region to the other, and so the semidistances between two points in separate regions converge with increasing time to zero. Nevertheless, the semidistances still detect a difference between the two invariant sets: The semidistance between two trajectories in the same invariant component goes in general quicker to zero than the one between two from different components, as shown in Fig. 7 for I = 100 initially equispaced trajectories. Thus, it is the relative difference between the semidistances that is relevant for the transport structure of the state space, and not the absolute values.

Two Static Regions Divided by a Mixing One
To gain some intuition about static regions, let us now consider the discrete-time system on X = [0, 1] given by see Fig. 5 (right). This map has three invariant sets. The left and right ones are static, such that the mapping restricted to them is the identity, and are meant to model regions 6 Applying Footnote 5 to the case where ψ = φ| (0,1/2) , we obtain that (φ| (0,1/2) × φ| (0,1/2) ) t (x, y) enters A = {(x, y) | |x −1/2|+|y| < ε} eventually. Noting that φ| (1/2,1) = φ| (0,1/2) (·− 1 2 )+ 1 2 , the claim follows. Comparing the different slopes in Fig. 7, based on the reasoning in Footnote 5 and here we conjecture that the minimal distance of two trajectories decays faster in the case when they both start in the same invariant set, because the set {(x, y) | |x − y| < ε} is larger in measure than {(x, y) | |x − 1/2| + |y| < ε}. Semidistances ν cross K (i→ j) (left) and ν meet K (i, j) (right) for increasing maximal time K , averaged over x i , x j ∈ X 1 (downward-pointing triangles), x i , x j ∈ X 2 (upward-pointing triangles), and x i , ∈ X 1 , x j ∈ X 2 (circles), respectively. Note that the decrease in the distance is much slower for trajectories taken from different invariant sets Fig. 8 One-way cost ν K (i→ j) for i = 1 (left) and i = 51 (right) for the map with two static and one mixing region of the state space in complicated flows that are "static" in the sense that the mutual distance of points is not changed (or just barely) by the dynamics. We will consider these as one kind of prototype for coherent sets. The third region is mixing and physically separates the other two.
We take I = 100 initially equispaced trajectories and compute the one-way costs ν K (i→·) with K = 50 for i = 1 and i = 51, respectively, shown in Fig. 8.
From our analysis in Sect. 3.7, we would have expected to see quadratic growth of the one-way cost with respect to physical distance in the static regions, but we only observe linear growth. This is due to the finite number of considered trajectories, as also explained in the second paragraph of Sect. 3.7. All points of the mixing region have almost the same cost from any one point in the static regions, and approximately zero cost from one another. To obtain the cost between two points of different static regions, one has to consider the cost to go to the boundary of the static and mixing regions (linear cost in Euclidean distance), travel on a trajectory from there to the boundary of the other static region (at zero cost), and then go from there to the desired Fig. 9 Sketch of the velocity field of the periodically forced double-gyre flow at two different times. The horizontal axis is x 1 , and the vertical is x 2 point. (Again, linear cost in Euclidean distance that needs to be covered.) Thus, the cost (and semidistance) between these two points is the sum of their one-way cost (and semidistance) to the mixing region, provided the time of consideration is sufficiently large for the mixing to take place. 7 Since our fictive random walker uses trajectories of the mixing region to travel from one static region to the other, we will also call it transition region henceforth.
To conclude, from Fig. 8 we can easily identify three separate regions, and from the steepness of the slopes (linear/quadratic or flat), we can determine wether a region is static or mixing. As the next example shows, this distinction is usually not as clear as in these constructed examples, but the main ideas will be based on this observation.

The Periodically Forced Double Gyre
Let us now consider the non-autonomous systemẋ t = v(t, x t ) on X = [0, 2] × [0, 1] with (Froyland and Padberg-Gehle 2014) where f (t, z) = β sin(ωt)z 2 + (1 − 2β sin(ωt))z. We fix the parameter values A = 0.25, β = 0.25 and ω = 2π ; hence, the vector field has time period 1. The system preserves the Lebesgue measure on X . Equation (24) describes two counter-rotating gyres next to each other (the left one rotates clockwise), with the vertical boundary between the gyres oscillating periodically, see Fig. 9. We choose a uniform 50 × 25 grid as initial conditions for the floaters at time t = 0; i.e., I = 1250. We sample the trajectories of these floaters at times t k = kτ , k = 0, 1, . . . , K , where K = 100 and τ = 0.2. That means, the length of trajectories in consideration is 20 times the period of the forcing.
Employing our large-deviation-based distance computations on this data set using Algorithm 1 and α = 1/2, we get the one-way costs ν K (i→ j), i, j = 1, . . . , I , from which we compute ν cross K (i, j) and ν meet K (i, j). As a first simple analysis, we can order the points by their semidistances to the center of one gyre, see Fig. 10. Here and in the following, the rates and semidistances will be always given in units 1/τ . On a log-log scale, the slope 1/2 (square-root-type behavior) indicates that most trajectories in the gyre are approximately concentric circular regions around the center. 8 Since the semidistances grow linearly in the Euclidean distance inside the gyre, we see that we are in the low-resolution regime discussed in Sect. 3.7. Analogously to Fig. 8, we can again (vaguely) distinguish three regions: a steep (square-root-type) region, a flat region, and another steep (flipped square-roottype) region. As before, the flat region is typically strongly mixing, and the steep regions are static. We shall make this distinction more precise in the next sections.
Remark 4.1 (Three-dimensional flows) Clearly, the scaling behavior shown in Figs. 8 and 10is dimension-dependent. For a three-dimensional static region, one would see a slope 1/3 on a log-log scale. The question remains, how does a typical coherent set behave there; can it be modeled by a static region? If an incompressible flow rotates uniformly in a plane, it necessarily has a constant shifting motion in the perpendicular axial direction, leading to cylindrical vortices. If the cylindrical rings of a vortex rotate at different angular frequencies, the flow speed along axial directions is non-uniform, and mixing-type behavior occurs in the vortex (Halász et al. 2007). We leave the analysis of such systems to future work and proceed with analyzing different aspects of prototypical two-dimensional flows here.

Cornerstones
To start the analysis of the state space under a semidistance d, we randomly choose a trajectory, represented by a label c 0 ∈ {1, . . . , I }, and compute the trajectory furthest from it, i.e, we set To find a set of points that "spans" the state space, we identify successively further trajectories that are far away from all the other already identified "cornerstones" {c q } q=1,...,Q , as in Rüdrich et al. (2017): Observe that in this optimization problem we ignore the first, randomly chosen trajectory c 0 ; hence, the set of cornerstones {c q } q=1,...,Q will be less dependent on this randomness. Moreover, even if the first trajectory c 0 would represent a coherent set, the algorithm will eventually provide a new cornerstone in that set, which lies closer to the semidistance center of that set. For the double gyre and the meeting distance, we identified three cornerstones. The objective function of the maximization problem (25) is plotted in Fig. 11; this yields a similar but more detailed picture as Fig. 10. Note that the chaotic, well-mixed transition region appears as flat region in these distance graphs, and the gyres appear as steep regions toward the maxima of the respective graphs. That the chaotic region is well mixed, and has no stratification (invariant rings as the gyres), can be seen from its flat behavior toward its maximum. The forth cornerstone is part of a gyre, and it starts to stratify it. Nevertheless, its distance to the other corners is much smaller.
To get a first glimpse of the separate regions in the state space, we have plotted the semidistances from each cornerstone in Fig. 12, both at the initial and final times. Note that since we work with trajectory labels rather than physical positions, the semidistances are invariant in time, whereas the physical positions of the floaters change over time. From these figures, one can approximately identify the two static

Number of Cornerstones
How to determine the number of cornerstones that should be used? Is there an optimal number, or is it up to our liking? In the case of the double gyre, as noted above, a fourth cornerstone would be part of one of the gyres, and assigning affiliations would thus split one gyre into two sets. If the gyres would consist of a continuum of periodic orbits, then we could proceed and split them this way into as many rings as we like. The same situation in an idealized framework appears in Sect. 4.1 for the static regions: since they are static, arbitrary subsets are perfectly coherent (even invariant in this case).
A good place to stop searching for further cornerstones would be when they would start to subdivide "maximal coherent" sets, as the gyres in the double-gyre example, or the static sets in the second, and the invariant sets in the first example of Sect. 4.1. To this end we make an idealized assumption: Coherent sets appear as for the second example in Sect. 4.1, i.e., multiple static regions divided by one mixing region. Here, "static" is meant in the sense that the mutual distances between points in the set barely change. Such an assumption was also utilized in (Hadjighasem et al. 2016).  Fig. 13 The trajectories closest in terms of ν meet K to one of the cornerstones than to the others. Left: initial time, right: final time. The horizontal axis is x 1 , the vertical is x 2 Note that if there are C ≥ 2 coherent sets, the first C corner stones are going to be in them, one in each. This is due to the fact that to move from the center of one static region to another, the shortest path in (20) needs to move out of one set, travel in the transition region to the other set, and move to its center, hence maximizing the minimal distance to all other cornerstones. After finding all static regions, the next cornerstone is to be found in the transition region, if all static regions are approximately of the same size-which we assume here. The crucial observation is that this (C + 1)-st cornerstone is half as far from the other cornerstones, 9 as they are from one another.
To summarize, our simple check when to stop searching for cornerstones is going to be, when the value of the objective function in (25) drops by at least a factor two compared with the previous value. Observe how nicely this works in the periodically forced double-gyre case: the rightmost points of the curves in Fig. 11 are the optimizers, and the corresponding value of the yellow curve is less than half of the values for the first two cornerstones. This indicates to stop with three cornerstones, as they will represent both the gyres and the transition region.

Clustering and Fuzzy Affiliations
To get an even more crisp picture of the subdivision of the state space into regions which are far away in terms of the semidistance d, we assign to each cornerstone c 1 , c 2 , c 3 the trajectories that are closer to them than to the two other cornerstones, respectively. For the periodically forced double gyre and the meeting distance this is shown in Fig. 13.
Comparing this picture with the typical trajectories of the time-1 Poincaré map of the system [again, see Froyland and Padberg-Gehle 2014, Figure 1], it appears that the gyre regions in our figure are smaller. This is due to the nature of the transport distance at hand: the gyres are partly made up of so-called regular regions of the Poincaré map, meaning that typical trajectories move on periodic orbits that are approximately concentric circular lines. Transport between these trajectories is only possible through diffusion, and the price one has to pay for this transport in radial direction is reflected by the rate function (recall, this is what we model by the static regions in Sect. 4.1). The  Fig. 14 Fuzzy affiliations q c i (·) of the trajectories to the three cornerstones, c 1 , c 2 , c 3 (from left to right) for fuzziness exponent m = 2, shown at initial time. The horizontal axis is x 1 , the vertical is x 2 cost to get from the center of the gyre (the cornerstone c 1 or c 2 ) to a regular trajectory in the same gyre is proportional to the "radial distance" between them (compare with the static part of the second example in Sect. 4.1). This behavior is not characteristic for the well-mixed transition region, because there the dynamics (eventually) brings any two trajectories close to each other. The effect is most prominent if the time frame of consideration grows infinitely large, and on our finite time horizon it appears as a flattening of the curve. This brings us back to why the blue and green regions in Fig. 13 are smaller than gyres in the Poincaré map. The answer is simply, because the outer periodic orbits are closer to the transition region than to the center of the gyre, hence also closer to the cornerstone c 3 that is in the transition region, because the points in the transition region have very small distance from one another.
Instead of a hard clustering we can assign the trajectories to the cornerstones by fuzzy affiliations q c i (·), to obtain more refined information on coherence. For instance, let m > 1, and minimizing the affiliation-weighted penalty function subject to the constraints 0 ≤ q c i for i = 1, . . . , and i=1 q c i ( j) = 1 for every j = 1, . . . , I , yields This is the affiliation function in the fuzzy c-means algorithm (Bezdek 1981), giving q c i ( j) = 1 ⇔ d(c i , j) = 0, i.e., affiliation is maximal if the distance is minimal. Further, the parameter m controls the fuzziness of the clustering: large m gives soft clusters, while m approaching 1 gives more and more "crisp" clusters as the affiliations converge either to 0 or to 1 (Bezdek et al. 1987). The resulting affiliations (indicated at initial time) for m = 2 are shown in Fig. 14. For m close to 1 we obtain affiliations very similar to the hard clusters in Fig. 13.
this section we apply these tools to two other well-analyzed test cases: the perturbed Bickley Jet and the rotating (transitory) double gyre. They are different paradigmatic examples, as the Bickley Jet has a non-vortex coherent set (the jet core), and the transitory double gyre is not a periodically forced system, thus genuinely living on a finite time interval.
Let us also point out that the examples presented here and in the previous section are all one-or two-dimensional. Although we expect the analysis in higher dimensions to be at least qualitatively not very different from the two-dimensional case, dealing with the nevertheless arising subtle differences (see Remark 4.1) is beyond the scope of this conceptual work.
It turns out that the choice between the two semidistances ν cross K or ν meet K has only marginal influence on the results. In this section we shall mostly work with the crosssemidistance.

The Bickley Jet
We consider a perturbed Bickley Jet as described in Rypina et al. (2007). This is an idealized zonal jet approximation in a band around a fixed latitude, assuming incompressibility, on which three traveling Rossby waves are superimposed, see Fig. 15. The dynamics is given byẋ The constants are chosen as in Rypina et al. (2007, Section 4) . In particular, we set k n = 2n/r e with r e = 6.371, U 0 = 5.414, and L = 1.77. The phase speeds c n of the Rossby waves are c 1 = 0.1446U 0 , c 2 = 0.205U 0 , c 3 = 0.461U 0 , their amplitudes A 1 = 0.0075, A 2 = 0.15, and A 3 = 0.3, as in Hadjighasem et al. (2016). The system is considered on a state space X = [0, πr e ] × [−3, 3] which is periodic in the horizontal x 1 coordinate.
We choose a uniform 60 × 18 grid as initial conditions for the floaters at time t = 0; i.e., I = 1080. We sample the trajectories of these floaters at times t k = kτ , k = 0, 1, . . . , K , where K = 80 and τ = 0.5. In this time interval, typical trajectories cross the cylindrical state space horizontally 4-5 times, trajectories in the jet core (the wavy structure in Fig. 15) up to 9 times.
Employing our large-deviation-based distance computations on this data set using Algorithm 1 and α = 1/2, we get the rates ν K (i→ j), i, j = 1, . . . , I . From these Fig. 15 Sketch of the Bickley Jet flow field at two different times. The flow pattern travels from left to right on the horizontally periodic domain. The horizontal axis is x 1 , the vertical is x 2 rates we readily obtain the ν cross We repeat the cornerstone finding analysis from the previous section. The optimal values of the objective function in the cornerstone finding problem (25) are for 8 cornerstones, in order: 2. 06, 3.21, 2.45, 2.33, 2.30, 2.14, 1.42, 0.70. Recall that the first value is with respect to a random cornerstone c 0 that we discard. These numerical values with our previous analysis shed light on the topological structure of the state space with respect transport and mixing. Note, that our assumption from Sect. 4.4, that all coherent sets are divided by one mixing region, is not satisfied: the jet core is a coherent set itself, dividing two mixing regions (below and above it), each containing 3 further coherent sets (the gyres). Thus, c 1 and c 2 have maximal distance (ν cross K (c 1 , c 2 ) = 3.21), because the random walker needs to cross the jet core. Every further cornerstone c 3 , . . . , c 6 can be reached from either c 1 or c 2 through one of the mixing regions, and thus have a very similar cost. The deviation of these costs, 2.14-2.45, shows that we did not reach the state of full mixing on the chosen time interval. Now, the seventh cornerstone lies in the jet core, which has to be crossed if traveling between cornerstones that are below and above it, respectively. The corresponding cost (1.42) is a bit larger than half of the previous cost, because c 7 does not lie on the shortest path between cornerstones below and above the jet core. Intuitively, the "center line" of the jet core should be equally far from all cornerstones c 1 , . . . , c 6 , if the time interval is large enough such that the regions around the gyres are truly mixing. Since it is not, there are points on the boundary of the jet core which are easier to reach from them, and thus easier to cross there. The cornerstone c 7 represents the position where it is the hardest to cross. The eighth cornerstone has truly half the semidistance to the closest one than c 7 , and lies in one of the mixing regions.
We show our results for seven cornerstones. 10 The semidistances are shown in Fig. 16.
The corresponding fuzzy affiliations from (26) for m = 1.1 are shown in Fig. 17. They show a very crisp distinction of the six gyres from the rest of the state space. The bottom right figure shows the affiliation q c 7 (·) for m = 1.9, which suggests that the region around the gyres could still be partitioned into coherent sets itself: the jet core appears more strongly affiliated to this cornerstone than the other trajectories. It is not surprising that we could not see this for m = 1.1, since the closer m is to 1, the more "crisp" the affiliation function is forced to be, and the mixing region is more easily reached from the thin jet core than from the gyres. . . , c 7 , respectively (magenta circles). Bottom right: affiliation q c 7 (·) for m = 1.9, which suggests that the 7th coherent region could contain a coherent set itself: the jet core. The horizontal axis is x 1 , the vertical is x 2 (Color figure online) Fig. 18 Sketch of the flow field of the rotating double gyre at initial (left) and final (right) times. The horizontal axis is x 1 , the vertical is x 2

The Rotating Double Gyre
Let us consider a prototype for a system, where transport is considered only on a limited time interval. The rotating double-gyre system (Mosovsky and Meiss 2011) is given by the stream function ψ(t, x 1 , and is considered on the state space X = [0, 1] 2 and time interval t ∈ [0, 1]. The two gyres, which initially occupy the left and right halves of the unit square, turn during this time by π/2 to occupy the top and bottom halves at final time, see Fig. 18. We choose a uniform 30 × 30 grid as initial conditions for the floaters at time t = 0; i.e., I = 900. We sample the trajectories of these floaters at times t k = kτ , k = 0, 1, . . . , K , where K = 100 and τ = 0.01. We employ the cross-semidistance, and start our cornerstone search. The first three values of the optimization problem (25) are 0.0274, 0.0474, 0.0262.
We identify the significant drop after two corner stones, hence we expect two coherent sets with one mixing region dividing them. The drop in the distance is by a factor 0.55, which is not below one half, the reason for this being again that the time interval of consideration is not sufficient for perfect mixing of the transition region.
The semidistances from the three identified cores and the affiliations to these cores for exponent m = 1.2 are shown in Figs. 19 and 20, respectively. Although both ν cross and ν meet have been shown to be able to detect coherent sets, we demonstrate their different nature by showing the shortest paths in the respective distance in Fig. 21.
Finally, we demonstrate the approach for a scattered set of sparse data points, taking 400 initial points randomly distributed in X , and repeating the analysis for their trajectories. We show the resulting fuzzy affiliations in Fig. 22. 6 Discussion and Outlook 6.1 The Dynamic Laplacian Froyland (2015) has introduced the dynamic Laplacian as a transport-related tool to find coherent sets. Similarly to our approach, it makes use of a small random perturbation of size ε, then ε is driven to zero.

Fig. 22
The rotating double gyre with randomly chosen 400 initial points. The fuzzy affiliations computed with m = 1.2 to the cornerstones c 1 (top) and c 2 (bottom), at times t = 0, 0.5, 1, from left to right, respectively. The horizontal axis is x 1 , the vertical is x 2 Numerical methods so far discretize directly the dynamic Laplacian (Froyland and Junge 2015;Banisch and Koltai 2017;Froyland and Junge 2017). In light of our analysis, which can be used both ways (derive the large-deviation principle in continuous space, then discretize it to finite trajectories, cf. Sect. 3.6, or discretize the dynamics to finite trajectories, then derive the large-deviation principle on them, cf. Sect. 3.3), we ask whether there is a discrete dynamic Laplacian that can be derived from a discretization of the perturbed dynamics?
Mimicking the construction in Froyland (2015) and sketching the idea while skipping details, one should construct a discrete, ε-dependent transfer operator T ε ∈ R I ×I , that represents transition probabilities of a forward-backward process, then obtain a discrete dynamic Laplace operator L dyn := d dε ε=0 T ε . A discrete transfer operator T ε that is a consistent approximation of the continuous dynamics can be obtained by a construction as in Sect. 3.2, by using the transition probabilities (17). Technical details aside, we see that the probabilities are linear combinations of terms of the form e − x/ε , where x here is a formal distance term that appears in the formulas. Differentiation with respect to ε immediately yields that all off-diagonal entries (basically, where x > 0) of L dyn are zero, in fact the matrix is the identity.
Thus, this approach of discretizing the dynamics first, and then factoring out the ε-small stochastic perturbation does not give a dynamically meaningful result. In analytic terms the very same problem occurred in a different attempt to introduce a discrete dynamic Laplacian from a discrete transfer operator, see (Banisch and Koltai 2017, Section IV) . In general, it would be desirable to understand when and how can the "first discretize, then factor out ε" methods work, such that they can complement the methods that directly discretize the (continuous) dynamic Laplace operator.

Other Distance Measures
The time-dependent shortest path problem used to compute our semidistances is computationally demanding in our current algorithmic realization, which theoretically limits the number of trajectories that can be handled. Moreover, they do not satisfy the triangle inequality, hence they are not a metric. Although numerical efficiency is not the main focus of this paper, and we demonstrated the usefulness of our semidistances in unraveling the underlying dynamical structure of the example systems, a more cheaply computable metric would enhance the utility and significance of the analysis methods presented here.
Ultimately, one would like to understand the intrinsic, possibly low-dimensional geometric organization of the state space with respect to transport and mixing, as pioneered in Banisch and Koltai (2017). Employing proper metrics would allow, e.g., the usage of low-dimensional embedding techniques, such as multidimensional scaling, to represent and better understand this geometric organization. One canonical candidate would be the metric structure related to the dynamic Laplacian, considered in Karrasch and Keller (2016). This will be subject of future studies.
To summarize, although other distance measures could be used to analyze complicated dynamic behavior, we showed that the semidistances we derived in this paper from the physical notion of transport and mixing in the vanishing diffusion setting are natural and effective diagnostic tools.
In this appendix we explore the conditions (3) in the large-deviation regime. The argument is based on the Laplace Principle, which states that for any measure ρ and function f : As in (9), where, contrary to (9), the symbol y now denotes a position at time T , that is, μ T (x→x) = λ T (x→φ 0,T [x]) = λ T (x→y). Fix an ε-independent initial probability measure ρ 0 (dx) = P[x 0 ∈ dx]. For the large deviations of the forward condition in (3), it follows from the Laplace principle that Observe that since the initial distribution ρ 0 is independent of ε, it only appears in the large deviations through its support supp ρ 0 .
The large deviations of the backward conditions in (3) can be calculated analogously, but now the conditioning does depend on ε. By Bayes' rule, the rate function of the backward condition is If we assume that that there is at least one admissible path x (·) that starts in supp ρ 0 and ends in B, then in fact J fw T (B|X ) = 0, and so J fw T (B|A) = J bw T (A|B). These calculations have two important implications. First, observe that while the forward and backward probabilities P[x (ε) T ∈ B | x 0 ∈ A] and P[x 0 ∈ A | x (ε) T ∈ B] are not equal in general, the forward and backward rate functions are. The same argument even holds if we shrink the sets A ad B down to single points x and y; in that case we obtain for the "backward rates" that λ T (x←y) := lim ε→0 −ε log P x 0 x | x (ε) T = y = λ T (x→y) , cf. Remark 2.1. Apparently, in the large-deviation scaling it does not matter whether we consider the forward or the backward process. Since the forward condition J fw T (B|A) ≈ 0 in itself does not hold enough information to characterize coherence and the backward condition J bw T (A|B) ≈ 0 does not add information, these conditions are not helpful to characterize coherence.
Secondly, we see that J fw T (B|A) = 0 as soon as φ 0,T [A ∩ supp ρ 0 ] ∩ B = ∅. Naturally, there are many such pairs A, B, and the set function J fw T does not give any quantitative information about which pairs are more coherent than others. Because of this, the large deviations of the forward and backward conditions (3) are even less useful to identify coherent sets.
We start to gain useful information about coherence, if there are at least two coherent pairs, say A 1 , B 1 and A 2 , B 2 . Then the rates J fw T (B 2 |A 1 ) and J fw T (B 1 |A 2 ) are in general large, since coherence of the respective set pairs dictate that it is very unlikely to encounter paths from pair #1 to pair #2. Using these rates as measures of farness is one idea this paper exploits.

B Algorithm: Shortest Path in Time-Dependent Graphs
Since we could not find an algorithm suited to our purpose, 11 we describe in this appendix a solution we came up with to solve the problem of finding shortest paths in a graph with time-dependent nonnegative edge weights. Transition is only possible between nodes that are connected by an edge of positive weight.
There are several solutions to the shortest path problem for time-independent graphs, such as Dijkstra's algorithm (Dijkstra 1959) or the Floyd-Warshall algorithm (Floyd 1962). Each of them use in some sense a "monotonicity" argument, namely, that sub-paths of shortest paths are shortest paths themselves. This does not hold for time-dependent graphs, because at every step that we make the environment might change completely, and the number of steps we can make is limited by the number of time instances of the graph.
We propose the following algorithm to compute shortest paths from a specific node s to all other nodes. Note that we can stay in a node for any time at zero cost. The weight of the transition i → j at time t is denoted by w t (i → j).
Algorithm 1 Shortest distance in time-dependent graphs 1: R old = {s}, R new = ∅ (reached states at times 0 and 1) 2: dist(s) = 0, dist(i) = ∞ for i = s 3: for t = 1, . . . , T do 4: while R old = ∅ do 5: v = arg max i∈R old dist(i) 6: R old ← R old \ {v} 7: for j : w t (v → j) < ∞ do 8: if dist(v) + w t (v → j) < dist( j) then 9: dist( j) = dist(v) + w t (v → j) 10: R new ← R new ∪ { j} 11: It is important to have the max on line 5, since if we does not start the update procedure at the node which has the maximal distance, then we might erroneously cut off nodes that could still be reached from it.
Algorithm 1 can clearly be extended to keep track of the shortest path as well. The distance of a node j is updated to a smaller one, whenever there is a path through some other node v that is shorter than the previous one (line 10). Hence, the new candidate shortest path is the one leading to v and then jumping to j in the current time step. This is implemented in Algorithm 2 (line 12). Herein, path(i→ j) is the shortest path from node i to node j, such that path t (i→ j) is the node the walker resides in at time t = 0, 1, . . . , T while going through the shortest path, and path 0 (i→ j) = i. If there is no path from i to j, then path(i→ j) is the zero vector. We use 1 : k to denote the index set 1, 2, . . . , k.