Loops in Reeb Graphs of 2-Manifolds £

Þ Ü ß Ý Kree Cole-McLaughlin Ý , Herbert Edelsbrunner , John Harer , Vijay Natarajan and Valerio Pascucci

Abstract visualization applications. In computer-aided geometric de- sign, Reeb graphs have been used to describe surface embed-

Given a Morse function over a 2-manifold with or without bound- dings up to isotopy [18]. Applications of this idea include the ary, the is obtained by contracting the connected com- evolution of teeth contact interfaces in the chewing process ponents of the level sets to points. We prove tight upper and lower [17]. Multi-resolution versions of the Reeb graph have lead bounds on the number of loops in the Reeb graph that depend on the to data-base search methods for topologically similar geo- genus, the number of boundary components, and whether or not the metric models [8]. In the interactive exploration of scientific

2-manifold is orientable. We also give an algorithm that constructs data, Reeb graphs are used to efficiently compute level sets

ÐÓ Ò Ò the Reeb graph in time O(Ò ), where is the number of edges [9]. Reeb graphs can also function as a user-interface tool in the triangulation used to represent the 2-manifold and the Morse aiding the selection of meaningful level sets [2]. A more ex- function. tensive discussion of Reeb graphs and their variations in geo- metric modeling and visualization applications can be found Keywords. Computational , 2-manifolds, Morse func- in [6]. tions, level sets, Reeb graphs, loops, algorithms. The first algorithm for constructing the Reeb graph of a smooth function over a 2-manifold is due to [16]. Given a

triangulation representing the function over the 2-manifold,

¾ Ò 1 Introduction this algorithm may take time O(Ò ), where is the num- ber of edges in the triangulation. An improvement of the We study Reeb graphs of Morse functions over 2-manifolds running time at the cost of accuracy has been suggested in

[13]. After motivating this topic and introducing the nec-

ÐÓ Ò [8]. An O(Ò ) time algorithm for loop-free Reeb graphs essary definitions, we will state the results obtained in this over manifolds of constant dimension has been described in paper. [3]. For the case of 3-manifolds, this algorithm has been ex- tended to include information about the genus of the level Motivation. We are interested in the topology of smooth surfaces in [12]. In this paper, we focus on loops in Reeb functions as a means to analyze and visualize intrinsic prop- graphs and study when they occur and how they can be con- erties of geometric models and scientific data. Specifically, structed. we study Reeb graphs, which express the connectivity of

level sets. These graphs have been used in the past to con- Definitions. Let Å be a manifold with or without bound-

 Å Ê struct data structures and user-interfaces for modeling and ary. We are interested in smooth maps  , and for simplicity in generic such maps known as Morse functions, £ Research of the second and forth authors is partially supported by NSF which are defined by the following conditions: under grants EIA-99-72879, and CCR-00-86013. Research of the third au- thor is partially supported by NSF under grant DMS-01-07621. This work was performed under the auspices of the U. S. Department of Energy by I. all critical points of  are non-degenerate and lie in the

University of California Lawrence Livermore National Laboratory under interior of Å;

contract No. W-7405-Eng-48.

 Å

Ý II. all critical points of restricted to the boundary of Center for Applied Scientific Computing, Lawrence Livermore Na- tional Laboratory, Livermore, California. are non-degenerate; and

Þ Departments of Computer Science and , Duke University,

´Üµ   ´Ý µ Ü  Ý  III.  for all critical points of and its Durham, and Raindrop Geomagic, Research Triangle Park, North Carolina.

Ü Department of Mathematics and Computer Science, Duke University, restriction to the boundary. Durham, North Carolina.

ß Department of Computer Science, Duke University, Durham, North Compare this with the definition of a Morse function of a Carolina. stratified space in the book by Goresky and MacPhearson [7,

Section I.4]. A level set is the preimage of a constant value, is the maximum number of pairwise disjoint simple closed

½

´Øµ   . The Reeb graph of is obtained by contracting the curves along which we can cut while keeping the manifold

connected components of the level sets to points. An exam- in one piece. For both families, the genus is equal to .We

´¾ µ ¾ ¾  ple for a 2-manifold without boundary is shown in Figure 1. have in the orientable case and in

Branching in the Reeb graph occurs only at nodes that cor- the non-orientable case. We get a 2-manifold with boundary

 ½ by removing  disks from one without boundary. Table 2 1 summarizes our results on the number of loops in the Reeb graph.

1

 ¼  ½  ¾  ¿ manifold  ...

1

¼ ¼ ¼ ¼ ½ ¼ ¾

Ë ...

½ ½ ½ ¾ ½ ¿ ½

Ì ...

Ì ¾ ¾ ¾ ¾  ¾

1 Ì ...

......

½ ¼ ¼ ½ ¼ ¾ ¼ ¿ È ...

1

¾ ¼ ½ ¼ ¾ ¼ ¿ ¼

à ...

È ¿ ¼ ½ ¼ ¿ ¼ ¼ 

à ...

à ¼ ¾ ¼ ¼  ¼

à ... 1 ...... 0 0 Table 1: Upper and lower bounds on the number of loops in the

Figure 1: To the left: a double torus with equal to the height Reeb graphs of Morse functions over orientable and non-orientable

¾ 

 2-manifolds with and without boundary. ½

or distance from a horizontal base plane. We have ¼

  ¾  ½

¾ and therefore . To the right: the corresponding Reeb graph. To study the computational complexity of constructing a Reeb graph, we assume a piecewise linear representation of

respond to level sets passing through critical points of  .We

the 2-manifold and the Morse function. Letting Ò be the

   write for the number of critical points of index of and

È number of edges in the triangulation, we give an algorithm

  ´ ½µ  Å

for the Euler characteristic of .

Ò ÐÓ Ò that constructs the Reeb graph in time O( ).

Results. Denote the number of loops in the Reeb graph Ê

Outline. Sections 2 and 3 prove the bounds on the num- ÐÓ ÓÔ×  ÐÓ ÓÔ× of  by . This number is equal to the first

 ber of loops for orientable and non-orientable 2-manifolds

¬ ´Ê µ

Betti number, ½ , which is the rank of the first homology

with and without boundary. Sections 4 and 5 present the

À ´Ê µ Å group, ½ . We have a continuous surjection from to

algorithm for constructing Reeb graphs for piecewise linear Å Ê in which the loops in that map to different loops in input data. Section 6 concludes this paper.

Ê are neither contractible nor equivalent. It follows that the Ê first Betti number of Å bounds the one of from above:

2 Orientable 2-manifolds

ÐÓ ÓÔ×  ¬ ´Ê µ  ¬ ´Åµ

½ (1) ½ In this section, we prove tight upper and lower bounds on the

Depending on what Å is, this bound may or may not be number of loops in the Reeb graphs of Morse functions over tight. We use combinatorial and topological arguments to orientable 2-manifolds with and without boundary. get tight bounds for manifolds of dimension 2.

According to the classification theorem of 2-manifolds, Å

see eg. [10, 15], a connected orientable 2-manifold Å is Without boundary. Let be a connected 2-manifold

 Å Ê

either diffeomorphic to the sphere or the connected sum of without boundary and  be a Morse function.

Ê 

 ½ Æ

tori, and a non-orientable 2-manifold is diffeo- A point of the Reeb graph of corresponds to a level set,

 ½ morphic to the connected sum of projective planes. and we refer to this point as a node if the level set passes

Denoting the sphere, the torus, and the projective plane by through a critical point of  . The rest of the Reeb graph con-

Ì È Ë, , and , we write sists of arcs connecting the nodes. The degree of a node is

the number of arcs that share the node. Since, by Condition

 Ë ÌÌ Ì

Å and III, all critical points have different function values, we have

Ê

 ÈÈ È

Æ a bijection between the nodes of and the critical points of

 . A minimum starts and a maximum ends a family of con-

 ÈÈ The Klein bottle is à , and each connected non- tour cycles, which implies that they correspond to degree-1

orientable 2-manifold is also diffeomorphic to the connected nodes. A saddle either splits a single cycle into two or it à sum of an orientable 2-manifold with È or . The genus merges two cycles into one, and in either case it corresponds

2

¾ ¾ 

to a degree-3 node. Higher degrees occur only for functions The Euler characteristic is  , which implies

 ¬ ¾ ·  ½

that are not Morse. ½ . The inequality (1) implies that this is also an upper bound on the number of loops. We complement this with a lower bound to get:

LEMMA B. The Reeb graph of a Morse function over a con-

  ½

nected orientable 2-manifold of genus with

¾ ·  ½ boundary components has between and

loops. Å PROOF. Let  be a Morse function over . To prove the lower bound, we show that it is possible to close a hole without increasing the number of loops in the corresponding Figure 2: From left to right: the original Reeb graph of the double torus in Figure 1, the graph after collapsing, and the graph after Reeb graph. Every boundary component is a circle and the merging arcs. restriction of  to that circle alternates between local minima

and maxima. Let Õ be a maximum with neighboring minima

Ö Ô  Ö

We collapse degree-1 nodes and merge arcs across degree- Ô and .If , we glue the two arcs by identifying points

´Ôµ ´Ö µ

2 nodes. Both operations preserve the homotopy type and with equal function values. Otherwise, assume 

¼ ¼

ÕÔ  ´Ö µ   ´Ö µ and let Ö be the point along the arc with .

thus the number of loops in Ê . This is illustrated in Figure 2.

¼

¼ ÕÖ Again we glue the arcs ÕÖ and by identifying points with Let Ê be the Reeb graph after collapsing and merging. Let

¼ equal function values. In both cases, the gluing starts from

 Ê  ¿ ¿ be the number of degree-3 nodes in and note that is

a single point and thus does not create any new loops (loops

¿ even because ¿ is twice the number of arcs.

can only be removed). Indeed, the effect of the operation ¼

Case 1. Ê has at least one loop. We prove — either on the Reeb graph is either void or that of a zipper merging

by induction or using the Euler formula for graphs — portions of two arcs starting at a common endpoint. By re-



¼

¿

Ê ·½ 

that the number of loops in is .Wehave ½ peating the gluing operation we eventually remove the hole.

¾  degree-3 nodes in Ê , and for each minimum and max- After eliminating all holes, we are left with a function over

imum we collapse a degree-1 node turning a degree-3 a 2-manifold without boundary. The genus is still ,soby

into a degree-2 node, which is then removed. Hence, Lemma A, the Reeb graph has loops. By construction, the



   ´ ·  µ    ¾ ¾ 

½ ¼ ¾ ¿ ¿ . Since is a Reeb graph of has at least that number of loops.

non-negative even integer, this covers the case in which

 ½

Å is the connected sum of tori. ¼

Case 2. Ê has no loop and thus consists of a single node.

Since all other possibilities are covered in Case 1, Å is the sphere.

By construction, ÐÓ ÓÔ× is equal to the number of loops in

 ¼

Ê . In both case, this number is equal to the genus:

LEMMA A. The Reeb graph of a Morse function over a con-

nected orientable 2-manifold of genus without bound-

aries has loops.

A topologist’s approach to proving Lemma A would be to

observe that thickening the Reeb graph gives a 3-manifold É Figure 3: The outside of the blanket-like 2-manifold is white and whose boundary is the 2-manifold Å. Consider now the in-

the inside is shaded. We get two loops each for the three tunnels

À ´Åµ ¸ À ´Éµ ½ clusion of the first homology groups, ½ .By

Lefschetz duality and Poincar«e duality, the rank of the kernel and one loop each for the two strips at the bottom.

ÖÒ À ´Åµ¾ is half the rank of the domain. We have ½

The bounds in Lemma B are tight. To realize the lower

ÖÒ À ´Éµ¾  and therefore ½ , which is also the

bound of loops, we start with a 2-manifold without bound- number of loops in the Reeb graph.

ary and cut  holes in sequence, such that no two boundary Note that both proofs make little use of the properties of components meet a common contour cycle. To realize the

Morse functions, implying that Lemma A holds for more

 ·½ upper bound of ¾ loops we follow the recipe il- general but not for arbitrary continuous functions. lustrated in Figure 3. We start with a disk that hangs like

a blanket over the back of a chair. We add tunnels in se-

 ½

With boundary. Let Å be a connected orientable 2- quence and finally add strips at the bottom to increase

  ½  manifold of genus with boundary components. the number of boundary components to .

3 3 Non-orientable 2-manifolds 1 1 In this section, we prove tight upper and lower bounds on the number of loops in the Reeb graphs of Morse functions over non-orientable 2-manifolds with and without boundary.

Without boundary. Each connected non-orientable 2-

manifold without boundary is the connected sum of copies 1

1

 ÈÈ È

of the projective plane: Æ . Recall that

 ÈÈ Æ Ã is the Klein bottle and that is the genus of .

Figure 5: To the left: the projective plane with two disks removed.

 ¾ The Euler characteristic of Æ is . We make use of a To the right: the 2-sheeted cover, which is a sphere with four disks

particular 2-sheeted cover of Æ obtained by doubling every removed.

¼ ¼¼

¾ Æ Ü Ü point Ü into a pair and , which we imagine as ly-

ing near Ü and locally on opposite sides of the non-orientable

¼

 Æ Ê   Å Ê

manifold. Figure 4 illustrates this construction for the Klein Morse function  induces a function .

¼ ¼

Ý Ü Ý ¾ Æ bottle. Two points Ü and are near if are near Its critical points are non-degenerate, but it is not a Morse

function since each critical point of  corresponds to two ¼

2 2 2 ¼ Ê

critical points of  at the same height. Let be the Reeb

¼ ¼ 

graph of  . Even though is not Morse, a small perturba-

¼ ¼ Ê tion of  is Morse and the perturbation does not alter .By 1 1 1 ¼

Lemma A, the number of loops in Ê is equal to the genus of

½ Å, which is .

1 1 1 Contour cycles of  that do not contain critical points lift

¼ Ê

to two contour cycles of  . It follows that each arc of

¼  gives rise to two arcs of Ê . A contour cycle of that passes 0 0 0 through a critical point which is not a projective saddle also

lifts to two disjoint copies, hence gives rise to two nodes in

¼ Ê

Figure 4: The Klein bottle with Reeb graph on the left and the Ê . Finally, a contour cycle that contains a projective saddle ¼

torus obtained by doubling with its Reeb graph Ê on the right. lifts to a single contour cycle, giving rise to a single node ¼

connected by four arcs to other nodes in Ê . Now suppose

¼ ¼

Ý Æ

and Ü lie locally on the same side of . The resulting

Ê  

that has arcs, ¾ degree-2 nodes corresponding to pro- ¼

space is a connected and orientable 2-manifold Å with Eu-

Ê ¾

jective saddles, and  other nodes. Then has arcs and

  ¾ Å

ler characteristic Å . The genus of is therefore

¾ ·  ½ ¬ ´Ê µ ·  

½ ¾

¾ nodes. We have and therefore

 ´¾  µ ¾  ½   ½ Å

Å . Table 2 illustrates

¼

¬ ´Ê µ  ¾ ·  ¾

the correspondence between the non-orientable and the ori- ½

½ ¾

entable 2-manifolds.

 ¾ ¾¬ ´Ê µ 

½ ¾

  Æ Å  

Å Å

¼

¬ ´Ê µ ½ ¬ ´Ê µ´  µ ¾

½ ¾

Since ½ we obtain , which

½ È Ë ¼ ¾

½ implies:

¼ ¾ Ã Ì ½ ¼

½ ¿ Ã È Ì Ì ¾ ¾ LEMMA C. The Reeb graph of a Morse function over a con- ......

nected non-orientable 2-manifold of genus without

¥ ¤ boundary has between 0 and  loops.

Table 2: Doubling turns the non-orientable 2-manifold on the left ¾ into the orientable 2-manifold in the same row on the right.

The bounds for the number of loops are tight. Note that for

  ½ ÐÓ ÓÔ×  ¼

the projective plane, we have ¾ and , in- Æ Let Ê be the Reeb graph of a Morse function over .

dependent of the Morse function. For general Æ, we get

We have seen that Ê has degree-1 nodes corresponding to

 ¼ È minima and maxima and degree-3 nodes corresponding to ÐÓ ÓÔ× by connecting copies of in a chain, as

shown in Figure 6 but without boundary cycles. We get

¥ ¤ ¥

saddles. In the non-orientable case, we also have degree- ¤

 

ÐÓ ÓÔ×  by connecting copies of the Klein bottle ¾ 2 nodes. The reason is that the level set containing a crit- ¾ ical point of index 1 is a figure-8 which may contain an as in Figure 4, possibly by adding another copy of È. Num- orientation-reversing circle. A picture of the local structure bers between the two extremes are obtained by combining for this situation is given in Figure 5. We call these critical the two constructions. points projective saddles since a neighborhood of the level

set through such a point is the projective plane with two disks With boundary. Just as in the orientable case, a connected

Æ Æ removed. The double covering Å composed with the non-orientable 2-manifold with boundary is characterized

4

  ½

up to diffeomorphism by its genus and the number level set remains topologically the same as long as the func-

 ¾  ´Ô µ  ´Ô µ

·½

of boundary components. Its Euler characteristic is tion value remains strictly between and . The

 ¬ ½   ·  ½ Ä

·½

. The inequality (1) implies that ½ level sets in the next open interval are represented by .

Ä Ä

·½ is an upper bound on the number of loops in the Reeb graph: The difference between and can be understood by

studying how the level set changes when it passes through 

LEMMA D. The Reeb graph of a Morse function over a con- Ô ·½

. We distinguish between critical points of and critical

  ½ Å

nected non-orientable 2-manifold of genus with points of  restricted to the boundary of .

¼ ·  ½

 Ä

boundary components has between and Ô

·½ ·½

If is a minimum of then develops a new con-

 Ä

loops. Ô

·½ ·½

tour cycle. If is a maximum of then loses one

Ô Ä

·½

contour cycle. If is a saddle, the evolution from to

Ä ·½ is more complicated because it depends on the global and not just the local connectivity of the level set. Figure 7 illustrates the various cases that can occur. On the bound-

Figure 6: We get one loop each for the seven cross-caps and the two strips. The projective saddles delimiting the cross-caps are shown as small circles. Figure 7: Evolution of the level set while passing through a (nor- The bounds in Lemma D are tight. To see the lower bound mal) saddle in the top row and a projective saddle in the bottom take a Morse function over a non-orientable 2-manifold with- row. In each case, we show the corresponding new piece of the

out boundary whose Reeb graph has no loop and cut  holes Reeb graph on the side. The solid and dotted lines show the level in sequence, such that no two boundary components meet set before and after passing the saddle, and we get symmetric pic- a common contour cycle. To show that the upper bound is tures (and upside down Reeb graph pieces) by switching solid with tight, we use the construction of Figure 3 and replace tunnels dotted lines.

by double cross-caps and, if is odd, add a single cross-cap

Ô ·½ ary, we have two cases per minimum and maximum. If

at the top. As illustrated in Figure 6, this is done so all pro-

Ä ·½ is a boundary minimum, then either develops a new jective saddles have smaller function values than the blanket contour path or it splits a contour cycle or path open, as illus- at the left and right shoulders. trated in Figure 8. We have the symmetric cases for boundary maxima. 4 Sweep Algorithm

In this section, we describe an algorithm that constructs the

 Å Ê Reeb graph of a function  . We remain on an abstract level and defer implementation details to Section 5. Figure 8: Evolution of the level set while passing through a bound- ary critical point. If that point is a minimum, the level set progresses Scheduling critical points. We construct the Reeb graph from solid to dotted lines and the Reeb graph from bottom to top.

For a boundary maximum the progress is the other way round. ½

by maintaining the level set while sweeping Ê from to ½ · . By definition of Morse functions, the critical points have pairwise different function values. It follows we can or-

Abstract data type. We store a level set as a collection

Ô Ô Ô  ´Ô µ ´Ô µ

¾   der them as ½ such that whenever

of contour cycles and paths. The sweep is translated into a

  ´Ô µ ½  ´Ô µ½

 ·½ . Define ¼ and and choose a

sequence of operations manipulating this collection. These

Ø Ô Ô

·½

value strictly between the function values of and , ½

operations create, destroy, cut, and glue cycles and paths:

 Ä   ´Ø µ

for each . Let be the corresponding level sets. Ä

In general, consists of finitely many closed curves (con- MKCYCLE and MKPATH create new contour cycles and tour cycles) and curves with endpoints (contour paths). The contour paths.

5 RMCYCLE and RMPATH destroy old contour cycles and contour paths. CUT splits a cycle open to a path or a path into two paths. regular minimum maximum saddle GLUE connects two ends of a path to form a cycle or two ends of two different paths to form one path.

To determine the effect of a cut operation, we need to be regular minimum maximum able to tell a cycle from a path. Similarly, to determine the effect of a glue operation, we need to be able to tell Figure 9: Regular and critical points as classified by the (solid) lower link, which is a subset of the (otherwise dotted) link. whether two endpoints belong to the same or to two dif-

ferent paths. Assuming that ability, we have an algorithm

Ù

 Å Ê

that constructs the Reeb graph of  by main- Consider second a boundary vertex . Its link is a half-circle.

Ú Û

taining the level set during a sweep. Each interior mini- Along the boundary, Ù has two neighbors and , which are

´Ú µ ´Û µ mum/maximum translates into a cycle creation/destruction, the endpoints of the half-circle. Assuming  ,we

each interior saddle translates into two cut and two glue op- call Ù a boundary 

erations, and each boundary minimum/maximum translates 

 ´Ú µ ´Ùµ ´Û µ  regular point 

into a creation/destruction or a cut/glue operation. In total,

´Ú µ ´Ùµ ´Û µ

minimum if 

  

we have at most  operations.

´Ú µ ´Ùµ ´Û µ maximum  Figure 9 illustrates only the simple cases. Non-simple cases

5 PL Implementation reduce to simple ones. For example, a  -fold saddle can be

split into  simple saddles, as described in [5]. Similarly, a In this section, we make the sweep algorithm of Section 4 boundary minimum/maximum with more complicated lower concrete by assuming a piecewise linear input representa- link than shown in Figure 9 can be split into simple (inte- tion. It applies to the case common in practice, in which rior) saddles and a (simple) boundary minimum/maximum. a function is only probed at a finite set of locations. Note that we just eliminated the rightmost two cases in Fig-

ure 8. The corresponding smooth operation bends Å a lit-

PL representation. A triangulation of a 2-manifold Å is tle near the boundary and thus creates a saddle right next to

a simplicial complex à whose underlying space is homeo- the boundary minimum/maximum. In addition to having all

ÎÖØ Ã

morphic to Å; see eg. [1, 15]. Writing for the collec- non-simple critical points split into simple ones, we assume

³´Ùµ  ³´Ú µ Ù  Ú Ã

ÎÖØ Ã Ê

tion of vertices, we use a map ³ and define for all vertices of . Å the function  over the 2-manifold by linear extension

over the simplices. It is clear that  is not smooth and thus PL algorithm. The combinatorial structure of the piece- Ã

definitely not a Morse function. We can, however, modify wise linear representation of  is now simple enough to al-  and ³ such that has combinatorial properties that resemble low a direct implementation of the sweep algorithm, which

the generic smooth properties of Morse functions. We need processes the vertices of à in the sequence of increasing

some definitions to explain this. The star of a vertex Ù con- function values. A generic level set consists of finitely many

sists of all simplices that share Ù, the link consists of all faces contour cycles and contour paths. We store each cycle as a

of simplices in the star that do not belong to the star them- cyclic list and each path as a linear list of edges in à . These selves, and the lower link is the subset of the link induced by edges carry the vertices of the contours, and the triangles be-

vertices with function value less than Ù: tween them carry their edges. We now discuss how the col-

lection of cyclic and linear lists changes as we pass through

ËØ Ù   ¾ Ã  Ù ¾ 

à Ù

a vertex Ù of .If is regular, we just replace its descend-

Ù   ¾ Ã    ¾ ËØ Ù  ¾ ËØ Ù Ä ing edges (which all belong to a single list) by its ascending

edges. In addition to the operations listed in Section 4, we

Ä Ù   ¾ Ä Ù  Ú ¾  µ  ´Ú µ ´Ùµ therefore need the following two:

We use the link and the lower link to classify the vertices DELETE removes an edge from a cyclic or linear list. into the various types of critical points we observe in the INSERT adds an edge to a cyclic or linear list.

smooth setting. Consider first an interior vertex Ù. Its link

Ù Ù is the cycle of edges and vertices surrounding Ù. We call Similarly, if is critical, we remove its descending edges and

regular if the lower link is a non-empty connected segment add its ascending ones. However, now the level set changes Ù

of the link; in all other cases, Ù is critical. Specifically, its topology, which is reflected by structural changes in the

Ä Ù  Ù Ä Ù 

is a minimum if , is a maximum of collection of lists caused by the cut and glue operations, as

Ù  Ä Ù  ·½  ¾ Ä Ù

, and is a -fold saddle if consists of described in Section 4. To identify structural changes, we components along the link. This is illustrated in Figure 9. use yet another operation:

6

Ò ÐÓ Ò

FIND determines the list that contains a given edge of à . of loops and give an O( ) time algorithm to construct a

ÐÓ Ò Reeb graph. It would be interesting to prove that O(Ò ) The effect of the cut and glue operations is determined by is indeed optimal or, alternatively, to improve the algorithm. finding the lists from which the descending edges are re- Maybe one of the lower bounds in [11] can be extended to moved and to which the ascending edges are added. By prove the optimality of our algorithm. restriction to simple critical vertices, these edges belong to either one or to two lists. The corresponding local pieces Our understanding of Reeb graphs for 3-manifolds is appended to the Reeb graph are shown in Figure 10. much less developed. It is no longer true that the number of loops for an orientable manifold without boundary is inde- two one two one pendent of the function. For example, a 3-torus can have zero after or one loop in the Reeb graph. Furthermore, the existence of at a Heegard decomposition shows that every 3-manifold has a before Morse function whose Reeb graph is a tree. We also have no one two two one algorithm for constructing the Reeb graph of a Morse func- tion over a 3-manifold that runs in time less than quadratic Figure 10: Adding nodes of degree 3, 3, 4, and 2 to the Reeb graph; compare with Figure 7. in the size of the representing triangulation.

References Data structure and analysis. To implement all operations efficiently, we represent each list (cyclic and linear) as a bal- [1] P. S. ALEXANDROV. Combinatorial Topology. Republication anced search tree [4]. Each insertion and deletion takes time of three volumes published in 1956, 57, 60, Dover, Mineola, at most logarithmic in the size of the list. Finding a given New York, 1998. edge is implemented by walking upward to the root of the [2] C. L. BAJAJ,V.PASCUCCI AND D. R. SCHIKORE. The tree, which also takes at most logarithmic time. Finally, cut contour spectrum. In “Proc. IEEE Visualization, 1997”, 167Ð and glue operations are implemented by splitting and con- 175. catenating trees. Here it is important that each list is marked as either cyclic or linear, because cutting a linear list trans- [3] H. CARR,J.SNOEYINK AND U. AXEN. Computing con- lates into splitting to generate two linear lists, while cutting a tour trees in all dimensions. Comput. Geom. Theory Appl. 24 cyclic list translates into splitting and concatenating the two (2002), 75Ð94. pieces to generate a single linear list. Similar distinctions [4] T. H. CORMEN,C.E.LEISERSON AND R. L. RIVEST. have to be made when we glue two ends of one or two linear Introduction to Algorithms. MIT Press, Cambridge, Mas- lists. Standard balanced search trees support split and con- sachusetts, 1994. catenate operations again in logarithmic time. The random- ized search trees developed by Seidel and Aragon [14] are [5] H. EDELSBRUNNER,J.HARER AND A. ZOMORODIAN. Hi- particularly well suited for our purposes because they lend erarchical Morse-Smale complexes for piecewise linear 2- themselves to rather simple implementations of all necessary manifolds. Discrete Comput. Geom., to appear. operations. Furthermore, experiments indicate that they out- [6] A. T. FOMENKO AND T. L. KUNII,(EDS). Topological perform all alternative data structures in practice. Methods for Visualization. Springer-Verlag, Tokyo, Japan,

To give a bound on the running time of the above algo- 1997.

à à rithm, we let Ò be the number of edges in . Note that

[7] M. GORESKY AND R. MACPHEARSON. Stratified Morse Ò contains fewer than Ò triangles and fewer than vertices. We

Theory. Springer-Verlag, Heidelberg, Germany, 1988.

Ò ¾Ò use Ò insertions, deletions, and find operations to pro- cess all edges. Furthermore, we use at most two cut and two [8] M. HILAGA,Y.SHINAGAWA,T.KOMURA AND T. L. KU-

glue operations per vertex. Each operation takes time at most NII. Topology matching for fully automatic similarity estima-

Ò Ò ÐÓ Ò O(ÐÓ ), adding up to a total time of at most O( )to tion of 3D shapes. In “Computer Graphics Proc., SIGGRAPH

construct the Reeb graph of  . If we use randomized search 2001”, 203Ð212. trees we get the same running time but only in the expected and not the worst case. [9] M. VA N KREVELD,R.VA N OOSTRUM,C.L.BAJAJ,V. PASCUCCI AND D. R. SCHIKORE. Contour trees and small seed sets for isosurface traversal. In “Proc. 13th Ann. Sym- 6 Discussion pos. Comput. Geom., 1997”, 212Ð220. In this paper, we study Reeb graphs of Morse functions [10] W. S. MASSEY. Algebraic Topology: An Introduction. Sprin- ger-Verlag, New York, 1967. over 2-manifolds with and without boundary. The number of loops is these graphs depends on the topology of the 2- [11] K. MEHLHORN,S.NAHER¬ AND H. ALT. A lower bound manifold and sometimes but not always on the Morse func- on the complexity of the union-split-find problem. SIAM J. tion. We prove tight upper and lower bounds on the number Comput. 17 (1988), 1093Ð1102.

7 [12] V. PASCUCCI AND K. COLE-MCLAUGHLIN. Efficient com- putation of the topology of level sets. Algorithmica, to appear.

[13] G. REEB. Sur les points singuliers d’une forme de Pfaff compl`ement int«egrable ou d’une fonction num«erique. Comptes Rendus de L’Acad«emie ses S«eances, Paris 222 (1946), 847Ð849.

[14] R. SEIDEL AND C. ARAGON. Randomized search trees. Al- gorithmica 16 (1996), 464Ð497.

[15] H. SEIFERT AND W. THRELFALL. Lehrbuch der Topologie. Chelsea, New York, 1934.

[16] Y. SHINAGAWA AND T. L. KUNII. Constructing a Reeb graph automatically from cross sections. IEEE Comput. Graphics Appl. 11 (1991), 44Ð51.

[17] Y. SHINAGAWA,T.L.KUNII,H.SATO AND M. IBUSUKI. Modeling contact of two complex objects: with an appli- cation to characterizing dental articulations. Computers and Graphics 19 (1995), 21Ð28.

[18] S. YOSHIHISA,T.L.KUNII AND Y. L . K ERGOSIAN. Sur- face coding based on . IEEE Comput. Graphics Appl. 11 (1991), 66Ð78.

8