The edit distance for Reeb graphs of surfaces
aa r X i v : . [ c s . C G ] N ov THE EDIT DISTANCE FOR REEB GRAPHS OF SURFACES
B. DI FABIO AND C. LANDIA
BSTRACT . Reeb graphs are structural descriptors that capture shape properties of a topo-logical space from the perspective of a chosen function. In this work we define a combi-natorial metric for Reeb graphs of orientable surfaces in terms of the cost necessary totransform one graph into another by edit operations. The main contributions of this paperare the stability property and the optimality of this edit distance. More precisely, the sta-bility result states that changes in the functions, measured by the maximum norm, implynot greater changes in the corresponding Reeb graphs, measured by the edit distance. Theoptimality result states that our edit distance discriminates Reeb graphs better than anyother metric for Reeb graphs of surfaces satisfying the stability property. I NTRODUCTION
In shape comparison, a widely used scheme is to measure the dissimilarity betweendescriptors associated with each shape rather than to match shapes directly. Reeb graphsdescribe shapes from topological and geometrical perspectives. In this framework, a shapeis modeled as a topological space X endowed with a scalar function f : X → R . The role of f is to explore geometrical properties of the space X . The Reeb graph of f is obtained byshrinking each connected component of a level set of f to a single point [20]. Reeb graphshave been used as an effective tool for shape analysis and description tasks since [24, 23].One of the most important questions is whether Reeb graphs are robust against pertur-bations that may occur because of noise and approximation errors in the data acquisitionprocess. Whereas in the past researchers dealt with this problem developing heuristicsso that Reeb graphs would be resistant to connectivity changes caused by simplification,subdivision and remesh, and robust against noise and certain changes due to deformation[11, 2], in the last years the question of Reeb graph stability has been investigated from thetheoretical point of view. In [7] an edit distance between Reeb graphs of curves endowedwith Morse functions is introduced and shown to yield stability. Importantly, despite thecombinatorial nature of this distance, it coincides with the natural pseudo-distance betweenshapes [8], thus showing the maximal discriminative power for this sort of distances. Veryrecently a functional distortion distance between Reeb graphs has been proposed in [1],with proven stable and discriminative properties. The functional distortion distance isbased on continuous maps between the topological spaces realizing the Reeb graphs, sothat it is not combinatorial in its definition. Noticeably, it allows for comparison of non-homeomorphic spaces meaning that it can be used to deal also with artifacts that changethe homotopy type of the space, although as a consequence it cannot fully discriminateshapes and stability is not proven in that case.In this paper we deal with the comparison problem for Reeb graphs of surfaces. Indeedthe case of surfaces seems to us the most interesting area of application of the Reeb graphas a shape descriptor. As a tradeoff between generality and simplicity, we confine ourselves Mathematics Subject Classification.
Primary 05C10, 68T10; Secondary 54C30.
Key words and phrases. shape similarity, graph edit distance, Morse function, natural stratification. to the case of smooth compact orientable surfaces without boundary endowed with simpleMorse functions.The basic properties we consider important for a metric between Reeb graphs are: therobustness to perturbations of the input functions; the ability to discriminate functions onthe same manifold; the deployment of the combinatorial nature of graphs. For this reason,we apply to the case of surfaces the same underlying ideas as used in [7] for curves. Startingfrom Reeb graphs labeled on the vertices by the function values, the following steps arecarried out: first, a set of admissible edit operations is detected to transform a labeledReeb graph into another; then a suitable cost is associated to each edit operation; finally, acombinatorial dissimilarity measure between labeled Reeb graphs, called an edit distance ,is defined in terms of the least cost necessary to transform one graph into another by editoperations. However, the passage from curves to surfaces is not automatic since Reebgraphs of surfaces are structurally different from those of curves. For example, the degreeof vertices is different for Reeb graphs of curves and surfaces. Therefore, the set of editoperations as well as their costs cannot be directly imported from the case of curves butneed to be suitably defined. In conclusion, our edit distance between Reeb graphs belongsto the family of Graph Edit Distances [10], widely used in pattern analysis.Our first main result is that changes in the functions, measured by the maximum norm,imply not greater changes in this edit distance, yielding the stability property under func-tion perturbations. To prove this result, we track the changes in the Reeb graphs as thefunction varies along a linear path avoiding degeneracies. From the stability property, wededuce that the edit distance between the Reeb graphs of two functions f and g defined on asurface is a lower bound for the natural pseudo-distance between f and g obtained by min-imizing the change in the functions due to the application of a self-diffeomorphism of themanifold, with respect to the maximum norm. The natural pseudo-distance can be thoughtas a way to compare f and g directly, while the edit distance provides an indirect compar-ison between f and g through their Reeb graphs. Thus, by virtue of the stability result, theedit distance provides a combinatorial tool to estimate the natural pseudo-distance.Our second contribution is the proof that the edit distance between Reeb graphs ofsurfaces actually coincides with the natural pseudo-distance. This is proved by showingthat for every edit operation on a Reeb graph there is a self-homeomorphism of the surfacewhose cost is not greater than that of the considered edit operation. This result impliesthat the edit distance is actually a metric and not only a pseudo-metric. Morever it showsthat the edit distance is an optimal distance for Reeb graphs of surfaces in that it has themaximum discriminative power among all the distances between Reeb graphs of surfaceswith the stability property.In conclusion, this paper shows that the results of [7] for curves also hold in the moreinteresting case of surfaces.The paper is organized as follows. In Section 1 we recall the basic properties of labeledReeb graphs of orientable surfaces. In Section 2 we define the edit deformations betweenlabeled Reeb graphs, and show that through a finite sequence of these deformations we canalways transform a Reeb graph into another. In Section 3 we define the cost associatedwith each type of edit deformation and the edit distance in terms of this cost. Section 4illustrates the robustness of Reeb graphs with respect to the edit distance. Eventually, Sec-tion 5 provides relationships between our edit distance and other stable metrics: the naturalpseudo-distance, the bottleneck distance and the functional distortion distance. HE EDIT DISTANCE FOR REEB GRAPHS OF SURFACES 3
A number of questions remain open and are not treated in this paper. The most importantone is how to compute the edit distance. Indeed, whereas in some particular cases we candeduce the value of the edit distance from the lower bounds provided by the bottleneckdistance of persistence diagrams or the functional distortion distance of Reeb graphs, ingeneral we do not know how to compute it. A second open problem is to which extentthe theory developed in this paper for the smooth category can be transported into thepiecewise linear category. A third question that would deserve investigation is how togeneralize the edit distance to compare functions on non-homeomorphic surfaces as well,and the relationship with the functional distortion distance in that case.1. L
ABELED R EEB GRAPHS OF ORIENTABLE SURFACES
Hereafter, M denotes a connected, closed (i.e. compact and without boundary), ori-entable, smooth surface of genus g , and F ( M ) the set of C ¥ real functions on M .For f ∈ F ( M ) , we denote by K f the set of its critical points. If p ∈ K f , then the realnumber f ( p ) is called a critical value of f , and the set { q ∈ M : q ∈ f − ( f ( p )) } is calleda critical level of f . Moreover, a critical point p is called non-degenerate if the Hessianmatrix of f at p is non-singular. The index of a non-degenerate critical point p of f is thedimension of the largest subspace of the tangent space to M at p on which the Hessianmatrix is negative definite. In particular, the index of a point p ∈ K f is equal to 0,1, or 2depending on whether p is a minimum, a saddle, or a maximum point of f .A function f ∈ F ( M ) is called a Morse function if all its critical points are non-degenerate. Besides, a Morse function is said to be simple if each critical level containsexactly one critical point. The set of simple Morse functions will be denoted by F ( M ) ,as a reminder that it is a sub-manifold of F ( M ) of co-dimension 0 (see also Section 4). Definition 1.1.
Let f ∈ F ( M ) , and define on M the following equivalence relation:for every p , q ∈ M , p ∼ f q whenever p , q belong to the same connected component of f − ( f ( p )) . The quotient space M / ∼ f is the Reeb graph associated with f .Our assumption that f is a simple Morse function allows us to consider the space M / ∼ f as a graph whose vertices correspond bijectively to the critical points of f . Forthis reason, in the following, we will often identify vertices with the corresponding criticalpoints. Proposition 1.2. ( [20] ) The Reeb graph G f associated with f ∈ F ( M ) is a finite andconnected simplicial complex of dimension 1. A vertex of G f has degree equal to 1 if itcorresponds to a critical point of f of index 0 or 2, while it has degree equal to 2,3, or 4 ifit corresponds to a critical point of f of index 1. Throughout this paper, Reeb graphs are regarded as combinatorial graphs and not astopological spaces. The vertex set of G f will be denoted by V ( G f ) , and its edge set by E ( G f ) . Moreover, if v , v ∈ V ( G f ) are adjacent vertices, i.e., connected by an edge, wewill write e ( v , v ) ∈ E ( G f ) .Our assumptions that M is orientable, compact and without boundary ensure that thereare no vertices of degree 2 or 4. Moreover, if p , q , r denote the number of minima, max-ima, and saddle points of f , from the relationships between the Euler characteristic of M , c ( M ) , and p , q , r , i.e. c ( M ) = p + q − r , and between c ( M ) and the genus g of M ,i.e. c ( M ) = − g , it follows that the cardinality of V ( G f ) , which is p + q + r , is alsoequal to 2 ( p + q + g − ) , i.e. is even in number. The minimum number of vertices of aReeb graph is achieved whenever p = q =
1, and consequently r = g . In this case the B. DI FABIO AND C. LANDI cardinality of V ( G f ) is equal to 2 g +
2. In general, if M has genus g then G f has exactly g linearly independent cycles. We will call a cycle of length m in the graph an m - cycle .These observations motivate the following definition. Definition 1.3.
We shall call minimal the Reeb graph G f of a function f having p = q = G f is canonical if it is minimal and all its cycles, if any, are 2-cycles.We underline that our definition of canonical Reeb graph is slightly different from theone in [13]. This choice has been done to simplify the proof of Proposition 2.7.Examples of minimal and canonical Reeb graphs are displayed in Figure 1.PSfrag replacements G f ( G f , ℓ f ) v v v v v v v v f ( a )( b )( c ) F IGURE Examples of minimal Reeb graphs. The graph on the right is also canonical.
In what follows, we label the vertices of G f by equipping each of them with the valueof f at the corresponding critical point. We denote such a labeled graph by ( G f , ℓ f ) , where ℓ f : V ( G f ) → R is the restriction of f : M → R to K f . In a labeled Reeb graph, each vertex v of degree 3 has at least two of its adjacent vertices, say v , v , such that ℓ f ( v ) < ℓ f ( v ) <ℓ f ( v ) . An example is displayed in Figure 2.PSfrag replacements M ( G f , ℓ f ) a a a a a a a a a a fa a a a a a a a a a ( a )( b )( c ) F IGURE Left: the height function f : M → R ; center: the surface M of genus g = ( G f ,ℓ f ) . Let us consider the realization problem, i.e. the problem of constructing a smooth sur-face and a simple Morse function on it from a graph on an even number of vertices, all ofwhich are of degree 1 or 3, appropriately labeled. We need the following definition.
Definition 1.4.
We shall say that two labeled Reeb graphs ( G f , ℓ f ) , ( G g , ℓ g ) are isomorphic ,and we write ( G f , ℓ f ) ∼ = ( G g , ℓ g ) , if there exists a graph isomorphism F : V ( G f ) → V ( G g ) such that, for every v ∈ V ( G f ) , ℓ f ( v ) = ℓ g ( F ( v )) (i.e. F preserves edges and vertex labels). HE EDIT DISTANCE FOR REEB GRAPHS OF SURFACES 5
Proposition 1.5 (Realization Theorem) . Let ( G , ℓ ) be a labeled graph, where G is a graphwith m linearly independent cycles, on an even number of vertices, all of which are ofdegree 1 or 3, and ℓ : V ( G ) → R is an injective function such that, for any vertex v ofdegree 3, at least two among its adjacent vertices, say w , w ′ , are such that ℓ ( w ) < ℓ ( v ) <ℓ ( w ′ ) . Then an orientable closed surface M of genus g = m, and a simple Morse functionf : M → R exist such that ( G f , ℓ f ) ∼ = ( G , ℓ ) .Proof. Under our assumption on the degree of vertices of G , M and f can be constructedas in the proof of Thm. 2.1 in [17]. (cid:3) We now deal with the uniqueness problem, up to isomorphism of labeled Reeb graphs.First of all we consider the following two equivalence relations on F ( M ) . Definition 1.6.
Let D ( M ) be the set of self-diffeomorphisms of M . Two functions f , g ∈ F ( M ) are called right-equivalent (briefly, R-equivalent ) if there exists x ∈ D ( M ) suchthat f = g ◦ x . Moreover, f , g are called right-left equivalent (briefly, RL-equivalent ) ifthere exist x ∈ D ( M ) and an orientation preserving self-diffeomorphism h of R such that f = h ◦ g ◦ x .These equivalence relations on functions are mirrored by Reeb graphs isomorphisms. Proposition 1.7 (Uniqueness Theorem) . If f , g ∈ F ( M ) , then(1) f and g are RL-equivalent if and only if their Reeb graphs G f and G g are isomor-phic by an isomorphism F : V ( G f ) → V ( G g ) that preserves the vertex order, i.e.,for every v , w ∈ V ( G f ) , ℓ f ( v ) < ℓ f ( w ) if and only if ℓ g ( F ( v )) < ℓ g ( F ( w )) ;(2) f and g are R-equivalent if and only if their labeled Reeb graphs ( G f , ℓ f ) and ( G g , ℓ g ) are isomorphic.Proof. For the proof of statement (1) see [15, 22]. As for statement (2), we note that two R -equivalent functions are, in particular, RL -equivalent. Hence, by statement (1), theirReeb graphs are isomorphic by an isomorphism that preserves the vertex order. Since f and g necessarily have the same critical values, this isomorphism also preserves labels.Vice-versa, if ( G f , ℓ f ) and ( G g , ℓ g ) are isomorphic, then f and g have the same criticalvalues. Moreover, by statement (1), there exist x ∈ D ( M ) and an orientation preservingself-diffeomorphism h of R such that f = h ◦ g ◦ x . Let us set h = g ◦ x . The function h belongs to F ( M ) and has the same critical points with the same indexes as f , and thesame critical values as g and hence as f . Thus, we can apply [14, Lemma 1] to f and h and deduce the existence of a self-diffeomorphism x ′ of M such that f = h ◦ x ′ . Thus f = g ◦ x ◦ x ′ , yielding that f and g are R -equivalent. A direct proof of the R -equivalenceof functions with isomorphic labeled Reeb graphs is also obtainable from Lemma 5.3. (cid:3) EDIT DEFORMATIONS BETWEEN LABELED R EEB GRAPHS
In this section we list the edit deformations admissible to transform labeled Reeb graphsinto one another when different simple Morse functions on the same surface are considered.We introduce at first elementary deformations, then, by virtue of the Realization Theorem(Proposition 1.5), the deformations obtained by their composition.Elementary deformations allow us to insert or delete a vertex of degree 1 together withan adjacent vertex of degree 3 (deformations of birth type (B) and death type (D)), maintainthe same vertices and edges while changing the vertex labels (deformations of relabeling type (R)), or change some vertices adjacencies and labels (deformations of type (K ), (K ),(K ) introduced by Kudryavtseva in [13]). A sketch of these elementary deformations canbe found in Table 1. The formal definition is as follows. B. DI FABIO AND C. LANDI
Definition 2.1.
With the convention of denoting the open interval with endpoints a , b ∈ R by ] a , b [ , the elementary deformations of type (B), (D), (R), (K i ), i = , ,
3, are defined asfollows.(B) T is an elementary deformation of ( G f , ℓ f ) of type (B) if, for a fixed edge e ( v , v ) ∈ E ( G f ) , with ℓ f ( v ) < ℓ f ( v ) , T ( G f , ℓ f ) is a labeled graph ( G , ℓ ) such that – V ( G ) = V ( G f ) ∪ { u , u } ; – E ( G ) = (cid:0) E ( G f ) − { e ( v , v ) } (cid:1) ∪ { e ( v , u ) , e ( u , u ) , e ( u , v ) } ; – ℓ | V ( G f ) = ℓ f and ℓ f ( v ) < ℓ ( u i ) < ℓ ( u j ) < ℓ f ( v ) , with ℓ − (] ℓ ( u i ) , ℓ ( u j )[) = /0, i , j ∈ { , } , i = j .(D) T is an elementary deformation of ( G f , ℓ f ) of type (D) if, for fixed edges e ( v , u ) , e ( u , u ) , e ( u , v ) ∈ E ( G f ) , u being of degree 1, such that ℓ f ( v ) < ℓ f ( u i ) < ℓ f ( u j ) <ℓ f ( v ) , with ℓ − f (] ℓ f ( u i ) , ℓ f ( u j )[) = /0, i , j ∈ { , } , i = j , T ( G f , ℓ f ) is a labeled graph ( G , ℓ ) such that – V ( G ) = V ( G f ) − { u , u } ; – E ( G ) = (cid:0) E ( G f ) − { e ( v , u ) , e ( u , u ) , e ( u , v ) } (cid:1) ∪ { e ( v , v ) } ; – ℓ = ℓ f | V ( G f ) −{ u , u } .(R) T is an elementary deformation of ( G f , ℓ f ) of type (R) if T ( G f , ℓ f ) is a labeled graph ( G , ℓ ) such that – G = G f ; – ℓ : V ( G ) → R induces the same vertex-order as ℓ f except for at most two non-adjacent vertices, say u , u , with ℓ f ( u ) < ℓ f ( u ) and ℓ − f (] ℓ f ( u ) , ℓ f ( u )[) = /0,for which ℓ ( u ) > ℓ ( u ) and ℓ − (] ℓ ( u ) , ℓ ( u )[) = /0.(K ) T is an elementary deformation of ( G f , ℓ f ) of type (K ) if, for fixed edges e ( v , u ) , e ( u , u ) , e ( u , v ) , e ( u , v ) , e ( u , v ) ∈ E ( G f ) , with two among v , v , v possibly co-incident, ℓ f ( v ) < ℓ f ( u ) < ℓ f ( u ) < ℓ f ( v ) , ℓ f ( v ) , ℓ f ( v ) , and ℓ − f (] ℓ f ( u ) , ℓ f ( u )[) = /0 (resp. ℓ f ( v ) , ℓ f ( v ) , ℓ f ( v ) < ℓ f ( u ) < ℓ f ( u ) < ℓ f ( v ) , and ℓ − f (] ℓ f ( u ) , ℓ f ( u )[) = /0), T ( G f , ℓ f ) is a labeled graph ( G , ℓ ) such that: – V ( G ) = V ( G f ) ; – E ( G ) = (cid:0) E ( G f ) − { e ( v , u ) , e ( u , v ) } (cid:1) ∪ { e ( v , u ) , e ( u , v ) } ; – ℓ | V ( G ) −{ u , u } = ℓ f and ℓ f ( v ) < ℓ ( u ) < ℓ ( u ) < ℓ f ( v ) , ℓ f ( v ) , ℓ f ( v ) , with ℓ − (] ℓ ( u ) , ℓ ( u )[) = /0 (resp. ℓ f ( v ) , ℓ f ( v ) , ℓ f ( v ) < ℓ ( u ) < ℓ ( u ) < ℓ f ( v ) ,with ℓ − (] ℓ ( u ) , ℓ ( u )[) = /0).(K ) T is an elementary deformation of ( G f , ℓ f ) of type (K ) if, for fixed edges e ( v , u ) , e ( v , u ) , e ( u , u ) , e ( u , v ) , e ( u , v ) ∈ E ( G f ) , with u , u of degree 3, v , v pos-sibly coincident with v , v , respectively, and ℓ f ( v ) , ℓ f ( v ) < ℓ f ( u ) < ℓ f ( u ) <ℓ f ( v ) , ℓ f ( v ) , with ℓ − f (] ℓ f ( u ) , ℓ f ( u )[) = /0, T ( G f , ℓ f ) is a labeled graph ( G , ℓ ) suchthat: – V ( G ) = V ( G f ) ; – E ( G ) = (cid:0) E ( G f ) − { e ( v , u ) , e ( u , v ) } (cid:1) ∪ { e ( v , u ) , e ( u , v ) } ; – ℓ | V ( G ) −{ u , u } = ℓ f and ℓ f ( v ) , ℓ f ( v ) < ℓ ( u ) < ℓ ( u ) < ℓ f ( v ) , ℓ f ( v ) , with ℓ − (] ℓ ( u ) , ℓ ( u )[) = /0.(K ) T is an elementary deformation of ( G f , ℓ f ) of type (K ) if, for fixed edges e ( v , u ) , e ( u , u ) , e ( v , u ) , e ( u , v ) , e ( u , v ) ∈ E ( G f ) , with u , u of degree 3, v , v possiblycoincident with v , v , respectively, and ℓ f ( v ) , ℓ f ( v ) < ℓ f ( u ) < ℓ f ( u ) < ℓ f ( v ) , ℓ f ( v ) ,with ℓ − f (] ℓ f ( u ) , ℓ f ( u )[) = /0, T ( G f , ℓ f ) is a labeled graph ( G , ℓ ) such that: – V ( G ) = V ( G f ) ; HE EDIT DISTANCE FOR REEB GRAPHS OF SURFACES 7 – E ( G ) = (cid:0) E ( G f ) − { e ( v , u ) , e ( u , v ) } (cid:1) ∪ { e ( v , u ) , e ( u , v ) } ; – ℓ | V ( G ) −{ u , u } = ℓ f and ℓ f ( v ) , ℓ f ( v ) < ℓ ( u ) < ℓ ( u ) < ℓ f ( v ) , ℓ f ( v ) , with ℓ − (] ℓ ( u ) , ℓ ( u )[) = /0.PSfrag replacements ℓ f ( v ) ℓ f ( v ) ℓ f ( v ) ℓ f ( v ) ℓ ( u ) ℓ ( u ) ℓ ( u ) ℓ ( u ) ℓ f ( v ) ℓ f ( v ) ℓ f ( v ) ℓ f ( v ) ℓ f ( u ) ℓ f ( u ) ℓ f ( v ) ℓ ( v ) ℓ ( v ) ℓ f ( v ) ℓ ( v ) ℓ ( v ) ℓ f ( v ) ℓ ( v ) ℓ ( v ) ℓ f ( v ) ℓ f ( v ) ℓ ( v ) ℓ ( v ) ℓ f ( v ) (B)(B) (D)(D)(R)(R )(K )(K )(K )(K )(K )PSfrag replacements ℓ f ( v ) ℓ ( u ) ℓ ( u ) ℓ f ( v ) ℓ f ( u ) ℓ f ( u ) ℓ f ( v ) ℓ ( v ) ℓ ( v ) ℓ f ( v ) ℓ ( v ) ℓ ( v ) ℓ f ( v ) ℓ ( v ) ℓ ( v ) ℓ f ( v ) ℓ f ( v ) ℓ ( v ) ℓ ( v ) ℓ f ( v ) (B)(D) (R)(R )(K )(K )(K )(K )(K )PSfrag replacements ℓ f ( v ) ℓ f ( v ) ℓ f ( v ) ℓ f ( v ) ℓ ( u ) ℓ ( u ) ℓ ( u ) ℓ ( u ) ℓ f ( v ) ℓ f ( v ) ℓ f ( v ) ℓ f ( v ) ℓ f ( u ) ℓ f ( u ) ℓ f ( u ) ℓ f ( u ) ℓ f ( v ) ℓ f ( v ) ℓ f ( v ) ℓ f ( v ) ℓ ( v ) ℓ ( v ) ℓ f ( v ) ℓ f ( v ) ℓ f ( v ) ℓ f ( v ) ℓ ( v ) ℓ ( v ) ℓ f ( v ) ℓ ( v ) ℓ ( v ) ℓ f ( v ) ℓ f ( v ) ℓ ( v ) ℓ ( v ) ℓ f ( v ) (B)(D)(R)(R ) (K )(K )(K )(K )(K )(K )PSfrag replacements ℓ f ( v ) ℓ f ( v ) ℓ ( u ) ℓ ( u ) ℓ f ( v ) ℓ f ( v ) ℓ f ( u ) ℓ f ( u ) ℓ f ( v ) ℓ f ( v ) ℓ ( v ) ℓ ( v ) ℓ f ( v ) ℓ f ( v ) ℓ ( v ) ℓ ( v ) ℓ f ( v ) ℓ ( v ) ℓ ( v ) ℓ f ( v ) ℓ f ( v ) ℓ ( v ) ℓ ( v ) ℓ f ( v ) (B)(D)(R)(R )(K )(K )(K ) (K )(K )T ABLE A schematization of the elementary deformations of a labeled Reeb graphprovided by Definition 2.1.
We underline that the definition of the deformations of type (B), (D) and (R) is essen-tially different from the definition of analogous deformations in the case of Reeb graphs ofcurves as given in [7], even if the associated cost will be the same (see Section 3). This isbecause the degree of the involved vertices is 2 for Reeb graphs of closed curves, whereasit is 1 or 3 for Reeb graphs of surfaces.
Proposition 2.2.
Let f ∈ F ( M ) and ( G , ℓ ) = T ( G f , ℓ f ) for some elementary deformationT . Then there exists g ∈ F ( M ) such that ( G g , ℓ g ) ∼ = ( G , ℓ ) .Proof. The claim follows from Proposition 1.5. (cid:3)
As a consequence of Proposition 2.2, we can apply elementary deformations iteratively.This fact is used in the next Definition 2.3. Given an elementary deformation T of ( G f , ℓ f ) B. DI FABIO AND C. LANDI and an elementary deformation S of T ( G f , ℓ f ) , the juxtaposition ST means applying first T and then S . Definition 2.3.
We shall call deformation of ( G f , ℓ f ) any finite ordered sequence T =( T , T , . . . , T r ) of elementary deformations such that T is an elementary deformation of ( G f , ℓ f ) , T is an elementary deformation of T ( G f , ℓ f ) , ..., T r is an elementary deforma-tion of T r − T r − · · · T ( G f , ℓ f ) . We shall denote by T ( G f , ℓ f ) the result of the deformation T r T r − · · · T applied to ( G f , ℓ f ) .In the rest of the paper we write T (( G f , ℓ f ) , ( G g , ℓ g )) to denote the set of deformationsturning ( G f , ℓ f ) into ( G g , ℓ g ) up to isomorphism: T (( G f , ℓ f ) , ( G g , ℓ g )) = { T = ( T , . . . , T n ) , n ≥ T ( G f , ℓ f ) ∼ = ( G g , ℓ g ) } . We now introduce the concept of inverse deformation.
Definition 2.4.
Let T ∈ T (( G f , ℓ f ) , ( G g , ℓ g )) and let F be the labeled graph isomor-phism between T ( G f , ℓ f ) and ( G g , ℓ g ) . We denote by T − , and call it the inverse of T in T (( G g , ℓ g ) , ( G f , ℓ f )) , the deformation that acts on the vertices, edges, and labels of ( G g , ℓ g ) as follows: identifying T ( G f , ℓ f ) with ( G g , ℓ g ) via F , • if T is an elementary deformation of type (D) deleting two vertices, then T − is oftype (B) inserting the same vertices, with the same labels, and viceversa; • if T is an elementary deformation of type (R) relabeling vertices of V ( G f ) , then T − is again of type (R) relabeling these vertices in the inverse way; • if T is an elementary deformation of type (K ) relabeling two vertices, then T − is again of type (K ) relabeling the same vertices in the inverse way; • if T is an elementary deformation of type (K ) relabeling two vertices, then T − is of type (K ) relabeling the same vertices in the inverse way, and viceversa; • if T = ( T , . . . , T r ) , then T − = ( T − r , . . . , T − ) .From the fact that T − T ( G f , ℓ f ) ∼ = ( G f , ℓ f ) it follows that the set T (( G f , ℓ f ) , ( G g , ℓ g )) ,when non-empty, always contains infinitely many deformations. We end the section prov-ing that for f , g ∈ F ( M ) it is always non-empty. We first need two lemmas which arewidely inspired by [13, Lemma 1 and Thm. 1], respectively. Lemma 2.5.
Let ( G f , ℓ f ) be a labeled Reeb graph. The following statements hold: ( i ) For any u , v ∈ V ( G f ) corresponding to two minima or two maxima of f , there existsa deformation T such that u and v are adjacent to the same vertex w in T ( G f , ℓ f ) . ( ii ) For any m-cycle C in G f , m ≥ , there exists a deformation T such that C is a2-cycle in T ( G f , ℓ f ) .Proof. Let us prove statement ( i ) assuming that in ( G f , ℓ f ) there exist two vertices u , v corresponding to two minima of f . The case of maxima is analogous.Let us consider a path g on G f having u , v as endpoints, whose length is m ≥
2, and thefinite sequence of vertices through which it passes is ( w , w , . . . , w m ) , with w = u , w m = v ,and w i = w j for i = j . We aim at showing that there exists a deformation T such that in T ( G f , ℓ f ) the vertices u , v are adjacent to the same vertex w , with w ∈ { w , . . . , w m − } , andthus the path g is transformed by T into a path g ′ which is of length 2 and passes throughthe vertices u , w , v .If m =
2, then it is sufficient to take T as the deformation of type (R) such that T ( G f , ℓ f ) =( G f , ℓ f ) since g already coincides with g ′ . If m >
2, let w i = argmax { ℓ f ( w j ) : w j with 0 ≤ j ≤ m } . It holds that w i = u , v because u , v are minima of f and is unique because f HE EDIT DISTANCE FOR REEB GRAPHS OF SURFACES 9 is simple. It is easy to observe that, in a neighborhood of w i , possibly after a finite se-quence of deformations of type (R), the graph gets one of the configurations shown inFigure 3 ( a ) − ( e ) (left).PSfrag replacements w i w i w i + w i + w i − w i − w i − w i − w i − ww (K ) (K ) PSfrag replacements w i w i w i + w i + w i − w i − w i − w i − w i − w w (K )(K ) ( a ) ( b ) PSfrag replacements w i w i w i w i + w i + w i + w i − w i − w i − w i − w i − w i − w i − w i − w i − w w w (K ) (K )(K ) ( c ) PSfrag replacements w i w i w i w i + w i + w i + w i − w i − w i − w i − w i − w i − w i − w i − w i − ww w (K ) (K ) ( d ) PSfrag replacements w i w i w i + w i + w i − w i − w i − w i − w i − w i − w w (K ) (K ) ( e ) F IGURE Possible configurations of a simple path on a labeled Reeb graph in a neigh-borhood of its maximum point, and elementary deformations which reduce its length. Tofacilitate the reader, f has been represented as the height function, so that ℓ f ( w a ) < ℓ f ( w b ) if and only if w a is lower than w b in the pictures. The same figure shows that a finite sequence of deformations of type (K ), (K ), and,possibly, (R) transforms the simple path g , which has length m , into a simple path of length m −
1. Iterating this procedure, we deduce the desired claim.The proof of statement ( ii ) is analogous to that of statement ( i ) , provided that g istaken to be an m -cycle with u ≡ v of degree 3, and u = argmin { ℓ f ( w j ) : w j with 0 ≤ j ≤ m − } . (cid:3) Lemma 2.6.
Every labeled Reeb graph ( G f , ℓ f ) can be transformed into a canonical onethrough a finite sequence of elementary deformations.Proof. Our proof is in two steps: first we show how to transform an arbitrary Reeb graphinto a minimal one; then how to reduce a minimal Reeb graph to the canonical form.The first step is by induction on s = p + q , with p and q denoting the number of minimaand maxima of f . If s =
2, then G f is already minimal (see Definition 1.3). Let us assumethat any Reeb graph with s ≥ G f have s + p and q is greater than one. Let p > q > ( i ) , if u , v correspond to two minima of f , we can construct a deformation T such that in T ( G f , ℓ f ) these vertices are both adjacent to a certain vertex w of degree 3. Let T ( G f , ℓ f ) = ( G , ℓ ) , with ℓ ( u ) < ℓ ( v ) < ℓ ( w ) . If there exists a vertex w ′ ∈ ℓ − (] ℓ ( v ) , ℓ ( w )[) ,since v , w ′ cannot be adjacent, we can apply a deformation of type (R) relabeling only v , and get a new labeling ℓ ′ such that ℓ ′ ( w ′ ) is not contained in ] ℓ ′ ( v ) , ℓ ′ ( w )[ . Possiblyrepeating this procedure finitely many times, we get a new labeling, that for simplicity westill denote by ℓ , such that ℓ − (] ℓ ( v ) , ℓ ( w )[) = /0. Hence, through a deformation of type (D)deleting v , w , the resulting labeled Reeb graph has s vertices of degree 1. By the inductivehypothesis, it can be transformed into a minimal Reeb graph.Now we prove the second step. Let G f be a minimal Reeb Graph, i.e. p = q =
1. Thetotal number of splitting saddles (i.e. vertices of degree 3 for which there are two higheradjacent vertices) of G f is g . If g =
0, then G f is already canonical. Let us consider thecase g ≥
1. Let v ∈ V ( G f ) be a splitting saddle such that, for every cycle C containing v , ℓ f ( v ) = min w ∈ C { ℓ f ( w ) } , and let C be one of these cycles. By Lemma 2.5 ( ii ) , there exists adeformation T that transforms C into a 2-cycle, still having v as the lowest vertex. Let v ′ be the highest vertex in this 2-cycle. We observe that no other cycles of T ( G f , ℓ f ) contain v and v ′ , otherwise the initial assumption on ℓ f ( v ) would be contradicted. Hence v , v ′ andthe edges adjacent to them are not touched when applying again Lemma 2.5 ( ii ) to reducethe length of another cycle. Therefore, iterating the same argument on a different splittingsaddle, after at most g iterations (actually at most g − G f is transformedinto a canonical Reeb graph. (cid:3) Proposition 2.7.
Let f , g ∈ F ( M ) . The set T (( G f , ℓ f ) , ( G g , ℓ g )) is non-empty.Proof. By Lemma 2.6 we can find two deformations T f and T g transforming ( G f , ℓ f ) and ( G g , ℓ g ) , respectively, into canonical Reeb graphs. Apart from the labels, G f and G g areisomorphic because associated with the same surface M . Hence, T f ( G f , ℓ f ) can be trans-formed into a graph isomorphic to T g ( G g , ℓ g ) through an elementary deformation of type(R), say T R . Thus ( G g , ℓ g ) ∼ = T − g T R T f ( G f , ℓ f ) , i.e. T − g T R T f ∈ T (( G f , ℓ f ) , ( G g , ℓ g )) . (cid:3) A simple example illustrating the above proof is given in Figure 4.3.
EDIT DISTANCE BETWEEN LABELED R EEB GRAPHS
In this section we introduce an edit distance between labeled Reeb graphs, in terms ofthe cost necessary to transform one graph into another.We begin by defining the cost of a deformation. For the sake of simplicity, in view ofProposition 2.2, whenever ( G g , ℓ g ) ∼ = ( G , ℓ ) , we identify V ( G g ) with V ( G ) , and ℓ g with ℓ .For all the notation referring to the elementary deformations, see Definition 2.1. Definition 3.1.
Let T ∈ T (( G f , ℓ f ) , ( G g , ℓ g )) be a deformation. HE EDIT DISTANCE FOR REEB GRAPHS OF SURFACES 11
PSfrag replacements ( G f , ℓ f )( G g , ℓ g ) (R) (K )(K )(K )(K )(K ) (K ) (D)(D) (B)F IGURE Using the procedure followed in the proof of Proposition 2.7, the leftmostlabeled Reeb graph is transformed into the rightmost one applying first the deformationwhich reduces the former into its canonical form, then an elementary deformation of type(R), and eventually the inverse of the deformation which reduces the latter into its canonicalform. • For T elementary of type (B), inserting the vertices u , u ∈ V ( G g ) , the associatedcost is c ( T ) = | ℓ g ( u ) − ℓ g ( u ) | . • For T elementary of type (D), deleting the vertices u , u ∈ V ( G f ) , the associatedcost is c ( T ) = | ℓ f ( u ) − ℓ f ( u ) | . • For T elementary of type (R), relabeling the vertices v ∈ V ( G f ) = V ( G g ) , the as-sociated cost is c ( T ) = max v ∈ V ( G f ) | ℓ f ( v ) − ℓ g ( v ) | . • For T elementary of type (K i ), with i = , ,
3, relabeling the vertices u , u ∈ V ( G f ) , the associated cost is c ( T ) = max {| ℓ f ( u ) − ℓ g ( u ) | , | ℓ f ( u ) − ℓ g ( u ) |} . • For T ∈ T (( G f , ℓ f ) , ( G g , ℓ g )) , with T = ( T , . . . , T r ) , the associated cost is c ( T ) = r (cid:229) i = c ( T i ) . Proposition 3.2.
For every deformation T ∈ T (( G f , ℓ f ) , ( G g , ℓ g )) , c ( T − ) = c ( T ) .Proof. It is sufficient to observe that, for every deformation T = ( T , . . . , T r ) such that T ( G f , ℓ f ) ∼ = ( G g , ℓ g ) , Definitions 3.1 and 2.4 imply the following equalities: c ( T ) = r (cid:229) i = c ( T i ) = r (cid:229) i = c ( T − i ) = c ( T − ) . (cid:3) Theorem 3.3.
For every f , g ∈ F ( M ) , we setd E (( G f , ℓ f ) , ( G g , ℓ g )) = inf T ∈ T (( G f ,ℓ f ) , ( G g ,ℓ g )) c ( T ) . It holds that d E is a pseudo-metric on isomorphism classes of labeled Reeb graphs.Proof. By Proposition 2.7, d E is a real number. The coincidence property can be veri-fied by observing that the deformation of type (R) such that T ( G f , ℓ f ) = ( G f , ℓ f ) has acost equal to 0; the symmetry property is a consequence of Proposition 3.2; the triangleinequality can be proved in the standard way. (cid:3) In order to say that d E is actually a metric, we need to prove that if d E (( G f , ℓ f ) , ( G g , ℓ g )) vanishes then ( G f , ℓ f ) ∼ = ( G g , ℓ g ) . This will be done in Section 5. Nevertheless, for sim-plicity, we already refer to d E as to the edit distance .The following proposition shows that when a labeled Reeb graph can be transformedinto another one through a finite sequence of deformations of type (D), the same trans-formation can be realized also through a cheaper deformation which involves a relabelingof vertices. Analogous propositions can be given for other types of deformations. Theseresults yield, in some cases, sharper estimates of the edit distance between labeled Reebgraphs. Proposition 3.4.
For T ∈ T (( G f , ℓ f ) , ( G g , ℓ g )) , if T = ( T , . . . , T n ) and T i is an elemen-tary deformation of type (D) for each i = , . . . , n, then there exists a deformation S ∈ T (( G f , ℓ f ) , ( G g , ℓ g )) , with S = ( S , S . . . , S n ) such that S is an elementary deformationof type (R), S , . . . , S n are elementary deformations of type (D), and c ( S ) = max i = ,..., n c ( T i ) .Hence c ( S ) < c ( T ) when n > .Proof. Let T = ( T , . . . , T n ) , with each T i of type (D), and let v i , w i be the vertices of G f deleted by T i . It is not restrictive to assume that ℓ f ( v i ) < ℓ f ( w i ) . For n =
1, it is suffi-cient to take S as the elementary deformation of type (R) such that S ( G f , ℓ f ) = ( G f , ℓ f ) and S = T . For n >
1, for every i , j with 1 ≤ i , j ≤ n , let us set T i (cid:22) T j if and only if [ ℓ f ( v i ) , ℓ f ( w i )] ⊆ [ ℓ f ( v j ) , ℓ f ( w j )] . Let us denote by T r , . . . , T r m the maximal elements ofthe poset ( { T , . . . , T n } , (cid:22) ) .We observe that, for 1 ≤ i ≤ n , there exists exactly one value k , with 1 ≤ k ≤ m , for which [ ℓ f ( v i ) , ℓ f ( w i )] ⊆ [ ℓ f ( v r k ) , ℓ f ( w r k )] . Moreover, [ ℓ f ( v i ) , ℓ f ( w i )] ∩ [ ℓ f ( v r h ) , ℓ f ( w r h )] = /0 forevery h = k because T i is an elementary deformation of type (D).To define S , we take ℓ : V ( G f ) → R as follows. Let 0 < e < min k = ,..., m ℓ f ( w r k ) − ℓ f ( v r k ) ≤ k ≤ m , we set ℓ ( v r k ) = ℓ f ( w r k ) + ℓ f ( v r k ) − e and ℓ ( w r k ) = ℓ f ( w r k ) + ℓ f ( v r k ) + e .Next, for 1 ≤ i ≤ n , assuming [ ℓ f ( v i ) , ℓ f ( w i )] ⊆ [ ℓ f ( v r k ) , ℓ f ( w r k )] , we let l i , m i ∈ [ , ] be the unique values for which ℓ f ( v i ) = ( − l i ) ℓ f ( v r k ) + l i ℓ f ( w r k ) and ℓ f ( w i ) = ( − m i ) ℓ f ( v r k ) + m i ℓ f ( w r k ) , and we set ℓ ( v i ) = ( − l i ) ℓ ( v r k ) + l i ℓ ( w r k ) and ℓ ( w i ) = ( − m i ) ℓ ( v r k ) + m i ℓ ( w r k ) . We observe that ℓ preserves the vertex order induced by ℓ f and,therefore, S defined by setting S ( G f , ℓ f ) = ( G f , ℓ ) is an elementary deformation of type(R). By Definition 3.1, the cost of S is c ( S ) = max i = ,..., n (cid:8) max (cid:8)(cid:12)(cid:12) ℓ f ( v i ) − ℓ ( v i ) (cid:12)(cid:12) , (cid:12)(cid:12) ℓ f ( w i ) − ℓ ( w i ) (cid:12)(cid:12)(cid:9)(cid:9) . A direct computation shows that ℓ ( v i ) − ℓ f ( v i ) ≤ ℓ ( v r k ) − ℓ f ( v r k ) and ℓ f ( v i ) − ℓ ( v i ) ≤ ℓ f ( w r k ) − ℓ ( w r k ) . Analogously, ℓ ( w i ) − ℓ f ( w i ) ≤ ℓ ( v r k ) − ℓ f ( v r k ) and ℓ f ( w i ) − ℓ ( w i ) ≤ ℓ f ( w r k ) − ℓ ( w r k ) . Hence c ( S ) = max k = ,..., m (cid:8) max (cid:8) ℓ ( v r k ) − ℓ f ( v r k ) , ℓ f ( w r k ) − ℓ ( w r k ) (cid:9)(cid:9) = max k = ,..., m ℓ f ( w r k ) − ℓ f ( v r k ) − e = max k = ,..., m c ( T r k ) − e . (3.1)Now we set S i , for i = , . . . , n , to be the elementary deformation of type (D) that deletesthe vertices v i , w i from S ( G f , ℓ f ) . If [ ℓ f ( v i ) , ℓ f ( w i )] ⊆ [ ℓ f ( v r k ) , ℓ f ( w r k )] , then c ( S i ) = ℓ ( w i ) − ℓ ( v i ) ≤ ℓ ( w r k ) − ℓ ( v r k ) = e . (3.2) HE EDIT DISTANCE FOR REEB GRAPHS OF SURFACES 13
Setting S = ( S , S , . . . , S n ) , we have S ∈ T (( G f , ℓ f ) , ( G g , ℓ g )) , and by formulas (3.1)and (3.2): c ( S ) = c ( S ) + n (cid:229) i = c ( S i ) ≤ max k = ,..., m c ( T r k ) − e + n · e . Therefore, max k = ,..., m c ( T r k ) − e ≤ c ( S ) ≤ max k = ,..., m c ( T r k ) + ( n − ) e . By the arbitrariness of e ,we get c ( S ) = max k = ,..., m c ( T r k ) , yielding the claim. (cid:3)
4. S
TABILITY
This section is devoted to proving that Reeb graphs of orientable surfaces are stableunder function perturbations. More precisely, it will be shown that arbitrary changes insimple Morse functions with respect to the C -norm imply not greater changes in the editdistance between the associated labeled Reeb graphs. Formally: Theorem 4.1.
For every f , g ∈ F ( M ) , letting k f − g k C = max p ∈ M | f ( p ) − g ( p ) | , we haved E (( G f , ℓ f ) , ( G g , ℓ g )) ≤ k f − g k C . We observe that such a result is strictly related the way the cost of an elementary defor-mation of type (R) was defined as the following Example 1 shows.
Example 1.
Let f , g : M → R with f , g ∈ F ( M ) as illustrated in Figure 5.PSfrag replacements q p q p q p q q ′ p p ′ c c c c + ac + ac + a bb dd ( G f , ℓ f ) ( G g , ℓ g ) f g max z min z F IGURE The functions f , g ∈ F ( M ) considered in Example 1. Let f ( q i ) − f ( p i ) = a , i = , ,
3. Up to re-parameterization of M , we have k f − g k C = a . The deformation T that deletes the three edges e ( p i , q i ) ∈ E ( G f ) has cost c ( T ) = · a ,implying d E (( G f , ℓ f ) , ( G g , ℓ g )) ≤ ·k f − g k C . On the other hand, applying Proposition 3.4we see that actually d E (( G f , ℓ f ) , ( G g , ℓ g )) ≤ k f − g k C . Indeed, for every 0 < e < a , wecan apply to ( G f , ℓ f ) a deformation of type (R), that relabels the vertices p i , q i , i = , , ℓ f ( p i ) is increased by a − e , and ℓ f ( q i ) is decreased by a − e , composedwith three deformations of type (D) that delete p i , q i and the edge e ( p i , q i ) , for i = , , F ( M ) of smooth real-valued func-tions on M endowed with the C topology, which may be defined as follows. Let { U a } be a coordinate covering of M with coordinate maps j a : U a → R , and let { C a } be a com-pact refinement of { U a } . For every positive constant d > f ∈ F ( M ) , define N ( f , d ) as the subset of F ( M ) consisting of all maps g such that, denoting f a = f ◦ j − a and g a = g ◦ j − a , it holds that max i + j ≤ (cid:12)(cid:12)(cid:12) ¶ i + j ¶ x i ¶ y j ( f a − g a ) (cid:12)(cid:12)(cid:12) < d at all points of j a ( C a ) . The C topology is the topology obtained by taking the sets N ( f , d ) as a base of neighborhoods.Next we consider the strata F ( M ) and F ( M ) of the natural stratification of F ( M ) ,as presented by Cerf in [4]. • The stratum F ( M ) is the set of simple Morse functions. • The stratum F ( M ) is the disjoint union of two sets F a ( M ) and F b ( M ) , where – F a ( M ) is the set of functions whose critical levels contain exactly one crit-ical point, and the critical points are all non-degenerate, except exactly one. – F b ( M ) is the set of Morse functions whose critical levels contain at mostone critical point, except for one level containing exactly two critical points. F ( M ) is a sub-manifold of co-dimension 1 of F ( M ) ∪ F ( M ) , and the comple-ment of F ( M ) ∪ F ( M ) in F ( M ) is of co-dimension greater than 1. Hence, giventwo functions f , g ∈ F ( M ) , we can always find b f , b g ∈ F ( M ) arbitrarily near to f , g ,respectively, for which • b f , b g are RL-equivalent to f , g , respectively,and the path h ( l ) = ( − l ) b f + l b g , with l ∈ [ , ] , is such that • h ( l ) belongs to F ( M ) ∪ F ( M ) for every l ∈ [ , ] ; • h ( l ) is transversal to F ( M ) .As a consequence, h ( l ) belongs to F ( M ) for at most a finite collection of values l , anddoes not traverse strata of co-dimension greater than 1 (see, e.g., [9]).With these preliminaries set, the stability theorem will be proven by considering a paththat connects f to g via b f , h ( l ) , and b g as aforementioned. This path can be split into afinite number of linear sub-paths whose endpoints are such that the stability theorem holdson them, as will be shown in some preliminary lemmas. In conclusion, Theorem 4.1 willbe proven by applying the triangle inequality of the edit distance.In the following preliminary lemmas, f and g belong to F ( M ) and h : [ , ] → F ( M ) denotes their convex linear combination: h ( l ) = ( − l ) f + l g . Lemma 4.2. k h ( l ′ ) − h ( l ′′ ) k C = | l ′ − l ′′ | · k f − g k C for every l ′ , l ′′ ∈ [ , ] .Proof. k h ( l ′ ) − h ( l ′′ ) k C = k ( − l ′ ) f + l ′ g − ( − l ′′ ) f − l ′′ g k C = k ( l ′′ − l ′ ) f − ( l ′′ − l ′ ) g k C = | l ′ − l ′′ | · k f − g k C . (cid:3) Lemma 4.3.
If h ( l ) ∈ F ( M ) for every l ∈ [ , ] , then d E (( G f , ℓ f ) , ( G g , ℓ g )) ≤ k f − g k C . Proof.
The statement can be proved in the same way as [7, Prop. 5.4]. (cid:3)
Lemma 4.4.
Let h ( l ) intersect F ( M ) transversely at h ( l ) , < l < , and nowhereelse. Then, for every constant value d > , there exist two real numbers l ′ , l ′′ with < l ′ < l < l ′′ < , such thatd E (( G h ( l ′ ) , ℓ h ( l ′ ) ) , ( G h ( l ′′ ) , ℓ h ( l ′′ ) )) ≤ d . HE EDIT DISTANCE FOR REEB GRAPHS OF SURFACES 15
Proof.
In this proof we use the notion of universal deformation of a function. More detailson universal deformations may be found in [16, 21]. In particular, we will consider twodifferent universal deformations F and G of h = h ( l ) . Firstly we show how F and G yieldthe claim, and then construct them.We use the fact that, being two universal deformations of h ∈ F ( M ) , F and G areequivalent. This means that there exist a diffeomorphism h ( s ) of R with h ( ) =
0, and a lo-cal diffeomorphism f ( s , ( x , y )) , with f ( s , ( x , y )) = ( h ( s ) , y ( h ( s ) , ( x , y ))) and f ( , ( x , y )) =( , ( x , y )) , such that F = ( h ∗ G ) ◦ f . Hence, apart from the labels, the Reeb graphs of F ( s , · ) and G ( h ( s ) , · ) are isomorphic. Moreover, the difference the labels at corresponding ver-tices in the Reeb graphs of F ( s , · ) and G ( h ( s ) , · ) continuously depends on s , and is 0 for s =
0. Therefore, for every d >
0, taking | s | sufficiently small, it is possible to transformthe labeled Reeb graph of F ( s , · ) into that of G ( h ( s ) , · ) , or viceversa, by a deformation oftype (R) whose cost is not greater than d /
3. Moreover, as equality (4.3) will show, forevery d > | s | can be taken sufficiently small that the distance between the labeled Reebgraphs of G ( h ( s ) , · ) and G ( h ( − s ) , · ) is not greater that d /
3. Thus, applying the triangleinequality, we deduce that, for every d >
0, there exists a sufficiently small s > F ( s , · ) and F ( − s , · ) is not greater than d .The claim follows taking l ′ = l − s and l ′′ = l + s .We now construct the universal deformations F ( s , p ) and G ( s , p ) , with s ∈ R and p ∈ M . We define F by setting F ( s , p ) = h ( p ) + s · ( g − f )( p ) . This deformation is universalbecause h ( l ) intersects F ( M ) transversely at h ( l ) . In order to construct G , let us con-sider separately the two cases F a ( M ) and F b ( M ) . Case h ∈ F a ( M ) : Let p be the sole degenerate critical point of h . Let ( x , y ) bea suitable local coordinate system around p in which the canonical expression of h is h ( x , y ) = h ( p ) ± x + y . Let w : M → R be a smooth function equal to 1 in a neighbor-PSfrag replacements h = G ( , · ) G ( h , · ) , h > G ( h , · ) , h < pq F IGURE Center: A function h ∈ F a ( M ) ; left-right: The universal deformation G ( h , · ) with the associated labeled Reeb graphs for h < h > hood of p , which decreases moving from p , and whose support is contained in the chosencoordinate chart around p . Finally, let G ( h , ( x , y )) = h ( x , y ) − h · w ( x , y ) · y , where h ∈ R .For h < G ( h , · ) has no critical points in the support of w and is equal to h everywhereelse, while, for h > G ( h , · ) has exactly two critical points in the support of w , precisely p = (cid:16) , − q h (cid:17) and p = (cid:16) , q h (cid:17) , and is equal to h everywhere else (see Figure 6).Therefore, for every h > G ( − h , · ) can betransformed into that of G ( h , · ) by an elementary deformation T of type (B). Obviously, inthe case h <
0, the deformation we consider is of type (D).By Definition 3.1 and Proposition 3.2, a direct computation shows that the cost of T is c ( T ) = · (cid:18) | h | (cid:19) / . (4.1) Case h ∈ F b ( M ) : Let p and q be the critical points of h such that h ( p ) = h ( q ) . Since p is non-degenerate, there exists a suitable local coordinate system ( x , y ) around p in whichthe canonical expression of h is h ( x , y ) = h ( p ) + x + y if p is a minimum, or h ( x , y ) = h ( p ) − x − y if p is a maximum, or h ( x , y ) = h ( p ) ± x ∓ y if p is a saddle point. Let w : M → R be a smooth function equal to 1 in a neighborhood of p , which decreasesmoving from p , and whose support is contained in the coordinate chart around p in which h has one of the above expressions. Finally, let G ( h , ( x , y )) = h ( x , y ) + h · w ( x , y ) , where h = h ( s ) , s ∈ R . For every h ∈ R , with | h | sufficiently small, G ( h , · ) has the same criticalpoints, with the same indices, as h . As for critical values, they are the same as well, apartfrom the value taken at p : G ( h , p ) = h ( p ) + h .We distinguish the following two situations illustrated in Figures 7 and 8:(1) the points p and q belong to two different connected components of h − ( h ( p )) ;PSfrag replacements p q e f (K ) PSfrag replacements p q e f (K ) PSfrag replacements p q e f (K )F IGURE Two critical points in different connected components of the same criticallevel. The dark (resp. light) regions correspond to points below (resp. above) this criticallevel. Possibly inverting the colors of one or both the components, we have all the possiblecases. (2) the points p and q belong to the same connected component of h − ( h ( p )) .In the situation (1), for every h > G ( − h , · ) and G ( h , · ) can be obtained one from the other through an elementary defor-mation T of type (R) (see, e.g., Figure 9).In the situation (2), the following elementary deformations need to be considered: • If p and q are as in Figure 8 ( a ) , then, for every h > G ( − h , · ) and G ( h , · ) can be obtained one from the otherthrough an elementary deformation T of type (K ) (see, e.g., Figure 10). • If p and q are as in Figure 8 ( b ) , then, for every h > G ( − h , · ) and G ( h , · ) can be obtained one from the otherthrough an elementary deformation T of type (K ) or (K ) (see, e.g., Figure 11). HE EDIT DISTANCE FOR REEB GRAPHS OF SURFACES 17
PSfrag replacements ( a )( b )( c )( d ) p q PSfrag replacements ( a ) ( b )( c )( d ) p q PSfrag replacements ( a )( b ) ( c )( d ) p q PSfrag replacements ( a )( b )( c ) ( d ) p q F IGURE Two critical points in the same connected component of the same criticallevel. The dark (resp. light) regions correspond to points below (resp. above) this criticallevel. Possibly inverting the colors of this component, we have all the possible cases.
PSfrag replacements h = G ( , · ) G ( h , · ) , h > G ( h , · ) , h < ) pq F IGURE Center: A function h ∈ F b ( M ) as in case (1); left-right: The universaldeformation G ( h , · ) with the associated labeled Reeb graphs for h < h > • If p and q are as in Figure 8 ( c ) or ( d ) , then, for every h > G ( − h , · ) and G ( h , · ) can be obtained one from the otherthrough an elementary deformation T of type (R) (see, e.g., Figures 12-13).In all the cases, for every h > T is: c ( T ) = | h ( p ) − h − ( h ( p ) + h ) | = h . (4.2) In conclusion, from equalities (4.1) and (4.2), for every h > d E (( G G ( − h , · ) , ℓ G ( − h , · ) ) , ( G G ( h , · ) , ℓ G ( h , · ) )) ≤ max (cid:26) · (cid:16) h (cid:17) / , h (cid:27) . Thus, for every d >
0, we can always take a value | s | sufficiently small that | h ( s ) | resultssmall enough to imply the following inequality: d E (( G G ( − h ( s ) , · ) , ℓ G ( − h ( s ) , · ) ) , ( G G ( h ( s ) , · ) , ℓ G ( h ( s ) , · ) )) ≤ d / . (4.3) (cid:3) Lemma 4.5.
If h ( l ) belongs to F ( M ) for every l ∈ [ , ] apart from one value < l < at which h transversely intersects F ( M ) , then d E (( G f , ℓ f ) , ( G g , ℓ g )) ≤ k f − g k C . Proof.
Let h = h ( l ) . By Lemma 4.4, for every real number d > < l ′ < l < l ′′ < d E (( G h ( l ′ ) , ℓ h ( l ′ ) ) , ( G h ( l ′′ ) , ℓ h ( l ′′ ) )) ≤ d . Applying the triangle inequality, we have: d E (( G f , ℓ f ) , ( G g , ℓ g )) ≤ d E (( G f , ℓ f ) , ( G h ( l ′ ) , ℓ h ( l ′ ) )) + d E (( G h ( l ′ ) , ℓ h ( l ′ ) ) , ( G h ( l ′′ ) , ℓ h ( l ′′ ) ))+ d E (( G h ( l ′′ ) , ℓ h ( l ′′ ) ) , ( G g , ℓ g )) . Moreover, we get d E (( G f , ℓ f ) , ( G h ( l ′ ) , ℓ h ( l ′ ) )) ≤ k f − h ( l ′ ) k C = l ′ · k f − g k C , and d E (( G h ( l ′′ ) , ℓ h ( l ′′ ) ) , ( G g , ℓ g )) ≤ k h ( l ′′ ) − g k C = ( − l ′′ ) · k f − g k C , where the inequalities follow from Lemma 4.3, and equalities from Lemma 4.2 with f = h ( ) , g = h ( ) . Hence, d E (( G f , ℓ f ) , ( G g , ℓ g )) ≤ ( + l ′ − l ′′ ) · k f − g k C + d . In conclusion, given that 0 < l ′ < l ′′ , the inequality d E (( G f , ℓ f ) , ( G g , ℓ g )) ≤ k f − g k C + d holds. This yields the claim by the arbitrariness of d . (cid:3) We are now ready to prove the stability Theorem 4.1.
Proof of Theorem 4.1.
Recall from [12] that F ( M ) is open in F ( M ) endowed with the C topology. Thus, for every sufficiently small real number d >
0, the neighborhoods N ( f , d ) and N ( g , d ) are contained in F ( M ) . Take b f ∈ N ( f , d ) and b g ∈ N ( g , d ) suchthat the path h : [ , ] → F ( M ) , with h ( l ) = ( − l ) b f + l b g , belongs to F ( M ) forevery l ∈ [ , ] , except for at most a finite number n of values, m , m , . . . , m n , at which h transversely intersects F ( M ) . We begin by proving our statement for b f and b g , and thenshow its validity for f and g . We proceed by induction on n . If n = n =
1, the inequality d E (( G b f , ℓ b f ) , ( G b g , ℓ b g )) ≤ k b f − b g k C holds because of Lemma 4.3 or 4.5, respectively. Let usassume the claim is true for n ≥
1, and prove it for n +
1. Let 0 < m < l < m < l < . . . < m n < l n < m n + <
1, with h ( ) = b f , h ( ) = b g , h ( m i ) ∈ F ( M ) , for every i = , . . . , n +
1, and h ( l j ) ∈ F ( M ) , for every j = , . . . , n . We consider h as the concatenation ofthe paths h , h : [ , ] → F ( M ) , defined, respectively, as h ( l ) = ( − l ) b f + l h ( l n ) ,and h ( l ) = ( − l ) h ( l n ) + l b g . The path h transversally intersect F ( M ) at n values m , . . . , m n . Hence, by the inductive hypothesis, we have d E (( G b f , ℓ b f ) , ( G h ( l n ) , ℓ h ( l n ) )) ≤k b f − h ( l n ) k C . Moreover, the path h transversally intersect F ( M ) only at the value HE EDIT DISTANCE FOR REEB GRAPHS OF SURFACES 19
PSfrag replacements h = G ( , · ) G ( h , · ) , h > G ( h , · ) , h < )(K )(K )(K ) pp pqq q F IGURE
Center: A function h ∈ F b ( M ) as in case (2) with p , q as in Figure 8 ( a ) ;left-right: The universal deformation G ( h , · ) with the associated labeled Reeb graphs for h < h > PSfrag replacements h = G ( , · ) G ( h , · ) , h > G ( h , · ) , h < )(K )(K ) pq h = G ( , · ) G ( h , · ) , h > G ( h , · ) , h < ) (K )(K ) pp pppp q qq F IGURE
Center: A function h ∈ F b ( M ) as in case (2) with p , q as in Figure 8 ( b ) ;left-right: The universal deformation G ( h , · ) with the associated labeled Reeb graphs for h < h > PSfrag replacements h = G ( , · ) G ( h , · ) , h > G ( h , · ) , h < )(K )(K ) pp pp pqq qq qq F IGURE
Center: A function h ∈ F b ( M ) as in case (2) with p , q as in Figure 8 ( c ) ;left-right: The universal deformation G ( h , · ) with the associated labeled Reeb graphs for h < h > PSfrag replacements h = G ( , · ) G ( h , · ) , h > G ( h , · ) , h < )(K )(K ) pq h = G ( , · ) G ( h , · ) , h > G ( h , · ) , h < )(K )(K ) pp ppppq qq F IGURE
Center: A function h ∈ F b ( M ) as in case (2) with p , q as in Figure 8 ( d ) ;left-right: The universal deformation G ( h , · ) with the associated labeled Reeb graphs for h < h > HE EDIT DISTANCE FOR REEB GRAPHS OF SURFACES 21 m n + . Consequently, by Lemma 4.5, we have d E (( G h ( l n ) , ℓ h ( l n ) ) , ( G b g , ℓ b g )) ≤ k h ( l n ) − b g k C .Using the triangle inequality and Lemma 4.2, we can conclude that: d E (( G b f , ℓ b f ) , ( G b g , ℓ b g )) ≤ d E (( G b f , ℓ b f ) , ( G h ( l n ) , ℓ h ( l n ) )) + d E (( G h ( l n ) , ℓ h ( l n ) ) , ( G b g , ℓ b g )) ≤ l n k b f − b g k C + ( − l n ) k b f − b g k C = k b f − b g k C . (4.4)Let us now estimate d E (( G f , ℓ f ) , ( G g , ℓ g )) . By the triangle inequality, we have: d E (( G f , ℓ f ) , ( G g , ℓ g )) ≤ d E (( G f , ℓ f ) , ( G b f , ℓ b f ))+ d E (( G b f , ℓ b f ) , ( G b g , ℓ b g ))+ d E (( G b g , ℓ b g ) , ( G g , ℓ g )) . Since b f ∈ N ( f , d ) ⊂ F ( M ) and b g ∈ N ( g , d ) ⊂ F ( M ) , the following facts hold: ( a ) for every l ∈ [ , ] , ( − l ) f + l b f , ( − l ) g + l b g ∈ F ( M ) ; ( b ) k f − b f k C ≤ d and k b g − g k C ≤ d . Hence, from ( a ) and Lemma 4.3, we get d E (( G f , ℓ f ) , ( G b f , ℓ b f )) ≤ k f − b f k C ,and d E (( G g , ℓ g ) , ( G b g , ℓ b g )) ≤ k b g − g k C . Using inequality (4.4) and the triangle inequality of k · k C , we deduce that d E (( G f , ℓ f ) , ( G g , ℓ g )) ≤ k f − b f k C + k b f − b g k C + k b g − g k C ≤ k f − g k C + ( k f − b f k C + k b g − g k C ) . Hence, from ( b ) , we have d E (( G f , ℓ f ) , ( G g , ℓ g )) ≤ k f − g k C + d . This yields the conclu-sion by the arbitrariness of d . (cid:3)
5. R
ELATIONSHIPS WITH OTHER STABLE METRICS
In this section, we consider relationships between the edit distance and other metrics forshape comparison: the natural pseudo-distance between functions [8], the functional dis-tortion distance between Reeb graphs [1], and the bottleneck distance between persistencediagrams [6]. More precisely, the main result we are going to show states that the naturalpseudo-distance between two simple Morse functions f and g and the edit distance be-tween the corresponding Reeb graphs actually coincide (Theorem 5.6). As a consequence,we deduce that the edit distance is a metric (Corollary 5.7), and that it is more discrimi-native than the bottleneck distance between persistence diagrams (Corollary 5.8) and thefunctional distortion distance between Reeb graphs (Corollary 5.9).The natural pseudo-distance is a dissimilarity measure between any two functions de-fined on the same compact manifold obtained by minimizing the difference in the functionsvia a re-parameterization of the manifold [8]. In general, the natural pseudo-distance isonly a pseudo-metric. However it turns out to be a metric in some particular cases such asthe case of simple Morse functions on a smooth closed connected surface, considered upto R -equivalence, as proved in [3]. We give the definition in this context. Definition 5.1.
The natural pseudo-distance between R -equivalence classes of simpleMorse functions f , g on the same surface M is defined as d N ([ f ] , [ g ]) = inf x ∈ D ( M ) k f − g ◦ x k C , where D ( M ) is the set of self-diffeomorphisms on M .In order to study d N , it is often useful to consider the following fact. Proposition 5.2.
Letting H ( M ) be the set of self-homeomorphisms on M , it holds thatd N ([ f ] , [ g ]) = inf x ∈ H ( M ) k f − g ◦ x k C . Proof.
Let d = d N ([ f ] , [ g ]) . Clearly inf x ∈ H ( M ) k f − g ◦ x k C ≤ d . By contradiction, assumingthat inf x ∈ H ( M ) k f − g ◦ x k C < d , there exists a homeomorphism x such that k f − g ◦ x k C < d . On the other hand, by [25, Cor. 1.18], for every metric d on M and for every n ∈ N ,there exists a diffeomorphism x n : M → M such that d ( x n ( p ) , x ( p )) < / n , for every p ∈ M . Hence, by the continuity of g , and applying the reverse triangle inequality, wededuce that lim n → ¥ (cid:12)(cid:12)(cid:12) k f − g ◦ x k C − k f − g ◦ x n k C (cid:12)(cid:12)(cid:12) ≤ lim n → ¥ k g ◦ x n − g ◦ x k C = . Therefore, for n sufficiently large, there exists a diffeomorphism x n such that k f − g ◦ x n k C < d , yielding a contradiction. (cid:3) The following Lemmas 5.3-5.5 state that the cost of each elementary deformation upper-bounds the natural pseudo-distance. Their proofs deploy the concepts of elementary cobor-dism and rearrangement, whose detailed treatment can be found in [18].
Lemma 5.3.
For every elementary deformation T ∈ T (( G f , ℓ f ) , ( G g , ℓ g )) of type (R),c ( T ) ≥ d N ([ f ] , [ g ]) .Proof. Since T is of type (R), there exists an edge preserving bijection F : V ( G f ) → V ( G g ) . Hence, f and g have the same number of critical points of the same type: K f = { p , . . . , p n } , K g = { p ′ , . . . , p ′ n } , with F ( p i ) = p ′ i , and p i , p ′ i both being of index 0,1, or 2.Let c i = f ( p i ) and c ′ i = g ( p ′ i ) for i = , . . . , n . We shall construct a homeomorphism x : M → M such that x | K f = F and k f − g ◦ x k C = max i = ,..., n | c i − c ′ i | = c ( T ) . By Proposi-tion 5.2, this will yield the claim.Let us endow M with a Riemannian metric, and consider the smooth vector field X = − (cid:209) f k (cid:209) f k on M \ K f , and the smooth vector field Y = (cid:209) g k (cid:209) g k on M \ K g . Let us denote by j t ( p ) and y t ( p ) the flow lines defined by X and Y , on M \ K f and M \ K g , respectively.We observe that f strictly decreases along X -trajectories, while g strictly increases along Y -trajectories. Moreover, no two X -trajectories (resp. Y -trajectories) pass through thesame p . Hence, j t ( p ) and y t ( p ) are injective functions of t and p , separately. By [19,Prop. 1.3], j and y are continuous in t and p when restricted to compact submanifolds of M \ K f and M \ K g , respectively.Let us fix a real number e > i = , . . . , n , f − ([ c i − e , c i + e ]) ∩ K f = { p i } and g − ([ c ′ i − e , c ′ i + e ]) ∩ K g = { p ′ i } .In order to construct the desired homeomorphism x on M , the main idea is to cut M into cobordisms and define suitable homeomorphisms on each of these cobordisms thatcan be glued together to obtain x . The fact that x is not required to be differentiable butonly continuous facilitates the gluing process.Let us consider the cobordisms obtained cutting M along the level curves f − ( c i ± e ) and g − ( c ′ i ± e ) for i = , . . . , n . According to whether these cobordisms contain points ofmaximum, minimum, saddle points, or no critical points at all, we treat the cases differ-ently. Case 1:
Let p i , p ′ i be points of maximum or minimum of f and g , respectively. Let D = D i (resp. D ′ = D ′ i , ) be the connected component of f − ([ c i − e , c i + e ]) (resp. g − ([ c ′ i − e , c ′ i + e ]) ) that contains p i (resp. p ′ i ). D and D ′ are topolological disks. Let s D : ¶ D → ¶ D ′ be agiven homeomorphism between the boundaries of D and D ′ . Claim 1.
There exists a homeomorphism x D : D → D ′ such that: HE EDIT DISTANCE FOR REEB GRAPHS OF SURFACES 23 ( a ) x D | ¶ D = s D ; ( b ) max p ∈ D | f ( p ) − g ◦ x D ( p ) | = | c i − c ′ i | . Proof of Claim 1.
We first prove Claim 1 for maxima. We set x D ( p i ) = p ′ i , and, for every p ∈ D \ { p i } , x D ( p ) = p ′ , where p ′ = y f ( p ) − c i + e ◦ s D ◦ j f ( p ) − c i + e ( p ) . In plain words, foreach p ∈ D we follow the X -flow downwards until the intersection with f − ( c i − e ) ; thenwe apply the homeomorphism s D to go from f − ( c i − e ) to g − ( c ′ i − e ) ; finally, we followthe Y -flow upwards.The function x D is injective as can be seen using the aforementioned injectivity propertyof j and y . Moreover, x D is surjective because, for every p ∈ D \ { p i } , there exists a flowline passing for p . Furthermore, x D is continuous on D \ { p i } because composition ofcontinuous functions. The continuity can be extended to the whole D as can be seen takinga sequence ( q j ) in D \ { p i } converging to p i . Since lim j f ( q j ) = c i , by construction of x D itholds that lim j g ( x D ( q j )) = c ′ i . We see that lim j x D ( q j ) = p ′ i because p ′ i is the only point of D ′ where g takes value equal to c ′ i ,. Therefore x D is continuous on D . Moreover, since x D isa continuous bijection from a compact space to a Hausdorff space, it is a homeomorphism.Finally, property ( a ) holds by construction and property ( b ) holds because, for every p ∈ D , g ( x D ( p )) = f ( p ) + c ′ i − c i .To prove Claim 1 when p i , p ′ i are minimum points of f and g , it is sufficient to replace j f ( p ) − c i + e ( p ) and y f ( p ) − c i + e ( p ) by j f ( p ) − c i − e ( p ) and y f ( p ) − c i − e ( p ) , respectively. Case 2:
Let p i , p ′ i be two splitting saddle points or two joining saddle points of f and g , respectively, and let P and P ′ be the connected component of f − ([ c i − e , c i + e ]) and g − ([ c ′ i − e , c ′ i + e ]) , respectively, that contain p i and p ′ i . Let s P : ¶ − P → ¶ − P ′ be a givenhomeomorphism between the lower boundaries of P and P ′ . Claim 2.
There exists a homeomorphism x P : P → P ′ such that: ( a ) x P | ¶ − P = s P ; ( b ) max p ∈ P | f ( p ) − g ◦ x P ( p ) | = | c i − c ′ i | . Proof of Claim 2.
Let us consider the case p i , p ′ i are two splitting saddle points of f and g respectively, so that P and P ′ are two upside-down pairs of pants. We let p a , p b be theonly two points of intersection of f − ( c i − e / ) with the trajectories of the gradient vectorfield X coming from p i . Analogously, we let p ′ a , p ′ b be the only two points of intersectionof g − ( c ′ i − e / ) with the trajectories of the gradient vector field Y leading to p ′ i .The pair of pants P can be decomposed into P = M ∪ N ∪ O with M = { p ∈ P : f ( p ) ∈ [ c i − e , c i − e / ] } , N = { p ∈ P : f ( p ) ∈ [ c i − e / , c i ] } and O = { p ∈ P : f ( p ) ∈ [ c i , c i + e ] } .Analogously, the pair of pants P ′ can be decomposed into P ′ = M ′ ∪ N ′ ∪ O ′ with M ′ = { p ′ ∈ P ′ : g ( p ′ ) ∈ [ c ′ i − e , c ′ i − e / ] } , N ′ = { p ′ ∈ P ′ : g ( p ′ ) ∈ [ c ′ i − e / , c ′ i ] } , and O ′ = { p ′ ∈ P ′ : g ( p ′ ) ∈ [ c ′ i , c ′ i + e ] } .The construction of x P is based on gluing three homeomorphisms x M : M → M ′ , x N : N → N ′ , x O : O → O ′ together.First, we observe that, M and M ′ being cylinders, it is possible to construct a homeo-morphism x M that extends s P to M in such a way that x M ( p a ) = p ′ a and x M ( p b ) = p ′ b , alsosending the level-sets of f into those of g . In this way max p ∈ M | f ( p ) − g ◦ x M ( p ) | = | c i − c ′ i | . Next, we define x N by setting x N ( p i ) = p ′ i , and, for every p = p i , x N ( p ) = p ′ , where p ′ = y f ( p ) − c i + e / ◦ x M ◦ j f ( p ) − c i + e / ( p ) . It agrees with x M on ¶ M ∩ ¶ N and max p ∈ N | f ( p ) − g ◦ x N ( p ) | = | c i − c ′ i | . Moreover, x N is bijective and continuous on N \ { p i } by arguments similar to those used in the proof of Claim 1. To see that continuity extends to p i , let ( q j ) be a sequence converging to p i . The sequence ( j f ( p ) − c i + e / ( q j )) has at most twoaccumulating points, precisely the points p a , and p b . By the construction of x M , x M ( p a ) = p ′ a and x M ( p b ) = p ′ b , hence the sequence ( x N ( q j )) converges to p ′ i . In conclusion, x N isbijective and continuous, therefore it is a homeomorphism.Finally, we construct x O by using again the trajectories of X and Y : for each p ∈ O we follow the flow of X downwards until the intersection with f − ( c i ) . If the intersectionpoint q is different from p i , we set x O ( p ) equal to the point p ′ on the trajectory of x N ( q ) such that p ′ = y f ( p ) − c i ( x N ( q )) . Otherwise, if q = p i , we consider a sequence ( r j ) of pointsin the same connected component of O \ { p i } as p and converging to p . The intersectionof f − ( c i ) with the downward flow through r j , j ∈ N , gives a sequence ( q j ) converging to p i and belonging to one and the same component of f − ( c i ) \ { p i } as p . By the continuityof x N the sequence ( x N ( q j )) converges to p ′ i and its points belong to one and the samecomponent of g − ( c ′ i ) \ { p ′ i } . Hence the sequence ( y f ( r j ) − c i ( x N ( q j ))) converges to a point p ′ . We set x O ( p ) = p ′ . By the continuity of j and y , this definition does not depend onthe choice of the sequence ( r j ) . By construction, x O is continuous and the proof that it isa homeomorphism can be handled by arguments similar to those used for x N . Moreover, itagrees with x N on ¶ N ∩ ¶ O and max p ∈ N | f ( p ) − g ◦ x N ( p ) | = | c i − c ′ i | . In conclusion, x P can be constructed by gluing the homeomorphisms x M , x N , x O to-gether and the properties ( a ) and ( b ) hold by construction.The case when p i , p ′ i are two joining saddle points of f and g , respectively, can betreated analogously. We have only to take into account that P is now a pairs of pants, andhence M = { p ∈ P : f ( p ) ∈ [ c i − e , c i − e / ] } is a pair of cylinders each containing onepoint of intersection between f − ( c i − e / ) and the trajectories of the gradient vector field X coming from p i . Similarly for P ′ . Case 3:
Let p i , p j (resp. p ′ i , p ′ j ) be critical points connected by an edge in the Reeb graphof f (resp. g ), and assume c i < c j (resp. c ′ i < c ′ j ). Let C = { p ∈ M : [ p ] ∈ e ( p i , p j ) , c i + e ≤ f ( p ) ≤ c j − e } and C ′ = { p ∈ M : [ p ] ∈ e ( p ′ i , p ′ j ) , c ′ i + e ≤ g ( p ) ≤ c ′ j − e } . C and C ′ aretwo topological cylinders. Let s C : ¶ − C → ¶ − C ′ be a given homeomorphism between thelower boundaries of C and C ′ . Claim 3.
There exists a homeomorphism x C : C → C ′ such that: ( a ) x C | ¶ − C = s C ; ( b ) max p ∈ C | f ( p ) − g ◦ x C ( p ) | = max {| c i − c ′ i | , | c j − c ′ j |} . Proof of Claim 3.
To prove Claim 3, for every p ∈ C , we set l p equal to the only valuein [ , ] for which f ( p ) = ( − l p )( c i + e ) + l p ( c j − e ) , and define x C ( p ) = p ′ , with p ′ = y l p ( c ′ j − c ′ i − e ) ◦ s C ◦ j l p ( c j − c i − e ) ( p ) .By the same arguments as used to prove the previous Claims 1 and 2, x C is a home-omorphism. It satisfies property ( a ) by construction. To prove ( b ) , it is sufficient toobserve that, for every p ∈ C , | f ( p ) − g ( x C ( p )) | = | ( − l p )( c i + e ) + l p ( c j − e ) − ( c ′ i + e + l p ( c ′ j − c ′ i − e )) | = | ( − l p )( c i − c ′ i ) + l p ( c j − c ′ j ) | . HE EDIT DISTANCE FOR REEB GRAPHS OF SURFACES 25
Let us now construct the desired homeomorphism x : M → M . Let { p , . . . , p s } ⊆ K f , s ≤ n , be the set of critical points of f of index 0 or 2, and, for i = , . . . , s , let D i , D ′ i be asin Claim 1.The spaces W = M \ S si = D i and W ′ = M \ S si = D ′ i can be decomposed into the unionof cobordisms containing either no critical points or exactly one critical point of index 1.By Claims 2 and 3, it is possible to extend a given homeomorphism s W : ¶ − W → ¶ − W ′ defined between the lower boundaries of W and W ′ to a homeomorphism x W : W → W ′ by gluing all the homeomorphisms on cobordisms along their boundary components in thedirection of the increasing of the functions f and g . Next, by Claim 1, we can glue thishomeomorphism x W along each boundary component of W to a homeomorphism x D i : D i → D ′ i , for i = , . . . , s . As a result, we get the desired self-homeomorphism x of M such that max p ∈ M | f ( p ) − g ◦ x ( p ) | = max i = ,..., n | c i − c ′ i | . (cid:3) Lemma 5.4.
For every elementary deformation T ∈ T (( G f , ℓ f ) , ( G g , ℓ g )) of type (B) or (D) , c ( T ) ≥ d N ([ f ] , [ g ]) .Proof. We prove the assertion only for the case when T is of type (D), because the othercase will then follow from c ( T − ) = c ( T ) and the symmetry property of d N .By definition of elementary deformation of type (D), T transforms ( G f , ℓ f ) into a la-beled Reeb graph that differs from ( G f , ℓ f ) in that two vertices, say p , p ∈ K f , have beendeleted together with their connecting edges. Otherwise vertices, adjacencies and labelsare the same. Assuming f ( p ) = c , f ( p ) = c , with c < c , we have c ( T ) = c − c .We recall that f − ([ c , c ]) ∩ K f = { p , p } . By Proposition 3.4, there exists a deforma-tion S = ( S , S ) ∈ T (( G f , ℓ f ) , ( G g , ℓ g )) , S being of type (R), S of type (D), such that c ( S ) = c ( T ) . In particular, as shown in the proof of the same proposition (formulas (3.1)and (3.2)), for every e > S and S can be built so that c ( S ) = c − c − e and c ( S ) = e .For any h e for which S ( G f , ℓ f ) ∼ = ( G h e , ℓ h e ) , by Lemma 5.3 we have d N ([ f ] , [ h e ]) ≤ c ( S ) = c − c − e . Thus, d N ([ f ] , [ g ]) ≤ d N ([ f ] , [ h e ]) + d N ([ h e ] , [ g ]) ≤ c − c − e + d N ([ h e ] , [ g ]) . Therefore, proving that d N ([ h e ] , [ g ]) ≤ e will yield the claim, by the arbitrariness of e > W e be the connected component of h − e ([ c + c − e , c + c + e ]) containing p , p ,and let us assume that e is so small that h − e ([ c + c − e , c + c + e ]) does not containother critical points of h e . By the Cancellation Theorem in [18, Sect. 5], it is possible todefine a new simple Morse function h ′ e : M → R which coincides with h e on M \ W e , andhas no critical points in W e . In particular, ( G h ′ e , ℓ h ′ e ) ∼ = ( G g , ℓ g ) , implying that h ′ e and g are R -equivalent. It necessarily holds that d N ([ h e ] , [ h ′ e ]) ≤ max p ∈ M | h e ( p ) − h ′ e ( p ) | = max p ∈ W e | h e ( p ) − h ′ e ( p ) | ≤ e . Moreover, by the R -equivalence of h ′ e and g , we have d N ([ h ′ e ] , [ g ]) =
0, so that d N ([ h e ] , [ g ]) ≤ e by the triangle inequality property of d N . (cid:3) Lemma 5.5.
For every elementary deformation T ∈ T (( G f , ℓ f ) , ( G g , ℓ g )) of type (K i ),i = , , , c ( T ) ≥ d N ([ f ] , [ g ]) .Proof. For an elementary deformation T of type (K i ), i = , ,
3, the sets K f and K g havethe same cardinality, and all but at most two of the critical values of f and g coincide.Let K f = { p , . . . , p n } and K g = { p ′ , . . . , p ′ n } , with f ( p k ) = c k , g ( p ′ k ) = c ′ k for every k = , . . . , n . Assuming that the points p , p correspond to the vertices u , u of G f shown inTable 1, rows 3-4, it holds that c < c , c ′ > c ′ , and c k = c ′ k for k = , . . . , n . Moreover, K f ∩ f − ([ c , c ]) = { p , p } and K g ∩ g − ([ c ′ , c ′ ]) = { p ′ , p ′ } . Since f , g ∈ F ( M ) ,there exist a , b ∈ R , with a < b , such that c , c and c ′ , c ′ are the sole critical values of f and g , respectively, that belong to the interval [ a , b ] . Let us denote by W the connectedcomponent of f − ([ a , b ]) containing p , p . Under our assumptions, we can apply thePreliminary Rearrangement Theorem [18, Thm 4.1], and deduce that, for some choiceof a gradient-like vector field X for f , there exists a Morse function h : W → R that hasthe same gradient-like vector field as f , coincides with f | W near ¶ W and is equal to f plus a constant in some neighborhood of p and in some neighborhood of p . Moreover, K h = K f | W , h ( p ) = c ′ , h ( p ) = c ′ . We can extend h to the whole surface by defining b h ( p ) = (cid:26) f ( p ) , if p ∈ M \ W , h if p ∈ W . Hence, b h ∈ F ( M ) and ( G b h , ℓ b h ) ∼ = T ( G f , ℓ f ) , implying that b h is R -equivalent to g . There-fore, by Definition 1.6, d N ([ f ] , [ g ]) = d N ([ f ] , [ b h ]) .Let us prove that d N ([ f ] , [ b h ]) ≤ c ( T ) . We observe that, by the definitions of d N and b h ,we get: d N ([ f ] , [ b h ]) ≤ k f − b h k C = max p ∈ M | f ( p ) − b h ( p ) | = max p ∈ W | f ( p ) − h ( p ) | . (5.1)To estimate the value of max p ∈ W | f ( p ) − h ( p ) | , we review the construction of the function h ,as given in [18]. Let m : W → [ a , b ] be a smooth function that is constant on each trajectoryof X , zero near the set of points on trajectories going to or from p , and one near theset of points on trajectories going to or from p . Then the function h can be defined as h ( p ) = G ( f ( p ) , m ( p )) , where G : [ a , b ] × [ , ] → [ a , b ] is a smooth function defined as G ( x , t ) = ( − t ) · G ( x , ) + t · G ( x , ) , with the following properties (see also Figure 14): • ¶ G ¶ x ( x , ) = x in a neighborhood of c (in particular G ( x , ) = x + c ′ − c for x in a neighborhood of c ), ¶ G ¶ x ( x , ) = x in a neighborhood of c (in particular G ( x , ) = x + c ′ − c for x in a neighborhood of c ); • For all x and t , G ( x , t ) monotonically increases from a to b as x increases from a to b ; • G ( x , t ) = x for x near to a or b and for every t ∈ [ , ] .By the construction of h and the inequality (5.1), we have: d N ([ f ] , [ b h ]) ≤ max p ∈ W | f ( p ) − G ( f ( p ) , m ( p )) | = max {| f ( p ) − G ( f ( p ) , ) | , | f ( p ) − G ( f ( p ) , ) |} = max {| c − c ′ | , | c − c ′ |} = c ( T ) . (cid:3) Theorem 5.6.
Let f , g ∈ F ( M ) , and ( G f , ℓ f ) , ( G g , ℓ g ) be the associated labeled Reebgraphs. Then d E (( G f , ℓ f ) , ( G g , ℓ g )) = d N ([ f ] , [ g ]) . Proof.
The inequality d E (( G f , ℓ f ) , ( G g , ℓ g )) ≥ d N ([ f ] , [ g ]) holds because, for every defor-mation T ∈ T (( G f , ℓ f ) , ( G g , ℓ g )) , c ( T ) ≥ d N ([ f ] , [ g ]) . To see this, let T = ( T , . . . , T n ) ,and set T i · · · T ( G f , ℓ f ) ∼ = ( G f ( i ) , ℓ f ( i ) ) , f = f ( ) , g = f ( n ) . From Lemmas 5.3-5.5 and the HE EDIT DISTANCE FOR REEB GRAPHS OF SURFACES 27
PSfrag replacements xz z = G ( x , ) z = G ( x , )( a , a ) ( b , b ) c c c ′ c ′ c ′ − c c − c ′ a b b min f max f ( G g , ℓ g ) F IGURE
The function G introduced in [18] and used in the proof of Lemma 5.5. triangle inequality property of d N , we get c ( T ) = n (cid:229) i = c ( T i ) ≥ n (cid:229) i = d N ([ f ( i − ) ] , [ f ( i ) ]) ≥ d N ([ f ] , [ g ]) . Conversely, by Theorem 4.1, d E (( G f , ℓ f ) , ( G g ◦ x , ℓ g ◦ x )) ≤ k f − g ◦ x k C , for every x ∈ D ( M ) . Therefore d E (( G f , ℓ f ) , ( G g , ℓ g )) ≤ inf x ∈ D ( M ) k f − g ◦ x k C = d N ([ f ] , [ g ]) because d E (( G f , ℓ f ) , ( G g , ℓ g )) = d E (( G f , ℓ f ) , ( G g ◦ x , ℓ g ◦ x )) . (cid:3) Corollary 5.7.
For every f , g ∈ F ( M ) , the edit distance between the associated labeledReeb graphs is a metric on isomorphism classes of labeled Reeb graphs.Proof. The claim is an immediate consequence of Theorem 5.6 together with [3, Thm.4.2], which states that the natural pseudo-distance is actually a metric on the space F ( M ) . (cid:3) Corollary 5.8.
For every f , g ∈ F ( M ) , d E (( G f , ℓ f ) , ( G g , ℓ g )) ≥ d B ( D f , D g ) , where d B denotes the bottleneck distance between the persistence diagrams D f and D g of f and g.In some cases this inequality is strict.Proof. The inequality d E (( G f , ℓ f ) , ( G g , ℓ g )) ≥ d B ( D f , D g ) holds because of Theorem 5.6and the fact that the bottleneck distance is a lower bound for the natural pseudo-distance(cf. [5]).As for the second statement, an example showing that the edit distance between thelabeled Reeb graphs of two functions f , g ∈ F ( M ) can be strictly greater than the bot-tleneck distance between the persistence diagrams of f and g is displayed in Figure 15.Indeed, f and g have the same persistence diagrams for any homology degree implyingthat d B ( D f , D g ) =
0, whereas the labeled Reeb graphs are not isomorphic, implying that d E (( G f , ℓ f ) , ( G g , ℓ g )) > (cid:3) PSfrag replacements 00 11 22 33 44 55 66 77 f g max z ( G f , ℓ f ) ( G g , ℓ g ) F IGURE
The example used in the proof of Corollary 5.8 to show that the edit dis-tance between labeled Reeb graphs can be more discriminative than the bottleneck distancebetween persistence diagrams whenever the same functions are considered.
Corollary 5.9.
For every f , g ∈ F ( M ) , d E (( G f , ℓ f ) , ( G g , ℓ g )) ≥ d FD ( R f , R g ) , where d FD denotes the functional distortion distance between the spaces R f = M / ∼ f and R g = M / ∼ g . In some cases this inequality is strict.Proof. The inequality d E (( G f , ℓ f ) , ( G g , ℓ g )) ≥ d FD ( R f , R g ) is a consequence of the stabilityof Reeb graphs with respect to d FD [1, Thm. 4.1], and can be seen in the same way as thesecond inequality shown in the proof of Theorem 5.6.As for the second statement, an example showing that, for two functions f , g ∈ F ( M ) , d E (( G f , ℓ f ) , ( G g , ℓ g )) can be strictly greater than d FD ( R f , R g ) is displayed in Figure 16. InPSfrag replacements bb ddc c c + ac + a gf max z ( G f , ℓ f ) ( G g , ℓ g ) F IGURE
The example used in the proof of Corollary 5.9 to show that the editdistance between labeled Reeb graphs can be more discriminative than the functional dis-torsion distance between Reeb graphs whenever the same functions are considered. this case, d E (( G f , ℓ f ) , ( G g , ℓ g )) = a , because a is both the cost of the deformation T of type(R) that changes the vertex label c i into c i + a , i = ,
2, and the value of the bottleneckdistance between the 1st homology degree (ordinary) persistence diagrams of f and g . Onthe other hand, d FD ( R f , R g ) ≤ ( c − c ) / F : R f → R g that takes each point of R f to a point of R g with the same function value,together with any continuous map Y : R g → R f that takes each point of R g to a point of R f with the same function value. (cid:3) Acknowledgments.
The authors wish to thank Professor V. V. Sharko for his clarificationson the uniqueness property of Reeb graphs of surfaces and for indicating the reference [15].
HE EDIT DISTANCE FOR REEB GRAPHS OF SURFACES 29
The research described in this article has been partially supported by GNSAGA-INdAM(Italy). R
EFERENCES1. U. Bauer, X. Ge, and Y. Wang,
Measuring Distance between Reeb Graphs , Proceedings of the ThirtiethAnnual Symposium on Computational Geometry (New York, NY, USA), SOCG’14, ACM, 2014, pp. 464–473.2. S. Biasotti, S. Marini, M. Spagnuolo, and B. Falcidieno,
Sub-part correspondence by structural descriptorsof 3d shapes , Computer-Aided Design (2006), no. 9, 1002 – 1019.3. F. Cagliari, B. Di Fabio, and C. Landi, The natural pseudo-distance as a quotient pseudo-metric, and appli-cations , Forum Mathematicum (in press), DOI 10.1515/forum-2012-0152.4. J. Cerf,
La stratification naturelle des espaces de fonctions diff´erentiables r´eelles et le th´eor`eme de la pseudo-isotopie. , Inst. Hautes ´Etudes Sci. Publ. Math. (1970), no. 39, 5–173 (French).5. A. Cerri, B. Di Fabio, M. Ferri, P. Frosini, and C. Landi,
Betti numbers in multidimensional persistenthomology are stable functions , Mathematical Methods in the Applied Sciences (2013), no. 12, 1543–1557.6. D. Cohen-Steiner, H. Edelsbrunner, and J. Harer, Stability of persistence diagrams , Discrete Comput. Geom. (2007), no. 1, 103–120.7. B. Di Fabio and C. Landi, Reeb graphs of curves are stable under function perturbations , MathematicalMethods in the Applied Sciences (2012), no. 12, 1456–1471.8. P. Donatini and P. Frosini, Natural pseudodistances between closed manifolds , Forum Mathematicum (2004), no. 5, 695–715.9. H. Edelsbrunner and J. Harer, Jacobi sets of multiple Morse functions , Foundations of Computational Math-ematics (2002), 37–57.10. X. Gao, B. Xiao, D. Tao, and X. Li,
A survey of graph edit distance , Pattern Anal. Appl. (2010), no. 1,113–129.11. M. Hilaga, Y. Shinagawa, T. Kohmura, and T. L. Kunii, Topology matching for fully automatic similarityestimation of 3D shapes , ACM Computer Graphics, (Proc. SIGGRAPH 2001) (Los Angeles, CA), ACMPress, August 2001, pp. 203–212.12. M. Hirsch,
Differential topology , Springer-Verlag, New York, 1976.13. E. A. Kudryavtseva,
Reduction of Morse functions on surfaces to canonical form by smooth deformation ,Regul. Chaotic Dyn. (1999), no. 3, 53–60.14. , Uniform Morse lemma and isotopy criterion for Morse functions on surfaces , Moscow UniversityMathematics Bulletin (2009), 150–158.15. E. V. Kulinich, On topologically equivalent Morse functions on surfaces , Methods Funct. Anal. Topology (1998), 59–64.16. J. Martinet, Singularities of smooth functions and maps , London Mathematical Society Lecture Note Series,58: Cambridge University Press. XIV, 1982.17. Y. Masumoto and O. Saeki,
A smooth function on a manifold with given Reeb graph , Kyushu J. Math. (2011), no. 1, 75–84.18. J. Milnor, Lectures on the h-cobordism theorem , Notes by L. Siebenmann and J. Sondow, Princeton Univer-sity Press, Princeton, N.J., 1965.19. J. Palis and W. de Melo,
Geometric theory of dynamical systems. An introduction. , New York - Heidelberg -Berlin: Springer-Verlag, 1982.20. G. Reeb,
Sur les points singuliers d’une forme de Pfaff compl´etement int´egrable ou d’une fonction num´erique ,Comptes Rendus de L’Acad´emie ses Sciences (1946), 847–849 (French).21. F. Sergeraert,
Un th´eor`eme de fonctions implicites sur certains espaces de Fr´echet et quelques applications ,Ann. Sci. ´Ecole Norm. Sup. (1972), 599–660 (French).22. V. V. Sharko, Smooth and topological equivalence of functions on surfaces , Ukrainian Mathematical Journal (2003), no. 5, 832–846.23. Y. Shinagawa and T. L. Kunii, Constructing a Reeb Graph automatically from cross sections , IEEE ComputerGraphics and Applications (1991), no. 6, 44–51.24. Y. Shinagawa, T. L. Kunii, and Y. L. Kergosien, Surface coding based on Morse theory , IIEEE ComputerGraphics and Applications (1991), no. 5, 66–78.25. J. H. C. Whitehead, Manifolds with Transverse Fields in Euclidean Space , Annals of Mathematics (1961),no. 1, pp. 154–212. D IPARTIMENTO DI M ATEMATICA , U
NIVERSIT ` A DI B OLOGNA , P.
ZZA DI P ORTA
S. D
ONATO
5, I-40126B
OLOGNA , I
TALIA
ARCES, U
NIVERSIT ` A DI B OLOGNA , VIA T OFFANO /
2, I-40125 B
OLOGNA , I
TALIA
E-mail address : [email protected] D IPARTIMENTO DI S CIENZE E M ETODI DELL ’I NGEGNERIA , U
NIVERSIT ` A DI M ODENA E R EGGIO E MILIA ,V IA A MENDOLA
2, P AD . M ORSELLI , I-42100 R
EGGIO E MILIA , I
TALIA
ARCES, U
NIVERSIT ` A DI B OLOGNA , VIA T OFFANO /
2, I-40125 B
OLOGNA , I
TALIA
E-mail address ::