The Reeb Graph Edit Distance is Universal

We consider the setting of Reeb graphs of piecewise linear functions and study distances between them that are stable, meaning that functions which are similar in the supremum norm ought to have similar Reeb graphs. We define an edit distance for Reeb graphs and prove that it is stable and universal, meaning that it provides an upper bound to any other stable distance. In contrast, via a specific construction, we show that the interleaving distance and the functional distortion distance on Reeb graphs are not universal.


Introduction
The concept of Reeb graphs of a Morse function first appeared in [12] and was subsequently applied to the problems in shape analysis in [13,9].The literature on Reeb graphs in the computational geometry and computational topology is ever growing (see, e.g., [3,4] for a discussion and references).The Reeb graph plays a central role in topological data analysis, not least because of the success of Mapper [14], a method providing a discretization of the Reeb graph for a function defined on a point cloud.
A recent line of work has concentrated on questions about identifying suitable notions of distance between Reeb graphs: These include the so called functional distortion distance [3], the interleaving distance [6], and various graph edit distances [8,7,2].There is of course interest in understanding the connection between different existing distances.In this regard, it has been shown in [4] that the functional distortion and the interleaving distances are bi-Lipschitz equivalent.The edit distances defined in [8,7] for Reeb graphs of curves and surfaces, respectively, are shown to be universal in their respective setting, so the functional distortion and interleaving distances restricted to the same settings are a lower bound for those distances.Moreover, an example in [7] shows that the functional distortion distance can be strictly smaller than the edit distance considered in that paper.
In this paper we concentrate on the setting of PL functions on compact triangulable spaces and in this realm we study the properties of stability and universality of distances between Reeb graphs.Inspired by a construction of distance between filtered spaces [11], we first construct a novel distance δ PL based on considering joint pullbacks of two given Reeb graphs and prove it satisfies both stability and universality.Via analyzing a specific construction we then prove that neither the functional distortion nor the interleaving distances are universal.Finally, we define two edit-like additional distances between Reeb graphs that reinterpret those appearing in [8,7,2] and prove that both are stable and universal.As a consequence, both distances agree with δ PL .

Topological and categorical aspects of Reeb graphs
We start by exploring some topological ideas behind the definition of Reeb graphs.All maps and functions considered in this paper will be assumed to be continuous.Otherwise, we call them set maps and set functions.

Reeb graphs as quotient spaces
The classical construction of a Reeb graph [12] is given via an equivalence relation as follows: Definition 2.1.For f : X → R a Morse function on a compact smooth manifold, the Reeb graph of f is the quotient space X/∼ f , with x ∼ f y if and only if x and y belong to the same connected component of some level set While this definition was originally considered in the setting of Morse theory, it does not make explicit use of the smooth structure, and so it can be applied to a quite broad setting.However, some additional assumptions of X and f are justified in order to maintain some of the characteristic properties of Reeb graphs in a generalized setting.With this motivation in mind, we revisit the definition in terms of quotient maps and functions with discrete fibers.
A quotient map p : In particular, a surjection between compact Hausdorff spaces is a quotient map by the closed map lemma.A quotient map p : X → Y is characterized by the universal property that a set map Φ : Y → Z into any topological space Z is continuous if and only if Φ • p is continuous.
The motivation for considering quotient maps and functions with discrete fibers is explained by the following fact.Proposition 2.2.Let f : X → R be a function with locally connected fibers, and let q : X → X/∼ f be the canonical quotient map.Then the induced function f : Proof.To see that the fibers of f are discrete, we show that any subset S of f −1 (t) is closed.Let T = f −1 (t) \ S .Then q −1 (T ) is a disjoint union of connected components of f −1 (t).Since f −1 (t) is locally connected, each of its connected components is open in the fiber, and so q −1 (T ) is open in f −1 (t), implying that q −1 (S ) is closed in f −1 (t) and hence in X.Since q is a quotient map, q −1 (S ) is closed if and only if S is closed, yielding the claim.

Reeb quotient maps and Reeb graphs of piecewise linear functions
We now define a class of quotient maps that leave Reeb graphs invariant up to isomorphism.The main goal is to provide a natural construction for lifting functions f : X → R to spaces Y through a quotient map Y → X in a way that yields isomorphic Reeb graphs.To this end, we will define two categories, the category of Reeb domains and the category of Reeb graphs.Definition 2.3.We define the category PLReebDom of (compact triangulable) Reeb domains as follows: • The objects of PLReebDom (Reeb domains) are connected compact triangulable spaces.
• The morphisms of PLReebDom (Reeb quotient maps) are surjective piecewise linear maps with connected fibers.
The fact that this is indeed a category will be established in Theorem 2.13.
Definition 2.4.The category of Reeb graphs, denoted by PLReebGrph, is the category whose objects are Reeb domains R f endowed with PL functions f : R f → R with discrete fibers called Reeb functions, and whose morphisms between Reeb domains R f and R g respectively endowed with Reeb functions f and g are PL maps Φ : R f → R g such that g • Φ = f .
In particular, the isomorphisms between Reeb graphs are PL homeomorphisms that preserve the function values of the associated Reeb functions.A Reeb graph is actually a finite topological graph (a compact triangulable space of dimension at most 1).
Theorem 2.5.Any Reeb graph R f in PLReebGrph is a finite topological graph.
Proof.By definition, f is (simplexwise) linear for some triangulation of R f .If there were a simplex σ of dimension at least 2 in the triangulation of R f , then for any x in the interior of σ, the intersection σ ∩ f −1 ( f (x)) would have to be of at least dimension 1.But this would contradict the assumption that f has discrete fibers.Definition 2.6.Generalizing the classical definition (Definition 2.1) , we say that a Reeb graph R f is the Reeb graph of f : X → R if there is a Reeb quotient map p : The following lemma shows how a transformation g = ξ • f of a function f lifts to a Reeb quotient map ζ between the corresponding Reeb graphs.
Lemma 2.7.Assume that f : R f → R, g : R g → R are Reeb functions, p f : by the assumption that p f is a Reeb quotient map.By commutativity, we have f f is a set map.Moreover, since p g is continuous and p f is closed, the map ζ is continuous; since p g and p f are PL, the map ζ is PL as well.Now let y ∈ R g and let s = g(y).Similarly to above, Remark 2.8.By Proposition 2.2 and Lemma 2.7, the Reeb graph R f of f : X → R is isomorphic to X/∼ f .As a consequence, the Reeb graph R f together with the Reeb quotient map p is unique up to a unique isomorphism, turning the Reeb graph into a universal property.
We now proceed to prove that Reeb quotient maps are closed under composition.We start by showing that not only the fibers, but more generally all preimages of closed connected sets are connected.
the sets U and V are also closed in X.The images p(U) and p(V) are closed by the closed map lemma, and their union is K.By connectedness of K, their intersection is nonempty.Let y ∈ p(U) ∩ p(V).We have The subspaces (p −1 (y) ∩ U) and (p −1 (y) ∩ V) are closed in p −1 (y), and by connectedness of the fiber p −1 (y), their intersection must be nonempty.In particular, U ∩ V is nonempty.
Corollary 2.10.If p : X → Y and q : Y → Z are Reeb quotient maps, then the composition q • p : X → Z is a Reeb quotient map too.
As mentioned before, the main purpose of Reeb quotient maps is to lift Reeb functions to larger domains while maintaining the same Reeb graph.The following property is a consequence of the above statement: Corollary 2.11.Let f : X → R be a function with Reeb graph R f , and let q : Y → X be a Reeb quotient map.Then R f is also the Reeb graph of f • q : Y → R.
We now show that Reeb quotient maps are stable under pullbacks.
If the map p 1 (resp.p 2 ) is a Reeb quotient map, then so is the map q 2 (resp.q 1 ).
Proof.First note that the category of compact triangulable spaces has all pullbacks [15].For x 2 ∈ X 2 , by surjectivity of p 1 there is some ) is connected being a fiber of p 1 , implying that p −1 1 (p 2 (x 2 )) × {x 2 } is connected.Finally, applying Proposition 2.9 to q 2 , we obtain that the pullback space X 1 × Y X 2 is connected.The proof for q 1 is analogous.
Theorem 2.13.The Reeb domains and Reeb quotient maps form a finitely complete category, i.e., every finite diagram has a limit.Proof.By Corollary 2.10, the Reeb quotient maps are closed under composition and contain the identity maps of Reeb domains, so they form a category.This category has all pullbacks by Proposition 2.12, and the one-point space is a terminal object, so equivalently it has all finite limits [1, Prop.5.14 and 5.21].

Stable and universal distances
Throughout this paper, we will use the term distance to describe an extended pseudo-metric d : X × X → [0, ∞] on some collection X.Our main goal is the introduction of a distance between Reeb graphs that is stable and universal in the following sense.Definition 3.1.We say that a distance d S on the objects of PLReebGrph is stable if and only if given any two Reeb graphs R f and R g respectively endowed with Reeb functions f and g, for any Reeb domain X with Reeb quotient maps p f : X → R f and p g : X → R g we have Note that stability implies that isomorphic Reeb graphs have distance 0. Indeed, an isomorphism of Reeb graphs γ : Moreover, we say that a stable distance d U on the objects of PLReebGrph is universal if and only if for any other stable distance d S on PLReebGrph, we have Remark 3.2.By connectedness of R f and R g , there is at least one space X with maps p f , p g as needed to define the stability property: X = R f × R g , with p f , p g the canonical projections.The resulting functions In particular, for compact Reeb graphs a stable distance is always finite.
The definition of stability yields the following canonical universal distance.
Definition 3.3.For any two Reeb graphs R f and R g endowed with Reeb graph functions f and g, let where X is any Reeb domain, and p f , p g are Reeb quotient maps.
Proposition 3.4.The distance δ PL is the largest stable distance on PLReebGrph.Hence, δ PL is universal.
Proof.To see that δ PL is a distance, the only non-trivial part is showing the triangle inequality.To this end, given diagrams p f : R f ← X → R g : p g and p g : R g ← Y → R h : p h , we can pullback the diagram p g : X → R g ← Y : p g to obtain the diagram q X : X ← X × R g Y → Y : q Y , where X × R g Y is a Reeb domain and q X , q Y are Reeb quotient maps by Proposition 2.12.
where the last inequality holds because im q X ⊆ X and im q Y ⊆ Y. Hence, We now consider an example where we can explicitly determine the value of the distance δ PL (R f , R g ) between two specific simple Reeb graphs R f = S 1 = {(x, y) ∈ R 2 : x 2 + y 2 = 1} with f (x, y) = x and R g = [−1, 1] with g(t) = t.The example demonstrates the non-universality of certain distances proposed in the literature.We prove: The proof of this proposition will be obtained from the two claims below.
Proof.Consider the cylinder C = {(x, y, z) ∈ R 3 : x 2 + y 2 = 1, |2z − x| ≤ 1} together with functions f (x, y, z) = x and g(x, y, z) = z defined on C. Then R f is a Reeb graph of f via the Reeb quotient map (x, y, z) → (x, y), and R g is a Reeb graph of g via the Reeb quotient map (x, y, z) → z.Since we have Proof.Assume for a contradiction that there is a diagram p f : R f ← Z → R g : p g of Reeb quotient maps such that, letting f = f • p f and ĝ = g • p g , we have f − ĝ ∞ = δ < 1.We then observe the following: ) consists of two circular arcs homeomorphic by f to [−δ, +δ], and thus, by Proposition 2.9, f −1 ([−δ, +δ]) consists of two connected components C + and C − as well.
The current example illustrates that the functional distortion distance introduced in [3] and the interleaving distance introduced in [6] both fail to be universal.We first recall the definition of the former.For any Reeb graph R f with Reeb function f , consider the metric on R f given by Given maps φ : R f → R g and ψ : R g → R f , we write for the correspondences induced by the two maps.The functional distortion distance is To see that neither the functional distortion distance nor the interleaving distance are universal we establish: Proof.By [4, Lemma 8], the functional distortion distance is an upper bound on the interleaving distance on Reeb graphs [6], and so it is enough to prove that d FD (R f , R g ) ≤ 1 2 .To this end consider the maps φ : R f → R g , (x, y) → x and ψ : R g while for every pair q, q ∈ R g , we have d g (q, q ) = |g(q) − g(q )|.This implies that for any two corresponding pairs (p, q), (p , q ) ∈ G(φ, ψ), we have |d f (p, p ) − d g (q, q )| ≤ 1, and thus D(φ, ψ) ≤ 1 2 .Moreover, both maps preserve function values, so 4 The topological and graph edit distances where for n ∈ N f1 , . . ., fn are Reeb functions with f1 = f and fn = g, and the maps This way, we may think of a Reeb zigzag diagram as a sequence of operations transforming the R f into R g .The elementary diagram on the left corresponds to an edit operation: the space X i−1 , together with a function X i−1 → R with Reeb graph R i , is transformed to another space X i , with a function X i → R having the same Reeb graph R i .The elementary diagram on the right corresponds to a relabel operation: the function on X i with Reeb graph R i is transformed to another function with Reeb graph R i+1 .The idea of edit and relabel operations is inspired by previous work on edit distances for Reeb graphs [7,2].
In order to define an edit distance using Reeb zigzag diagrams, we need to assign a cost to a given Reeb zigzag diagram between R f and R g .To that end, we can consider a cone from a space V by Reeb quotient maps We call this diagram a Reeb cone.Any Reeb zigzag diagram admits such a cone.Indeed, the category PLReebDom has all finite limits by Theorem 2.13, and the limit over the lower part of diagram (1), consisting of Reeb quotient maps, yields a limit over the whole diagram.In a Reeb cone, by commutativity, each of the Reeb functions fi induces a unique function f i : V → R. By Corollary 2.11, the Reeb graph of f i is isomorphic to R i .This way, we pull back the individual functions fi to functions f i on a common space with the same Reeb graphs, where they can be compared using the supremum norm.
Using these ideas, we can now introduce distances on the objects of PLReebGrph, and proceed to prove that they are stable and universal.Definition 4.1.Given a Reeb cone from a space V as in (2), we define the spread of the functions ( f i ) i=1,...,n : V → R, as the function s V : V → R, x → max i=1,...,n f i (x) − min j=1,...,n f j (x).Moreover, for a Reeb zigzag diagram Z between R f and R g as in (1), consider the limit of Z, denoted by L. The cost of the Reeb zigzag diagram Z is the supremum norm of the spread s L , Definition 4.2.We define the (PL) edit distance δ ePL between Reeb graphs R f and R g in PLReebGrph as the infimum cost of all Reeb zigzag diagrams Z in PLReebDom between R f and R g : Moreover, we define the graph edit distance δ eGraph between Reeb graphs R f and R g in PLReebGrph analogously by restricting the infimum to Reeb zigzag diagrams Z where all the spaces X i and R i are finite topological graphs, and all the maps are PL.
Thus, on PLReebGrph we have two edit distances, satisfying The Reeb graph edit distance δ eGraph is a categorical reformulation of the definition given in [2].The main goal is to prove that these distances have the stability and universality properties (Propositions 4.4 and 4.5, Theorem 5.6, and Corollary 5.7).As a consequence, whenever applicable, they actually coincide with the canonical universal distance δ PL defined in Definition 3.3: The proofs of stability and universality for δ ePL are straightforward and are given next.The verification of stability and universality for δ eGraph follows in Section 5. Proposition 4.4.δ ePL is a stable distance.
Proof.Let R f , R g be Reeb graphs with Reeb functions f and g.For any space X such that there exist two Reeb quotient maps p f : X → R f and p g : Our proof of universality of the edit distance is similar to previous universality proofs for the bottleneck distance [5] and for the interleaving distance [10].Proposition 4.5.δ ePL is a universal distance.
Proof.Let R f , R g be Reeb graphs with Reeb functions f and g.Let δ ePL (R f , R g ) = d.Hence, for any ε > 0, there is a Reeb zigzag diagram Z between R f = R 1 and R g = R n , with limit L and functions f i as in Definition 4.1, having cost Let p f : L → R f and p g : L → R g be the induced Reeb quotient maps.If d S is any other stable distance (cf.Definition 3.1) between R f and R g , we have Since the above holds for all ε > 0, we have

Stability and universality of the Reeb graph edit distance
We now turn to the proof of stability and universality for the Reeb graph edit distance.Recall that, in the case of δ eGraph , the admissible Reeb zigzag diagrams are PL zigzags of finite topological graphs.As mentioned above, the distance δ eGraph is applicable to Reeb graphs of compact triangulable spaces.
Lemma 5.1.Let X = |K| and let V be the vertex set of K. Let f, g : X → R be PL functions, simplexwise linear on K. Let χ : im f → im g be a weakly order preserving PL surjection such that χ • f (v) = g(v) for every vertex v ∈ V. Then there is a Reeb quotient map X/∼ f → X/∼ g .
Proof.For simplicity, we write R f = X/∼ f , R g = X/∼ g , and R h = X/∼ h , where h = χ • f .Applying Proposition 2.2, f can be factorized as f = f • q f , where q f : X → R f is the canonical projection and f : R f → R is a Reeb function.Analogously, we obtain g = g • q g and h = h • q h .We show that there is a Reeb quotient map k : X → R h making the following diagram commute: The claim then follows by applying Lemma 2.7 to obtain Reeb quotient maps R f → R h and R h → R g , which compose to the desired map R f → R g .In order to prove the existence of such a Reeb quotient map k, we define the relation Here st K denotes the open star on X = |K|, defined as Note that the converse relation to the open star is the (closed) carrier, st −1 K = carr K , where carr K (A) is the underlying space of the smallest subcomplex of K containing A ⊆ X.We will also use the open carrier relation carr The remainder of the proof is split into several lemmas.Lemma 5.2 describes the behaviour of the functions h and g on the simplices of K. Lemma 5.3 shows that k is a continuous surjection, and Lemma 5.4 shows that k has connected fibers.Since h • k = g, we conclude that k is PL.Thus, k is a Reeb quotient map, and the claim follows from Lemma 2.7.
Proof.We have h(σ) = g(σ) because h is equal to g on the vertices of K, and h = χ • f with f linear on σ and χ a weakly order preserving surjection.
To show that g(σ • ) ⊆ h(σ • ), note that since g is linear on σ, either g is constant on σ and so g(σ • ) = g(σ) = h(σ), or g(σ • ) = (g(v), g(w)) for some vertices v, w of σ.In the latter case, since h and g coincide on the vertices, we have g(σ ) and the claim follows.
Proof.We fist show that k is right-unique, i.e., for any x ∈ X and y, y ∈ k(x), we have y = y .To see this, let t = g(x) and note that h h (y) and ξ ∈ q −1 h (y ).But since h −1 (t) ∩ τ is necessarily connected for every simplex τ, we know that ζ lies in the same connected component of h −1 (t) ∩ st K (x) as both ξ and ξ , and so we have y = q h (ξ) = q h (ξ ) = y as claimed.
To show that k is left-total, we need to show that for every x ∈ X, k(x) ∅.It suffices to show that for every x ∈ X, st K (x) contains a point x with h(x ) = g(x).This follows by considering the simplex σ ∈ K with x ∈ σ • .Now by Lemma 5.2, there is a point x ∈ σ • ⊆ st K (x) with h(x ) = g(x) as claimed.
To show that k is right-total, we show that for every y ∈ R h , there is some or equivalently, there is some x ∈ carr K • q −1 h (y) such that g(x) = h(y).If q −1 h (y) contains some vertex v of K, choose x = v.Otherwise, let ξ ∈ q −1 h (y), and let σ ∈ K be such that ξ ∈ σ • .Now by Lemma 5.2 there is a point x ∈ σ ⊆ carr K • q −1 h (y) with g(x) = h(ξ) = h(y).Finally, to show that k is continuous, we show that for every closed subset L of R h , the preimage k −1 (L) is closed.Since k −1 = (carr K • q −1 h ) ∩ (g −1 • h), it is sufficient to show that both carr K • q −1 h (L) and g −1 • h(L) are closed in X.First note that carr K • q −1 h (L) is closed as a subcomplex of K. Furthermore, the image h(L) is closed by the closed map lemma.By continuity of g it follows that g −1 • h(L) is closed in X.
Lemma 5.4.The fibers of k are connected.
Proof.Let y ∈ R h be a point in the Reeb graph with value t = h(y), and C = q −1 h (y) ⊆ h −1 (t) the corresponding component of the level set of h.Let U = carr K (C), and let L be the corresponding subcomplex of K. Writing D = k −1 (y), we have C = U ∩ h −1 (t) and D = U ∩ g −1 (t).To prove that D is connected, it is sufficient to show that C and D have finite closed covers with isomorphic nerves; since C is connected, both nerves and hence also D are then connected too.
We thus have shown the existence of the Reeb quotient map k.This completes the proof of Lemma 5.1.We will now apply Lemma 5.1 to construct Reeb graph edit zigzags from straight line homotopies.
We have By the surjectivity of q ρ i , for every i there is x ,i ∈ X such that q ρ i (x ,i ) = r i ( ).Thus, In conclusion, for every ∈ L, s L ( ) Corollary 5.7.δ eGraph is a universal distance.
Proof.The claim is a direct consequence of inequality (3) together with Theorem 5.6 and Propositions 4.4 and 4.5.
).By definition of stability, d S ≤ δ PL for any stable distance d S defined on the objects of PLReebGrph, implying that δ PL is universal.Example 3.5.Consider the one point Reeb graph * c endowed with the function identical to c ∈ R.Then, for any Reeb graph R f endowed with the function f , δ PL • K , where carr • K (A) is the smallest union of open simplices of K covering A. Note that the open carrier relation is symmetric, i.e., (carr • K