Locally Correct Interleavings Between Merge Trees
Abstract
Merge trees are typically used as a topological summary of scalar fields. To analyze e.g. a time-varying scalar field via its merge tree representation, one needs a suitable method to match and compare two merge trees. We consider the interleaving distance as a method to match and compare merge trees. An interleaving between two merge trees consists of two maps, one in each direction. These maps must satisfy ancestor relations and hence introduce a “shift” between points and their image. An optimal interleaving minimizes the maximum shift; the interleaving distance is the value of this shift. However, to study the evolution of merge trees, we need not only a number but also a meaningful matching between the two trees. The two maps of an optimal interleaving induce a matching, but due to the bottleneck nature of the interleaving distance, this matching fails to capture local similarities between the trees. In this paper we hence propose a notion of local optimality for interleavings. To do so, we define the residual interleaving distance, a generalization of the interleaving distance that allows additional constraints on the maps. This allows us to define locally correct interleavings, which use a range of shifts across the two merge trees that reflect the local similarity well. We give a constructive proof that a locally correct interleaving always exists.
Keywords and phrases:
Interleaving distance, merge trees, local correctness, matchings, topological data analysisFunding:
Thijs Beurskens: Supported by the Dutch Research Council (NWO) under project no. OCENW.M20.089.Copyright and License:
2012 ACM Subject Classification:
Theory of computation Computational geometryEditors:
Hee-Kap Ahn, Michael Hoffmann, and Amir NayyeriSeries and Publisher:
Leibniz International Proceedings in Informatics, Schloss Dagstuhl – Leibniz-Zentrum für Informatik
1 Introduction
Terrains that vary over time are a common data type in various application areas, such as scientific computing or geographic information science. Typically such data sets are very large; to analyze them efficiently one often needs a compact abstraction that captures salient features. Topological data analysis (TDA) provides several topological descriptors, such as persistence diagrams, Reeb graphs, and Morse-Smale complexes, that can serve as abstractions for 2D, 3D, or higher-dimensional terrains. In this paper we focus in particular on merge trees, which are graph-based descriptors that encode the evolution of connected components of sublevel or superlevel sets of a terrain (see Figure 1). In the context of time-varying terrains, they have been used for feature tracking [7], cluster detection [16], and various other tasks in scientific visualization [17].
To analyze temporal sequences of terrains one does not only need a compact representation, but also efficient ways to compare these representations over time. For merge trees in particular, several distance measures have been proposed, including the (local) edit distance [13, 14], the Wasserstein distance [11], and the interleaving distance [8]. However, a distance measure returns only a numeric value that quantifies the similarity of two merge trees and . In many application scenarios, we would also like to track the merge trees over time and hence need to understand which parts of most closely correspond to parts of . That is, we are interested in a matching between and .
The interleaving distance in fact relies on a type of matching between the two trees: the so-called interleaving. An interleaving is a pair of ancestor-preserving maps, one from to and one from to , whose compositions send points to ancestors: if a point of is mapped to a point of , then must be mapped to an ancestor of , and vice versa. The interleaving distance is the maximum shift – the distance between a point and its image – minimized over all interleavings between the trees. We give exact definitions of the interleaving distance and interleavings in Sections 2 and 3.
Two merge trees typically admit many optimal interleavings. The interleaving distance is a bottleneck measure and hence a given optimal interleaving might be locally quite “loose”: the shift might exceed what is needed and thereby fail to capture local similarities between the trees; see Figure 2. In the following we are hence developing a notion of locally optimal interleavings which allows us to distinguish between “tight” and “loose” optimal interleavings.
Contributions.
Our work is inspired by the concept of locally correct Fréchet matchings [3]; the Fréchet distance is a bottleneck measure for curves based on a matching between points on the curves. A locally correct Fréchet matching is then an optimal matching that remains optimal even when considering any two matched subcurves. This is a desirable feature, however, it cannot be directly reproduced for the interleaving distance. First of all, there might not even be a one-to-one correspondence between the points of and . Furthermore, two optimal interleavings between different pairs of subtrees do not necessarily combine into an optimal interleaving between the two complete trees. As a first step we hence introduce a novel generalization of the interleaving distance that can handle additional constraints on the maps. Specifically, we aim to use constraints that force a point to be mapped to an ancestor of a particular point within the other tree. Over interleavings that satisfy such constraints, we aim to minimize the maximum shift over points that are either unconstrained or map to a strict ancestor of their corresponding point . We refer to the resulting distance as the residual interleaving distance. In Section 3, we provide formal definitions and show that an optimal interleaving exists for any constraints.
In Section 4 we then propose a definition for locally correct interleavings that builds upon the residual interleaving distance. Specifically, we define a restriction of an interleaving to two subsets of and of as the restriction of to together with the restriction of to . We call locally correct if it minimizes the residual interleaving distance with respect to any restriction of . We constructively prove that a locally correct interleaving always exists. All omitted proofs can be found in the full version.
Related work.
The interleaving distance between merge trees was defined by Morozov, Beketayev, and Weber [8] as a tool to study the stability of merge trees. The authors of [1] establish a connection between the interleaving distance and the Gromov-Hausdorff distance, and they argue that approximating the interleaving distance within a factor of is NP-hard. They also describe an -approximation algorithm, where is the total size of the trees and is the ratio of the longest to the shortest edge. Touli and Wang [15] provide an equivalent definition of the interleaving distance in terms of a single map and use this characterization to design an FPT-algorithm for computing the interleaving distance exactly. More recently, the authors of [6] show that the interleaving distance can be formulated in terms of a related metric [9] for labeled merge trees, also known as phylogenetic trees.
Several attempts have been made to develop versions of the interleaving distance that can be used in practical applications. In particular, the results in [6] gave rise to heuristic algorithms for computing the interleaving distance [4] and for comparing terrains [16, 18]. Pegoraro [10] uses yet another reformulation of the interleaving distance, in terms of couplings, as the basis of a heuristic for computing the distance via linear integer programming. Lastly, the authors of [2] introduce a variant of the interleaving distance that imposes total orders on the merge trees, which can be computed efficiently via a connection to the Fréchet distance between one-dimensional curves.
2 Preliminaries
Let be a rooted tree, that is, a tree with one vertex identified as the root. In the remainder of this paper, we identify with a topological realization: we represent each edge of by a unit segment and connect these segments according to the adjacencies of their corresponding edges in . We distinguish elements of the topological realization , which we refer to as points of , from vertices of the combinatorial tree, which we denote by . A merge tree is a pair , where is a finite rooted tree, and is a continuous height function on that is strictly increasing towards the root and such that the root has height . When clear from context, we use to refer to the pair .
For two points and of , we say is a descendant of , written , if there exists an -monotonically increasing path in from to . If furthermore then is a strict descendant of . We say is a (strict) ancestor of if is a (strict) descendant of . Lastly, for a point and a height value , we use to denote the unique ancestor of at height (see Figure 3a).
Compatible maps.
The original definition of the interleaving distance between two merge trees and was given by Morozov, Beketayev, and Weber [8].
Critical values.
3 Generalizing the interleaving distance
The interleaving distance is based on a pair of maps. As noted in [1], we can relax the requirements on these maps to allow varying height differences between points and their images. Building on this relaxed definition, we introduce a generalized version of the interleaving distance that accommodates constraints on the maps we consider. Specifically, each constraint specifies that a point must be mapped to an ancestor of a particular point within the other tree. Our goal is then to find the optimal pair of maps that “extends” a given set of constraints. We call the corresponding distance the residual interleaving distance. To define it formally, we first introduce partial up-maps, which represent the allowed maps between the two merge trees. In Section 3.1 we relax Definition 1 using partial up-maps. In Section 3.2 we then give the formal definition of the residual interleaving distance.
Partial up-maps.
Let and be two merge trees. An arrow from to is any pair of points such that . The shift of an arrow is the height difference between and , denoted . Consider a subset of points . A map is a partial up-map from to if (i) for all points of and (ii) it preserves ancestors, that is, implies for all points of . We use to denote the domain of . For each point of , the pair is an arrow. The graph of is the set of arrows of , denoted . We define the shift of the partial up-map as the supremum shift over all arrows of :
| (2) |
Given an arrow from to , we say extends if , and we say uses if . Similarly, for a subset and a partial up-map from to , we say extends or uses if, respectively, extends or uses all arrows of (Figure 4a).
For any , we can define a partial up-map from to that extends and such that the shift of each arrow is at least . Specifically, for each point of , let and define (see Figure 4b).
Lemma 3.
For any , the map is a partial up-map that extends .
Proof.
Let . By construction, we have . To see that preserves ancestors, take two points of such that is an ancestor of . Since preserves ancestors, is an ancestor of . If , we get . Otherwise is a strict ancestor of . By construction, . Both and are ancestors of , so is an ancestor of . So is a partial up-map, and by construction also extends . We define arrows and up-maps from a subset of to symmetrically.
Partial interleavings.
Fix two subsets and . A partial interleaving between and is a pair of partial up-maps and such that for all points of and all points of it holds that if then , and if then (Figure 4c). The shift of , denoted , is the maximum of the shift of and the shift of . The graph of is the union of the graph of and the graph of , denoted . Given another partial interleaving , we say extends if extends and extends . Similarly, uses if uses and uses .
Lemma 4.
For any , the pair is a partial interleaving that extends .
Proof.
Denote and . By Lemma 3, the maps and are partial up-maps that extend and , respectively. Therefore, it suffices to show that the pair is a partial interleaving. Let be a point of and be a point of such that . By construction, the point is an ancestor of , so is also an ancestor of . Since is a partial interleaving, the point must be an ancestor of . As is an ancestor of , we get . Symmetrically, if then .
3.1 Complete Interleavings
If , we call a partial up-map a complete up-map, or simply an up-map, from to . Symmetrically, if , we call a partial up-map a (complete) up-map from to . Correspondingly, if and , we call the partial interleaving a (complete) interleaving. The defining property for a complete interleaving then becomes that for all it holds that and for all it holds that .
Lemma 5.
.
Optimal interleavings.
The interleaving distance is defined as an infimum, but in both [5, 10] the authors prove that the infimum can be replaced by a minimum: there always exists an interleaving with shift (Theorem 6). We call an interleaving that realizes the interleaving distance an optimal interleaving. Both proofs rely on alternative definitions of the interleaving distance, namely in terms of labellings [5] and in terms of couplings [10]. We can show the same statement more directly: if the shift of an interleaving is not equal to a critical value, we can obtain an interleaving whose shift is equal to a critical value. Intuitively, we “push down” each arrow of so that its shift becomes (see Figure 5). Later, in Section 3.2, we describe a formal construction to prove a generalization of Theorem 6.
Theorem 6.
Any two merge trees and admit an optimal interleaving.
3.2 Residual Interleaving Distance
Fix a partial interleaving . We refer to a (partial) interleaving that extends as a (partial) -extension. We first observe that there always exists a complete -extension. Indeed, the maps that take every point of to the root at of , and every point of to the root at of form a complete interleaving that extends .
Our goal is to find a “tightest possible” complete -extension, that is, an interleaving that extends and minimizes the shift of the remaining arrows. For some intuition, consider the example in Figure 6. The map consists of a single (dashed) arrow . Intuitively, the map describes a “tighter” extension of than the map . However, if we only disregard the shift of , the shift of the remaining arrows of is equal to the (supremum) shift of the remaining arrows of . The arrow implicitly induces a “fan” of arrows that all valid up-maps need to extend. Specifically, any ancestor of needs to be mapped to an ancestor of . To distinguish between the maps and , we therefore not only disregard the shift of , but of any arrow that is “contained” within such a fan.
Formally, we define the fan of an arrow as the set of arrows for all ancestors of with height at most that of , written,
The fan of a collection of arrows , denoted , is the union of all fans for . We refer to the fan as the fan of .
We use fans to define the -residual shift, or -shift for short. Recall that we use to denote the set of all arrows . For an arrow from to , the -residual shift of , denoted , is zero if lies within , and is otherwise. Similar to the definition of shift in Eq. 2, we define the -residual shift of an up-map , denoted , as the supremum -residual shift over all arrows of . That is,
Consider again the example in Figure 6. We disregard the shifts of all arrows within the fan . As a result, the -shift of is , whereas the -shift of is .
We define the -(residual) shift of a partial up-map symmetrically. Finally, for a partial interleaving , we define the -residual shift, or -shift, of as the maximum of the -shift of and the -shift of , denoted .
Definition 7.
The -residual interleaving distance between and is the infimum for which there exists a complete -extension whose -residual shift is .
When they are clear from context, we omit the arguments and and simply write to denote the -residual interleaving distance between and . We say an extension is optimal if its residual shift is equal to the residual interleaving distance.
Critical values and pairs.
For the remainder of this section, we consider finite partial interleavings : both and consist of finitely many points. Recall from Section 2 that the non-residual interleaving distance always attains a value in the set of critical values . For the residual interleaving distance, this set is not always sufficient (see Figure 7). Therefore, we extend to a set of -critical values. Specifically, we “mark” all vertices in and , and all points of and of that appear in an arrow or of . We call these the -critical points of and , denoted and respectively. Since is finite, there are only finitely many critical points. We define a set that contains all height differences between critical points:
We define the set of -critical values as the set , where and are as defined in Eq. (2). Each critical value corresponds to a pair of critical points; we refer to such a pair as a -critical pair. We distinguish two types; see Figure 8.
-
If for a point and a point , then is an arrow critical pair that corresponds to the critical value . We say a partial interleaving uses if . The case that is symmetric.
-
If for two vertices in , then is a zigzag critical pair that corresponds to the critical value . We say a partial interleaving uses if there is a point with such that and . The case that for two vertices in is symmetric.
Similar to Lemma 2, we show that the -residual interleaving distance always attains a value in the set of -critical values. A -critical pair is a realizing critical pair if it corresponds to the -residual interleaving distance. We can additionally show that there always exists an optimal -extension and that any such extension uses a realizing critical pair.
Lemma 8.
Let be a finite interleaving. For any complete -extension with -shift that does not use a critical pair that corresponds to , there exists another -extension whose -shift is equal to a -critical value that is strictly less than .
Proof sketch..
Consider a -extension with -shift , and assume does not use a critical pair that corresponds to . We modify into an extension whose -shift is equal to a -critical value that is strictly less than . Let be the greatest value that satisfies . Intuitively, we modify by “pushing down” each arrow (recall Figure 5). We describe the construction of ; the construction of is symmetric.
We assume, without loss of generality, that each arrow of has shift at least . Otherwise, we replace by . Since the residual shift of an arrow is bounded by its shift, and since , the -residual shift of is bounded by . For , let be the highest descendant critical point of ; if , then . Moreover, let be the highest descendant critical point of . Let . We define as the ancestor of at height , that is, .
It is not hard to prove that is an up-map that extends . To show that the -shift of is bounded by , we argue that any arrow of with shift strictly greater than must be inside the fan of . Specifically, we show that then also the shift of the arrow is strictly greater than . The pair is a critical pair; since does not use a critical pair that corresponds to , it moreover follows that cannot be equal to . So, by choice of , we get . As a result, , and therefore also must lie within the fan of : their residual shift is . Symmetrically, the map is an up-map that extends and has -shift at most . We can then argue that the resulting pair is an interleaving. Lemma 8 directly implies Corollaries 9 and 10.
Corollary 9.
If is finite, then any optimal -extension uses a realizing critical pair.
Corollary 10.
If is finite, then .
Let be the greatest value that satisfies and let be the smallest value that satisfies . By definition of , for all there is a -extension with -shift . In particular, for small enough, there is a -extension with -shift . In other words, there are no critical pairs that correspond to . This means that cannot use a critical pair that corresponds to the -shift of . By Lemma 8, it then follows that there exists a -extension with -shift .
Theorem 11.
Any finite partial interleaving between any two merge trees and admits an optimal -extension.
Isolated extensions.
To reason about “greatest” shifts and “highest” ancestors, it is useful to have optimal extensions that satisfy two additional finiteness properties. Specifically, assume the -residual interleaving distance is strictly positive, that is, . We say an optimal -extension is isolated if (1) the -shift of only finitely many arrows of is equal to , and (2) there exists some such that for each arrow of with -shift at least , there exists a descendant of , such that is an arrow in with the same target and -shift .
Lemma 12.
If is finite and , there exists an isolated -extension.
4 Locally correct interleavings
The interleaving distance is a bottleneck distance: it yields a single value that quantifies the worst discrepancy between the two merge trees. While this global value is useful for comparison, we are interested in the actual interleavings that realize the distance. Importantly, we seek interleavings that are not only globally optimal, but also locally meaningful. Specifically, if a part of the interleaving is fixed, we want the remainder to be optimal relative to this fixed part. To formalize this notion of local optimality, we build upon the residual interleaving distance introduced in the previous section.
Let and be two merge trees, and fix a partial interleaving . For a subset , we define the restriction of to as the map given by for all points of . Any restriction of is a partial up-map, and extends all of its restrictions. The restriction of to a subset is defined symmetrically. Lastly, the pair is a partial interleaving such that extends . We call a restriction of . Let be a complete interleaving. We make the following observation:
Observation 13.
For any restriction of , it holds that .
A complete interleaving is locally correct if for all restrictions of , the -residual shift of is equal to the -residual interleaving distance.
Definition 14.
A complete interleaving is locally correct if and only if for all and , the restriction satisfies
| (3) |
See Figure 9 for some examples of interleavings that are (not) locally correct.
Suppose is locally correct. Taking as the empty restriction, we see that satisfies . In other words, any locally correct interleaving is an optimal interleaving. The reverse is not necessarily true; not every optimal interleaving is locally correct (see Figure 2). That raises the question: does a locally correct interleaving always exist? In the remainder of this section, we answer this question affirmatively.
Theorem 15.
Any two merge trees and admit a locally correct interleaving.
Overview of the proof.
To prove Theorem 15, we give an explicit construction of a locally correct interleaving. Specifically, we incrementally build a partial interleaving by augmenting it with “bottleneck” arrows. We show that with every augmentation, the -residual interleaving distance strictly decreases, until, after a finite number of iterations, it becomes zero. To conclude the proof, we then show that any complete interleaving that extends the resulting partial interleaving is locally correct.
4.1 Bottlenecks
The interleaving distance is determined by the greatest shift among all arrows of an optimal interleaving. Locally, we might improve such an interleaving by “pushing down” some of the arrows, thereby decreasing their shifts. However, we cannot do this for all arrows; otherwise, we would obtain an interleaving whose shift is strictly smaller than the interleaving distance. We are interested in a bottleneck: a set of arrows that we cannot “push down”.
We first define the relative difference of two, not necessarily related, partial up-maps and . Specifically, consider the set of points for which either is defined and is not, or for which both are defined but where they do not agree:
We define the relative difference of and as the restriction of to , denoted . Similarly, for two partial interleavings and , we define the relative difference as the pair of relative differences . The resulting pair is a restriction of , so it directly follows that any relative difference is a partial interleaving.
Augmentations.
Fix a partial interleaving . In the remainder of this section, we assume that is finite, and that the -residual interleaving distance is strictly positive, that is, . A -extension is a -augmentation if (i) the -residual shift of is at most , that is, , and (ii) the -residual interleaving distance is strictly less than , that is, . We say that is minimal if it does not extend any other -augmentation.
Lemma 16.
Any finite interleaving with admits a finite minimal -augmentation.
Let be a minimal -augmentation. We refer to the relative difference as a -bottleneck. Intuitively, a bottleneck captures a minimal set of arrows that we need to “add” to decrease the residual interleaving distance. See Figure 10 for an illustration.
Recall (the proof of) Lemma 8. If we apply the lemma to a given -extension that does not use a realizing critical pair, we can construct another -extension that has strictly smaller shift. The exact same proof still works for a slightly stronger statement: it suffices to assume that the relative difference does not use a realizing critical pair.
Observation 17.
Let be a finite interleaving and let be a -extension. If does not use a realizing critical pair, there exists a -extension with .
We use this observation to prove the following lemma.
Lemma 18.
If is finite and , any -bottleneck uses a realizing critical pair.
Proof.
Let be an optimal -extension. Since extends , so does . Moreover, as is optimal, the -shift of is equal to the -residual interleaving distance, that is, . Since is an augmentation, the shift of all arrows of is at most , and . Combining, we obtain . In other words, is an optimal -extension. By Observation 17, it follows that uses a realizing critical pair . As , we get that the -shift of the arrows that correspond to must be . In other words, uses . A direct consequence of Lemma 18 is that if, for a given -extension , the relative difference does not use a realizing critical pair, then cannot be a -augmentation. In other words, we have the following corollary:
Corollary 19.
Let be a finite interleaving with , and let be a -extension. If for all arrows , then .
For a partial interleaving , we use and to denote and , respectively.
4.2 Constructing a Locally Correct Interleaving
We show that a locally correct interleaving always exists by incrementally constructing one. Specifically, let be an empty interleaving. We iteratively replace with a finite minimal -augmentation, and we show that after a finite number of iterations the -residual interleaving distance becomes zero, at which point we stop iterating. We conclude by showing that for the resulting partial interleaving , any optimal -extension is locally correct. For this, we maintain three invariants throughout the entire construction. First, we argue that remains dominant: the shift of each arrow of is strictly greater than . Secondly, we show that for all restrictions of it holds that ; we say is partially locally correct. Lastly, we show that after each step of the construction, “specifies” at least one additional vertex of the input merge trees. Since each vertex can be specified at most once, it follows that the construction terminates.
Invariants.
Formally, let be a partial interleaving and assume . Recall that another partial interleaving uses if they completely agree on the domains of and .
Lemma 20.
Let be a dominant, finite interleaving with . For any finite minimal -augmentation , (i) uses , and (ii) uses only realizing critical pairs.
We use this lemma to argue that remains locally correct throughout the construction.
Lemma 21.
Let be a finite interleaving and suppose . Let be a finite minimal -augmentation. If is dominant and locally correct, then so is .
Proof.
We first argue that is dominant. Let be an arrow of . If is also an arrow of , then from the fact that is dominant we know that . Otherwise, must be an arrow of the bottleneck . By Lemma 20, it then directly follows that .
Next, we argue that is locally correct. Consider a restriction of ; we need to show that . If , we immediately obtain . Otherwise, let be the restriction of to the domains of and . Since uses , it follows that uses and is hence a restriction of . If , then by definition of an augmentation we know that the -shift of any arrow of is . We obtain . Moreover, since , the -shift of at least one arrow of is non-zero. We obtain . Since is a minimal augmentation and extends , we know that cannot be an augmentation of . It follows that . Putting it together, we obtain .
Lastly, if , then since is locally correct and is a restriction of , we have
| (4) |
We first show that . First, none of the arrows of are arrows of , so . Next, the -residual shift of is the maximum of the -residual shifts of and . Since is dominant, we know that the shift of any arrow of is strictly greater than . As is not empty, it follows that . On the other hand, by definition of an augmentation, we know that the shift of any arrow of is at most . So, we get . Combining, we obtain .
Next, we argue that . By construction, extends . As observed before, we have . Combining with Equation (4), we obtain . Let be an arrow of . Then is an arrow of the bottleneck , so the shift of is exactly . In other words, . This means that we can apply Corollary 19, for the finite interleaving and the -extension , to obtain .
Thus, which concludes the proof. Recall that for each arrow , with and , of , both and are critical points. However, only the point has a “specified” target in the other tree. We say a point or is specified by , if or respectively (see Figure 11). For our last invariant, we argue that specifies all critical points that are not vertices, i.e., and .
Lemma 22.
Let be a finite interleaving and suppose . Let be a finite minimal -augmentation. If is dominant and specifies all critical points that are not vertices, then so does . Moreover, specifies at least one vertex that does not specify.
Proof.
By Lemma 20, we know that the bottleneck uses only -critical pairs. Consider such a pair . If is an arrow critical pair, then without loss of generality assume for a point and a point ; the case is symmetric. By definition of an arrow critical pair, both and are -critical points. So the pair does not create any additional -critical points. As already specifies all critical points that are not vertices and uses , we know that must be a vertex. Since is dominant, the shift of any arrow of is strictly greater than . Moreover, the shift of any arrow of is exactly . Hence, the vertex cannot be specified by : at least one new vertex is specified.
If is a zigzag critical pair, then without loss of generality assume for two points and of ; if it is a pair of points of the argument is analogous. By definition of a zigzag critical pair, we know that both and . Moreover, there is a point such that and . So, is a vertex that is specified by but not by . Lastly, creates a single -critical point , which is immediately specified.
Finishing the proof of Theorem 15.
Let be the empty interleaving. Trivially, is dominant and locally correct. Moreover, there are no (unspecified) critical points that are not vertices. Now, we iteratively replace with a finite minimal -augmentation until the -residual interleaving distance becomes zero. By applying Lemmas 21 and 22 inductively, we maintain that is dominant and locally correct, and specifies all critical points that are not vertices. Additionally, by Lemma 22, each iteration specifies at least one additional vertex. So after iterations, at least vertices are specified, and the total number of iterations is at most . Afterwards, the residual interleaving distance is zero. Lemma 23 guarantees that a locally correct interleaving exists; its proof is similar to that of Lemma 21.
Lemma 23.
Let be a locally correct partial interleaving with . Any optimal -extension is locally correct.
Computing a locally correct interleaving.
We sketch how the above construction can be translated into an incremental algorithm. To compute the residual interleaving distance, we modify the dynamic program by Touli and Wang [15] to also incorporate constraints induced by partial interleavings. We use the output to extract some augmentation. We then iteratively reduce the set of critical pairs by repeatedly calling the modified dynamic program until we obtain a (finite) minimal augmentation. This minimal augmentation, in turn, reduces the residual interleaving distance; we iterate until it has dropped to zero. To obtain a locally correct interleaving, we select suitable entries from the table filled by the modified dynamic program. A naive implementation of this algorithm takes iterations, each of which needs to compute the residual interleaving distance times to obtain a minimal augmentation (since an augmentation contains critical pairs). So, the total running time of our algorithm is , where is the running time of computing the residual interleaving distance. The algorithm by Touli and Wang [15] takes time, where is a parameter related to the maximum degrees in the input trees.
5 Conclusion
We introduced locally correct interleavings between merge trees, which are optimal interleavings that are “tight”. For this, we introduced the residual interleaving distance: a generalized version of the interleaving distance that can accommodate constraints on the interleavings. We presented a constructive proof that there always exists a locally correct interleaving.
We plan to further investigate the complexity of computing a locally correct interleaving, and we will study the effect of partial interleavings on the running time of the modified dynamic program. Furthermore, we will explore the effects of replacing the dynamic program with the approximation algorithm [1] or one of the variants or heuristics. Moreover, it would be interesting to study other (local) criteria of interleavings. Since locally correct interleavings are not necessarily unique, we could minimize their total shift, for a suitable definition of total. We could also consider a lexicographic optimization, inspired by lexicographic Fréchet matchings [12]. Lastly, we want to explore in which way locally correct interleavings can be translated to meaningful matchings between terrains.
References
- [1] P.K. Agarwal, K. Fox, A. Nath, A. Sidiropoulos, and Y. Wang. Computing the Gromov-Hausdorff distance for metric trees. ACM Transactions on Algorithms, 14(2):1–20, 2018. doi:10.1145/3185466.
- [2] T. Beurskens, T. Ophelders, B. Speckmann, and K. Verbeek. Relating interleaving and Fréchet distances via ordered merge trees. Journal of Computational Geometry, 17(1):1–36, 2026. doi:10.20382/jocg.v17i1a1.
- [3] K. Buchin, M. Buchin, W. Meulemans, and B. Speckmann. Locally correct Fréchet-matchings. Computational Geometry, 76(1):1–18, 2019. doi:10.1016/j.comgeo.2018.09.002.
- [4] J. Curry, H. Hang, W. Mio, T. Needham, and O. B. Okutan. Decorated merge trees for persistent topology. Journal of Applied and Computational Topology, 6(3):371–428, 2022. doi:10.1007/s41468-022-00089-3.
- [5] E. Gasparovic, E. Munch, S. Oudot, K. Turner, B. Wang, and Y. Wang. Intrinsic interleaving distance for merge trees. arXiv:1908.00063.
- [6] E. Gasparovic, E. Munch, S. Oudot, K. Turner, B. Wang, and Y. Wang. Intrinsic interleaving distance for merge trees. La Matematica, 4(1):40–65, 2025. doi:10.1007/s44007-024-00143-9.
- [7] W. Köpp and T. Weinkauf. Temporal merge tree maps: A topology-based static visualization for temporal scalar data. IEEE Transactions on Visualization and Computer Graphics, 29(1):1157–1167, 2022. doi:10.1109/TVCG.2022.3209387.
- [8] D. Morozov, K. Beketayev, and G. Weber. Interleaving distance between merge trees. Manuscript (accessed on 06-03-2025), 2013. URL: https://mrzv.org/publications/interleaving-distance-merge-trees/manuscript/.
- [9] E. Munch and A. Stefanou. The -cophenetic metric for phylogenetic trees as an interleaving distance. In Research in Data Science, volume 17 of Association for Women in Mathematics Series, pages 109–127. Springer International Publishing, 2019. doi:10.1007/978-3-030-11566-1_5.
- [10] M. Pegoraro. A graph-matching formulation of the interleaving distance between merge trees. AIMS Mathematics, 10(6):13025–13081, 2025. doi:10.3934/math.2025586.
- [11] M. Pont, J. Vidal, J. Delon, and J. Tierny. Wasserstein distances, geodesics and barycenters of merge trees. IEEE Transactions on Visualization and Computer Graphics, 28(1):291–301, 2022. doi:10.1109/TVCG.2021.3114839.
- [12] G. Rote. Lexicographic Fréchet matchings. In Proc. 30th European Workshop on Computational Geometry (EuroCG’14), 2014. doi:10.17169/refubium-19845.
- [13] R. Sridharamurthy, T. B. Masood, A. Kamakshidasan, and V. Natarajan. Edit distance between merge trees. IEEE Transactions on Visualization and Computer Graphics, 26(3):1518–1531, 2020. doi:10.1109/TVCG.2018.2873612.
- [14] R. Sridharamurthy and V. Natarajan. Comparative analysis of merge trees using local tree edit distance. IEEE Transactions on Visualization and Computer Graphics, 29(2):1518–1530, 2021. doi:10.1109/TVCG.2021.3122176.
- [15] E.F. Touli and Y. Wang. FPT-algorithms for computing the Gromov-Hausdorff and interleaving distances between trees. Journal of Computational Geometry, 13:89–124, 2022. doi:10.20382/jocg.v13i1a4.
- [16] L. Yan, T. B. Masood, F. Rasheed, I. Hotz, and B. Wang. Geometry aware merge tree comparisons for time-varying data with interleaving distances. IEEE Transactions on Visualization and Computer Graphics, 29(8):3489–3506, 2022. doi:10.1109/TVCG.2022.3163349.
- [17] L. Yan, T. B. Masood, R. Sridharamurthy, F. Rasheed, V. Natarajan, I. Hotz, and B. Wang. Scalar field comparison with topological descriptors: Properties and applications for scientific visualization. Computer Graphics Forum, 40(3):599–633, 2021. doi:10.1111/cgf.14331.
- [18] L. Yan, Y. Wang, E. Munch, E. Gasparovich, and B. Wang. A structural average of labeled merge trees for uncertainty visualisation. IEEE Transactions on Visualization and Computer Graphics, 26(1):832–842, 2020. doi:10.1109/TVCG.2019.2934242.
