Optimal Morse functions and H( M 2 ,A) in O ~ (N) time
OOptimal Morse functions and H ( M , A ) in ˜ O ( N ) time Abhishek Rathore Visualization & Graphics Lab., CSA Dept., Indian Institute of Science, Bangalore,India.
Abstract
In this work, we design a nearly linear time discrete Morse theorybased algorithm for computing homology groups of 2-manifolds, therebyestablishing the fact that computing homology groups of 2-manifoldsis remarkably easy. Unlike previous algorithms of similar flavor, ourmethod works with coefficients from arbitrary abelian groups. Anotheradvantage of our method lies in the fact that our algorithm actuallyelucidates the topological reason that makes computation on 2-manifoldseasy. This is made possible owing to a new simple homotopy basedconstruct that is referred to as expansion frames . To being with weobtain an optimal discrete gradient vector field using expansion frames.This is followed by a pseudo-linear time dynamic programming basedcomputation of discrete Morse boundary operator. The efficient designof optimal gradient vector field followed by fast computation of boundaryoperator affords us near linearity in computation of homology groups.Moreover, we define a new criterion for nearly optimal Morse functionscalled pseudo-optimality. A Morse function is pseudo-optimal if wecan obtain an optimal Morse function from it, simply by means ofcritical cell cancellations. Using expansion frames, we establish thesurprising fact that an arbitrary discrete Morse function on 2-manifoldsis pseudo-optimal.
Classical Morse Theory [16, 17] analyzes the topology of the Riemannianmanifolds by studying critical points of smooth functions defined on it. Inthe 90’s Robin Forman formulated a completely combinatorial analogue ofMorse theory, now known as discrete Morse theory. The fact that Forman’stheory can be formulated in language of graph theory makes it possibleto use powerful machinery from modern algorithmics to provide efficientalgorithms with rigorous guarantees. It is worth noting that the reader canunderstand this work without any prior knowledge of Morse theory as long as1 a r X i v : . [ c s . C G ] M a y e understands the equivalent graph theory problem. Knowledge of discreteMorse theory is however useful for the more inclined reader who wishes tounderstand the context and wider range of applicability of this work. Insubsection 1.2, we provide a quick overview of the graph theory setting ofdiscrete Morse theory in order to enable the reader to make a quick forayinto the core computer science problem at hand. Forman provides an extremely readable introduction to discrete Morse theoryin [7].
Notation 1.
The relation ’ ≺ ’ is used to denote the following: τ ≺ σ → τ ⊂ σ & dim τ = dim σ − . Notation 2 (The d-(d-1) level of Hasse graph) . By the term, d-(d-1) levelof Hasse graph H we mean the subset of edges of the Hasse graph that joind-dimensional cofaces to (d-1)-dimensional faces of Hasse graph. Definition 3.
Boundary & Couboundary of a simplex σ : We definethe boundary and respectively coboundary of a simplex as bd σ = { τ | τ ≺ σ } cbd σ = { ρ | σ ≺ ρ } Definition 4.
Discrete Morse Function:
Let K denote a finite regularcell complex and let L denote the set of cells of K . A function F : L → R iscalled a discrete Morse function (DMF) if it usually assigns higher valuesto higher dimensional cells, with at most one exception locally at each cell.Equivalently, a function F : L → R is a discrete Morse function if for every σ m ∈ L we have:( A .) N ( σ ) = { ρ ∈ cbd σ |F ( ρ ) ≤ F ( σ ) } ≤ ( B .) N ( σ ) = { τ ∈ bd σ |F ( τ ) ≥ F ( σ ) } ≤ A cell σ is critical if N ( σ ) = N ( σ ) = 0 ; A non-critical cell is a regularcell . Definition 5 (Combinatorial Vector Field) . A combinatorial vector field (DVF) V on L is a collection of pairs of cells {(cid:104) α, β (cid:105)} such that { α m ≺ β ( m +1) } and each cell occurs in at most one such pair of V . Definition 6 (Discrete Gradient Vector Field) . A pair of cells { α m ≺ β ( m +1) } s.t. F ( α ) ≥ F ( β ) determines a gradient pair . A discrete gradi-ent vector field (DGVF) V corresponding to a DMF F is a collection ofcell pairs α ( p ) ≺ β ( p +1) such that α ( p ) ≺ β ( p +1) ∈ V iff F ( β ) ≤ F ( α ) . efinition 7. We define V -path to be a cell sequence σ ( m )0 , τ ( m +1)0 , σ ( m )1 , τ ( m +1)1 , . . . σ ( m ) q , τ ( m +1) q , σ ( m ) q +1 s.t. for i = 0 , . . . q, { σ i ≺ τ i } ∈ V , σ i ≺ τ i (cid:31) σ i +1 and σ i (cid:54) = σ i +1 . The V -path corresponding to a DMF F is a gradientpath of F . Theorem 8 (Forman [6]) . Let K be a CW Complex with a DMF F definedon it. Then K is homotopy equivalent to a CW complex Ω , such that Ω has precisely one m-dimensional cell for every m-dimensional critical cellin K and no other cells besides these. Moreover, let c m be the number ofm-dimensional critical cells, β m the m th Betti Number w.r.t. some vectorfield V and n the maximum dimension of K . Then we have: The Weak Morse Inequalities: ( A . ) For every m ∈ { . . . n } : we have c m ≥ β m . (1) ( B . ) c − c . . . + ( − n c n = β − β . . . + ( − n β n = χ ( K ) (2) The Strong Morse Inequalities:
For every m ∈ [0 , n ] : c m − c m − . . . + ( − m c ≥ β m − β m − . . . + ( − m β (3) Notation 9.
We shall denote the sum of Betti numbers by the symbol Λ andsum of number of critical cells by symbol Υ . In other words, Λ def = n (cid:88) i =0 β i Υ def = n (cid:88) i =0 c i . Notation 10.
The symbol ˜ O ( n ) is used to indicate nearly linear . It is givenby ˜ O ( n ) = n (log n ) O (1) . Note 1.1.
Given a DGVF, we can use topological sort to obtain a totalorder on the cells and then assign (arbitrary) ascending function valuesto the sorted list of cells. This will give us a Morse function that agreeswith the partial order imposed by the gradient vector field. Any such Morsefunction will have the same critical cells as the gradient vector field. Hence,we shall use the terms optimal Morse function and optimal gradient vectorfield interchangeably.
Definition 11 (WMOC) . Let Υ ( M ) denote the sum of Morse numbersacross all dimensions for the optimal DGVF on M . We say that a fam-ily of simplicial complexes Ω satisfies the weak Morse optimality condition( WMOC ) when ∀M ∈ Ω , Υ ( M ) = ˜ O (1) . In other words, Υ ( M ) (cid:28) |M| uniformly ∀M ∈ Ω . .2 Graph Theoretic Reformulation Given a simplicial complex K , we construct its Hasse Graph representation H K (an undirected, multipartite graph) as follows: To every simplex σ d K ∈ K associate a vertex σ d H ∈ H K . The dimension d of the simplex σ d K determinesthe vertex level of the vertex σ d H in H K . Every face incidence ( τ d − K , σ d K ) determines an undirected edge (cid:104) τ d − H , σ d H (cid:105) in H K . Now orient the graph H K to a form a new directed graph H K . Initally all edges of H K have defaultorientation. The default orientation is a directed edge σ d H → τ d − H ∈ H K that connects a k-dim node σ d H to a (k-1)-dim node τ d − H . Finally, associatea matching M to graph H K . If an edge (cid:104) τ d − H , σ d H (cid:105) ∈ M then, reverse the orientation of that edge to τ d − H → σ d H ∈ H K . The matching inducedreorientation needs to be such that the graph H K is a Directed Acyclic Graph.A graph matching on H K that leaves the graph H K acyclic in the mannerprescribed above is known as Morse Matching . Table 1 provides a translatingdictionary from simplicial complexes to their Hasse graphs. See Figure 1.
Joswig et al. [10] proved the NP-completess of the decision problem andposed the approximability of optimality of Morse gradient vector fields (forgeneral dimensional complexes) as an open problem, by pointing out an errorin Lewiner’s claim about inapproximability in [13]. Recently [18] provided an O (log n ) factor ˜ O ( n ) time approximation algorithm for the optimal discretegradient vector field (that minimizes the number of critical cells). Recently,Burton et al. [5] developed an FPT algorithm for optimizing Morse functions.Some of the notable works that seek optimality of Morse matchings byapplying heuristics in general are [1, 2, 8, 9, 10, 15, 4]. The works thatconstitute more relevant prior work for us are those that achieve optimalityby restricting the problem to 2-manifolds in nearly linear time [11, 14] andquadratic time [3] respectively. Ours is however the first algorithm to computehomology groups of 2-manifolds with arbitrary coefficients in nearly lineartime. The analytic formula for boundary operator is given in Forman[6]. Theobvious interpretation of the formula gives an exponential time algorithm.We give an efficient O ( κn ) time algorithm where κ is the total number ofcritical cells which is nearly-linear if the number of topologically interesting4igure 1: Matching induced orientation of Hasse GraphTable 1: Graph Theoretic dictionary for Morse Matching Morse theory on Cell Complex K Graph theory on Hasse Graph H K
1. gradient Pair (cid:104) α d − , β d (cid:105) ∈ V Matched pair of vertices ( α, β ) ∈ H K
2. Dimension d Multipartite Graph Level d3. σ d − ≺ τ d s.t. (cid:104) σ d − , τ d (cid:105) / ∈ V Default down-edge τ → σ σ d − ≺ τ d s.t. (cid:104) σ d − , τ d (cid:105)∈ V Matching up-edge σ → τ V -Path Directed Path6. Non-trivial Closed V -Path Directed Cycle7. CVF Matching on the Hasse Graph8. DGVF Morse Matching (i.e. Acyclic Matching)9. Critical Cell ζ d Unmatched Vertex ζ
10. Regular Cell ξ d Matched Vertex ξ pseudolinear time complexity algorithm for boundary operator Computation.We note of the following Theorem from Forman[6]: Theorem 12 (Boundary Operator Computation. Forman [6]) . Consider anoriented simplicial complex. Then for any critical (p+1)-simplex β set: (cid:52) β = (cid:88) critical α ( p ) P αβ αP αβ = (cid:88) γ ∈ Γ ( β,α ) Θ ( γ ) where Γ ( β, α ) is the set of discrete gradient paths which go from a face inthe boundary of β to α The multiplicity Θ ( γ ) of any gradient path γ is equalto ± depending on whether given γ the orientation on β induces the chosenorientation on α or the opposite orientation. The formula for the boundaryoperator above computes the homology of complex K. We observe that we need ’formal sums’ of critical cells at each critical cell.However, there is an advantage in calculating these formal sums for interme-diate regular cells as well since this can potentially speedup calculations atcritical cells. Since topological sort also does ordering for us, we can start atthe lowest valued critical cell. We proceed to the next higher valued cell andobserve that we have two cases.Also, we assume that our complex has a pre-assigned orientation. Theangular brackets <, > in the formulae above denote the pre-assigned orien-tation. Once the boundary operator is ready we use Smith normal formalgorithm over a collapsed complex that is provably significantly smaller thanthe original complex, in a mathematically precise sense.Let us denote by (cid:52) σ the boundary operator computation for cell σ m . Wenow make an inductive hypothesis that the computation of the (cid:52) operatorhas been done for all the maximal faces / single coface (since they are alllower valued Morse cells). Then the value of the (cid:52) operator for the new cellis calculated as follows:
Case 1:
All flow emanating from a cell goes out through its boundaryfaces. No lower-valued co-faces. (cid:52) σ = (cid:88) τ i ≺ σ ∃ ξ s.t. (cid:104) τ i ,ξ (cid:105)∈ V m (cid:104) τ i ,σ (cid:105) / ∈ V m (cid:52) τ i × < ∂σ, τ i > + (cid:88) α j ≺ σ (cid:1) ∃ ξ s.t. (cid:104) α j ,ξ (cid:105)∈ V m (cid:1) ∃ ζ s.t. (cid:104) ζ, α j (cid:105)∈ V m − α j × (cid:104) ∂σ, α j (cid:105) (4)6he first formula takes care of Case 1 where flow goes out through thefaces of the boundary. Note that in the formula above, τ m − is a placeholderfor non-critical faces (if any) of σ m , i.e. { τ m − ≺ σ m } , which are not a part ofthe Discrete Gradient vector field which is equivalent to saying f ( τ ) < f ( σ ) .Similarly, α m − is a representative for the critical faces (if any) of σ m . Thisformula holds irrespective of whether σ m itself is critical or non-critical. Incase of computation of boundary of a critical σ m such that m = 0 , i.e. when σ m is a critical point, the boundary is null. Case 2:
The cell has lower valued coface. (cid:52) σ = < ∂β, σ > ×(cid:52) β (5)The second formula takes care of Case 2 when σ m has a lower valuedco-face β m +1 . Case 3:
The 0-dimensional cell σ is the unique minima. (cid:52) σ = ∅ (6) Theorem 13 (Boundary Operator Computation: Correctness Proof) . TheAlgorithm correctly computes boundary operator (cid:52) .Proof.
Note that, to begin with we start with a list of cells in an ascendingtotal order. Let us call this list L . This total order is one of the total ordersthat is compatible with the partial order prescribed by the gradient vectorfield V . If we assign the function value ’i’ i.e. the index of some cell L [ i ] to each cell in L , we essentially obtain a Morse function compatible withthe gradient vector field. The first cell we process is one with the lowestfunction value (i.e. the unique minima). This cell is then followed by cellswith increasingly higher Morse function values. To prove that the formulaiccomputation of the (cid:52) operator as expressed in subroutine calcBdryOp () is,in fact, the same as expressed in Theorem 12 we proceed by induction. Let σ denote the unique minima. The base case of induction for (cid:52) σ is trivial.Now suppose that for all cells in the set { σ , σ , . . . σ I } , we have correctlycomputed the boundary operator as prescribed in Theorem 12. Now supposewe encounter cell σ I +1 . Suppose that σ I +1 has a lower valued coface β i.e.( σ I +1 ≺ β & (cid:104) σ I +1 , β (cid:105) ∈ V ). Since β has lower function value as comparedto σ I +1 (by hypothesis), we conclude that β = σ J +1 for some J < I . Allpaths emanating from σ I +1 must go through β . The orientation induced bysome path γ i β γ i (cid:32) ρ from β to some critical cell say ρ is ι where ι = ± , thenthe orientation of path σ I +1 β ◦ γ i ρ will be (cid:104) ∂β, σ I +1 (cid:105)× ι . Therefore, the totalcount of paths (with induced orientation accounted for) will be (cid:104) ∂β, σ (cid:105) × (cid:52) β .7ence, the boundary operator computation done in calcBdryOp () is validfor the case when σ I +1 has a lower valued coface.Finally, assume that σ I +1 does not have any lower valued coface. Therefore,the flow leaving from σ I +1 will be through each of its faces (except possiblyone higher valued face). If it indeed has a (matched) higher valued face thenflow will be entering it through that face and hence the face in question isn’trelevant in calculating the weighted sum of gradient paths that leave σ I +1 .When consider lower valued faces of σ I +1 , we make a distinction betweenfaces that are non-critical and those those that are critical. If a face say α j is critical, then clearly we are justified in directly including the entry α j × (cid:104) ∂σ, α j (cid:105) as part of our «formal sum» that makes up the cell boundary.As for the non-critical entries of the formula, namely [ (cid:52) τ i × < ∂σ, τ i > ] , weimpose an additional constraint (cid:104) τ i , ξ (cid:105) ∈ V m (as opposed to (cid:104) ξ, τ i (cid:105) ∈ V m − )in the summation. In doing so, we are ruling out all entries that wouldvalid directed paths going out of σ I +1 but those that won’t add up to makegradient paths as prescribed by Theorem 12. Now since τ i is lower valued itsboundary (cid:52) τ i has already been calculated correctly by Induction Hypothesis.But clearly every gradient path emerging from σ I +1 must first pass throughone of these τ i ’s. Also, for each of these gradient paths, the orientations willchange precisely by the multiple of (cid:104) τ i , ξ (cid:105) . Therefore the weighted sum of(non-trivial) gradient paths from σ I +1 will be the sum of all the contributionsby boundaries of each of the non-critical faces τ i . To complete the argumentfor the induction step, we note that these sums along with contributionsfrom the critical faces of σ I +1 takes into account each gradient path preciselyonce. Also, it is easy to see that multiplication by co-orientation at each stepprovides the weights to ensure that the final entry will decide the inducedorientation. Hence proved. Theorem 14 (Complexity of Computing Boundary Operator) . The com-plexity of computing the boundary operator is O ( Υ × N ) .Proof. For the Hasse graph H ( V , E ) of a simplicial complex, E ≤ V × D where D is the maximum dimension of cells in the complex (which in our case is2). Therefore, |E| = O ( |V| ) . (It is easy to show that for a cubical complexesas well, number of edges is O ( |V| ) ).The complexity of computing topologicalsort of the oriented Hasse graph is O ( |V| + |E| ) which is same as O ( |V| ) ,assuming that our input manifold is either simplicial or cubical.The for loop in Lines 8-21 of procedure calcBdryOp () costs at the most O ( Λ ) per iteration while the total number of iterations is O ( |V| ) . Butsince in our case, using Theorem 29, Λ = Υ , the total cost of the for loopis O ( |V| × Υ ) . Therefore, complexity of computing boundary operator is8 ( |V| × Υ ) = O ( N × Υ ) , since the number of vertices in the Hasse graph issame as number of cells in the complex (i.e. the size of the complex namely N ).It is worth noting that in vast majority of the practical scenarios N ≫ Υ ,enough for us to assume that compared to the size of the complex, the’topological complexity’, Υ is nearly a constant. We therefore use the notation ˜ O ( · ) (where O ( Υ × N ) = ˜ O ( N ) ) to indicate the nearly linear time complexityof boundary operator computation. Notation 15.
Let the set B ( α ) denote the 0-dim cells (vertices) and 1-dim.cells (edges) incident on α if α is 2-dimensional and let B ( α ) denote the0-dim cells incident on α if α is 1-dimensional. Definition 16 (Semigraph) . A semigraph is a set of vertices and edges s.t.every edge may have either one or two vertices incident on it.
Semigraphs generalize graphs in the sense that, in a graph, every edge isincident on precisely two vertices.
Definition 17 (Frame of expansion of a critical cell) . Given a critical cell α n where ( n ≥ ), consider the set of all cells that can be reached from α , byfollowing one of the gradient paths within the gradient vector field. We callthis set the expansion set of critical cell α and denote it by (cid:98) α . The frameof expansion of α is the n − -dim. boundary of (cid:98) α along with the n − dim.cells incident on these boundary cells. We denote the frame of expansion of α by (cid:98) α . Definition 18 (Frame of expansion of a boundary cell) . Given a regularboundary cell ξ n − where ( n ≥ ), suppose that (cid:104) ξ, χ (cid:105) forms a gradient pair.Now consider the set of all cells that can be reached from ξ , by following oneof the gradient paths within the gradient vector field. We call this set the expansion set of boundary cell ξ and denote it as (cid:98) ξ . The frame of expansion of ξ is the n − -dimensional boundary of (cid:98) ξ . We denote it as (cid:98) ξ . Note 3.1 (Method of addition of cells upon expansion) . It must benoted that if there is an expansion along τ into cell (cid:36) , then we delete τ from the frame and the set B ( (cid:36) \ τ ) is added into the frame. ote 3.2. Suppose we are given a regular 2-cell (cid:36) , s.t. the 1-cell τ ∈ (cid:36) . The boundary of τ namely B ( τ ) consists of two vertices say λ and ρ . Note that within the set B ( (cid:36) ) , there exist two non-intersectingpaths that connect λ and ρ . One path involves the singular edge τ , theother path consists of edges belonging to the set B ( (cid:36) \ τ ) Definition 19 (connectedness, connecting path) . Consider two cells σ ( m − , τ ( m − in a complex K n . We say that σ and τ are said to be Type 1 connected in complex K if there exists a cell sequence φ ( m − , γ ( m )0 , φ ( m − , γ ( m )1 , . . . φ ( m − q , γ ( m ) q , φ ( m − q +1 s.t. for i = 0 , . . . q , φ i ≺ γ i (cid:31) φ i +1 , φ = σ , φ q +1 = τ and φ i (cid:54) = φ i +1 . This sequence of cells, φ ( m − . . . φ ( m − q +1 is knownas a connecting path . Analogously, we say that σ m and τ m are Type 2connected in complex K n if there exists a cell sequence γ ( m )0 , φ ( m − , γ ( m )1 , φ ( m − , . . . γ ( m ) q , φ ( m − q , γ ( m ) q +1 s.t. for i = 0 , . . . q , γ i (cid:31) φ i ≺ γ i +1 , γ = σ , γ q +1 = τ and γ i (cid:54) = γ i +1 . The sequence of cells, γ ( m )0 . . . γ ( m ) q +1 is known as a connecting path . Finally, we say that, σ m and τ ( m − are Type 3 con-nected if there exists a cell η ( m − ≺ σ m with Type 2 connectedness between η and τ .Finally, we say that a set of m − and m dim. cells are said to form a connected set if for any pair of m − dim. cells (alternatively, for any pairof m dim. cells) we can find sequence of connecting cells as prescribed above. ˜ O ( n ) -Time Algorithm for Computing Ho-mology of 2-manifolds Notation 20.
Given manifold M , we use the notation M d to denote thed-dimensional cells of manifold M . Definition 21 (Boundary faces, Coboundary faces) . Given a complex K ,if there exists a cell ϑ d of dimension d s.t. there exists a unique ( d + 1) -dimensional cell (cid:36) ( d +1) satisfying ϑ ≺ (cid:36) , then we call ϑ a d-dimensionalboundary face of complex K . Also, in this case, (cid:36) is known as a ( d + 1) -dimensional coboundary face of complex K . Definition 22 (Boundary and Coboundary) . Given a complex K , the list ofall d-dimensional boundary faces of K is known as the d-dimensional boundaryof K . Also, list of all d-dimensional coboundary faces of K is known as thed-dimensional coboundary of K . efinition 23 ( n -flow) . The set of gradient paths in vector field V onmanifold M that involve alternating n -dim. and ( n − -dim. cells is knownas the n-flow of V Algorithm 1 Homology () procedure calcHomology ( M , A ;) We use the mainFrame() subroutine to design a vector field V on M . We then use subroutine calcBdryOp() to calculate the boundary operator (cid:52) c for DGVF V . Finally, using chain complex implied by boundary operator (cid:52) c , we calculatehomology of M (with coefficients coming from arbitrary abelian group A )using Smith Normal Form. end procedure procedure calcBdryOp ( M , H , V ) topologicalSort ( H , V , L , ’ASCENDING’); σ = L [1] ; (cid:52) σ = ∅ ; for ≤ i ≤ |L| ; σ := L [ i ] do if (cid:104) σ, β (cid:105) is a gradient pair then (cid:52) σ = < ∂β, σ > ×(cid:52) β ; else Let τ i ≺ σ be the set of regular cells incident on σ s.t. (cid:104) τ i , σ (cid:105) / ∈ V ; Let α i ≺ σ be the set of critical cells incident on σ ; (cid:52) σ = (cid:80) (cid:52) τ i × < ∂σ, τ i > + (cid:80) α i × < ∂σ, α i > ; end if if σ is a critical cell then (cid:52) c σ := (cid:52) σ ; end if end for (cid:52) c is the Morse boundary operator corresponding to vector field V . end procedure Lemma 24.
Suppose there exist two vertices α and γ that are connectedthrough edges that belong to some frame after a certain number of elemen-tary expansions. Then the two vertices will remain connected through edgesbelonging to that frame upon further expansions lgorithm 2 Frame Flow procedure findCoBdry ( M d ) Let M d be the list of d-dimensional cells of manifold M . Scan through the list M d . If a cell M d [ i ] has a face ϑ such that ϑ is the sole coface of M d [ i ] thenadd M d [ i ] to B d . B d = { (cid:36) ∈ M d | (cid:36) has at least one boundary face. } return B d ; end procedure procedure addPairToVectorField ( τ, ϑ, V , M , B d , d ) If τ (cid:54) = NIL and if τ isn’t already matched then do the following: (a.) Match τ to ϑ . (b.) Delete ϑ and τ from M d − and M d respectively. (c.) If τ ∈ B d then delete τ from list B d . (d.) Enqueue τ in Q . (e.) Add (cid:104) ϑ, τ (cid:105) to vector field V . end procedure procedure frameFlow ( M d , d, B d , V ) Dequeue a cell (cid:36) from B d . If the dequeue operation with list B d returns NILthen dequeue a cell from list M d . repeat repeat if (cid:36) is a cell that has been dequeued from list B d then if υ is a boundary face of (cid:36) then Invoke addPairToVectorField() in order to add (cid:104) υ, (cid:36) (cid:105) to V . else Delete (cid:36) from M d . end if end if for each face ϑ i of (cid:36) do If there exists µ i (cid:31) ϑ i s.t. µ i isn’t part of any gradient pair of V Then invoke addPairToVectorField() to add (cid:104) ϑ i , µ i (cid:105) to V . end for Dequeue a cell from queue Q . Call it (cid:36) . until (cid:36) (cid:54) = NIL
Dequeue a cell from queue B d . Call it (cid:36) . until (cid:36) (cid:54) = NIL end procedure procedure mainFrame ( M ) Invoke findCoBdry() to find coboundary B of M . Use frameFlow() to design vector field V on cells of M . E [1 : numEars ] := earDecompose ( M ) for ≤ i ≤ numEars do Invoke findCoBdry( E i ) to find B [ i ] Use frameFlow() to design vector field V on cells of ear E i . end for return V ; end procedure roof. By hypothesis, we assume that two vertices, say α and γ are con-nected through edges belonging to the frame after a certain number ofexpansions. Therefore there exists a connecting path P connecting the twovertices. Suppose w.l.o.g., we expand along some edge τ into cell (cid:36) . Wehave two cases. Case 1: τ / ∈ P . In this case, all edges in path P continue to belong to theframe after the expansion corresponding to gradient pair (cid:104) τ, (cid:36) (cid:105) . Therefore,even after this expansion, α and γ remain connected. Case 2: τ ∈ P . Suppose λ and ρ are the vertices of τ . Then there exists apath P s.t. P ⊂ P connecting α and λ . Also there exists another path P s.t. P ⊂ P connecting ρ and γ . However, from 3.2 we know that, λ and ρ are connected through edges that belong to set B ( (cid:36) \ τ ) . The original path P consists of edges P ∪ τ ∪ P . Upon expansion, we have a new path namely P ∪ { (cid:36) \ τ } ∪ P . Therefore, frame expansions maintain connectivity. Note 3.3 (2-Manifolds and Semi-graphs) . A 2-manifold without bound-ary has the structure of a simple graph (unrelated to Hasse graphs) inthe following sense: Let every 2-cell denote a vertex and let every 1-celldenote an edge connecting 2-cells. The manifold structure allows at mosttwo incident 2-cells for every 1-cell, whereas not having a boundary im-plies that the incidence number is exactly two for every 1-cell. Now if wehave a 2-manifold with boundary, then the boundary 1-cells will have onlyone incident 2-cell whereas all other 1-cells will have two incident 2-cells.Therefore a 2-manifold with boundary has the structure of a semi-graph.For a given 2-manifold M , let us denote the semigraph structure by G s ( M ) . Lemma 25.
Every vertex belonging to manifold M is included in the frame,when all expansions are processed.Proof. From
Note 3.3 , we know that the 2-cells and 1-cells of a given2-manifold M forms a semi-graph structure which we denote by G s ( M ) .We use the following convention: If a 2-cell, say τ is included in some gra-dient pair belonging to vector field V or if τ is the start cell of procedure frameFlow() described in Algorithm 2, the we say that vertex τ is traversed. Case 1:
Suppose M has no 1-dim. boundary faces. Then G s ( M ) as-sumes the structure of a connected simple graph. In this case, the procedure frameFlow() described in Algorithm 2 we begin with some starting 2-cell (cid:36) .While scanning through all the faces of (cid:36) , if we find a face ϑ s.t. µ (cid:54) = (cid:36) and µ (cid:31) ϑ and µ isn’t part of any gradient pair, then we traverse µ by adding13radient pair ϑ, µ to vector field V and add µ to a queue. Having processedall faces of (cid:36) , we dequeue a cell, say (cid:36) new from the the queue. We process (cid:36) new in exactly the same way as we process (cid:36) . And we keep doing this till thequeue is empty. Clearly, this is equivalent to a breadth first traversal on graph G s ( M ) . Given the fact that all vertices of a graph are traversed in a breadthfirst traversal, we conclude that except for the start cell, all other 2-cells arepart of some gradient pair. When the start cell (cid:36) is added, the expansionframe consists of B ( (cid:36) ) . Every time we add a gradient pair (cid:104) ϑ, µ (cid:105) to V , wedelete ϑ from the frame and add B ( µ \ ϑ ) to the frame. Since every vertex v i belonging to M is part of B ( µ \ ϑ ) for some 2-cell µ , we see that each vertex v i becomes part of the expansion frame at some stage of the construction ofthe frame. When new gradient pairs are processed, we may delete 1-cells fromout frame, but 0-cells are never deleted. So, all vertices of M eventually be-come part of the expansion frame. See Figure 11 and Figure 12 for an example. Case 2:
Suppose M has some 1-dim. boundary faces. In this case, G s ( M ) has the structure of a possibly disconnected semigraph. If the manifoldhas a coboundary face, say B then for the first connected component of G s ( M ) in lines 16-17 of Procedure frameflow() in Algorithm 2, we add theboundary-coboundary pair to vector field V . Following that, the cells thatare in the same connected component are added to the vector field in amanner similar to Case 1 . If there exists another connected component, thensurely such a connected component must have at least one coboundary face.In lines 29 and 28 of Procedure frameflow() in Algorithm 2, we check if sucha coboundary face exists. If it does exist then in the loop 13-29, we processthe every connected component in the same way as we process the very firstone. Given the fact that all connected components of semigraph G s ( M ) areprocessed, every 2-cell (cid:36) new in each of these components is part of vectorfield V . Suppose (cid:36) new is paired with some 1-cells ϑ new each time then, eachtime we delete ϑ new from the the frame and add B ( µ \ ϑ new ) to the frame.When new gradient pairs are processed, we may delete 1-cells from out frame,but 0-cells are never deleted. Since every vertex is incident on at least oneof the 2-cells in one of the connected components, we establish the fact thatall vertices eventually become part of the expansion frame. See Figure 8,Figure 9 and Figure 9 for such an example. Example: For a connected manifold K , this may happen, for instance when, say onethe 2-cells A is connected to other 2-cells only by the medium of 0-cells while the 1-cells of A are not shared with other cells. See Figure 8, Figure 9 and Figure 9 for another suchexample. ote 3.4. Every connected component of G s ( M ) has a 2-cell which sharesa 0-cell with a 2-cell from another connected component. If we imagineevery connected component of G s ( M ) as a vertex and every shared 0-cell asa hyperedge then we get a connected hypergraph that we write as H c ( M ) .We know that H c ( M ) is connected because if this were not the case thenclearly M itself will have more than one connected components. We call H c ( M ) the component hypergraph of M . Consider a gradient vector field V assigned to a manifold M . First considerthe case when M is a manifold without boundary. Consider a critical cell α .Note that before we do any expansions, B ( α ) is our original (cid:98) α . Let σ (cid:31) τ ≺ α .If (cid:104) τ, σ (cid:105) ∈ V then we can consider it as an expansion along τ to the cell σ .Now, as per the definition of frame expansion, we add the set {B ( σ ) \ { τ }} to (cid:98) α and we delete { τ } from (cid:98) α . Therefore, (cid:98) α = (cid:98) α − { τ } + {B ( σ ) \ { τ }} But, this is same as saying, (cid:98) α = {B ( α ) \ { τ }} + {B ( σ ) \ { τ }} . Clearly, thesets {B ( α ) \ { τ }} and {B ( σ ) \ { τ }} are themselves connected and both thesesets have a common boundary namely B ( τ ) (the boundary of τ ). Therefore,expansion along τ preserves the connectivity of (cid:98) α . Now, given our intermediatestage (cid:98) α , if any of the 1 dim. cells say ϑ i ∈ (cid:98) α forms a gradient pair with a dim. cell (cid:36) i then by expansion we have, (cid:98) α = (cid:98) α − { ϑ i } + {B ( (cid:36) i ) \ { ϑ i }} Each time we observe that the boundary of (cid:98) α and the boundary of {B ( (cid:36) i ) \{ ϑ i }} is, in fact, the same as the boundary of ϑ i namely B ( ϑ i ) . Therefore,upon expanding the frame (cid:98) α along ϑ i , connectivity of (cid:98) α is preserved and (cid:98) α continues to be a 1-manifold without boundary. Note that owing to themanifold nature of M , {B ( (cid:36) i ) \ { ϑ i }} never contains a (1) -dimensional face,say ϑ j (where j < i ), along which (cid:98) α was previously expanded. Therefore,because M is a manifold, the two encounters of ϑ j can happen in two differentways, namely: Case 1:
While constructing (cid:98) α through expansions, any face ϑ j can beencountered at most twice - once when it is included in (cid:98) α as part of some {B ( (cid:36) k ) } ( k < j ) and a second time if and when we expand along ϑ j . Evenas we expand along ϑ j , the two vertices of ϑ j stay connected. Case 2:
The other possibility of two encounters for the face ϑ j is when itis included in (cid:98) α as part of some {B ( (cid:36) k ) } ( k < j ) and some {B ( (cid:36) h ) } ( h < j ).15n this case, we never expand along ϑ j .If M has boundary then our start cell is a coboundary face and upon firstexpansion, the frame is a manifold with a boundary. Applying the reasoningabove, for a given connected component of G s ( M ) , the frame of expansionrestricted to a single connected component of G s ( M ) is a connected 1-manifoldwithout boundary. To arrive at the more general conclusion that the framesof expansion of all connected components of G s ( M ) , pieced together forma single connected 1-complex connecting all 0-cells of manifold M , we havethe lemma below: Lemma 26.
Given any sequence of elementary expansions, the frame of acritical cell α of a manifold M is always a connected set. Following the finalexpansion, the frame consists of a set of edges that connects all vertices ofthe complex.Proof. Consider without loss of generality, that M is a manifold withoutboundary. Then G s ( M ) has a single connected component. Every ver-tex within the frame that was previously connected, stays connected byLemma 24. Since, for a manifold without boundary, the frame always hasa single connnected component at every stage of expansion, and since byLemma 25, all vertices become part of the frame, we arrive at the conclusionthat all vertices of the frame form a single connected component at theconclusion of all expansions.The other case, when G s ( M ) has several connected components, we firstobserve that the frames of each of the connected component stays connectedby the same logic as in case of expansions of manifolds without boundary.Also, we observe that in such cases, every connected component will havea 2-cell which is connected to another connected component via a common0-cell. In fact, if there exist vertices v a and v b in two different connectedcomponents C a and C b . C a and C b may be interpreted as vertices in thehypergraph then we can first determine a path between C a and C b withinthe component hypergraph H c ( M ) . Now, every vertex C i in the path is aconnected component and every hyperedge is a shared 0-cell v i . If the pathis written as C , v , C , . . . , v i , C i , . . . v n , C n where C = C a and C n = C b .Then for every C i < i < n , we can determine an internal path (partof the expansion frame) in graph G s ( M ) between v i and v i +1 . Finally, ingraph G s ( M ) , we can find a path between v a and v within component C and a path between v n and v b within component C n as parts of expansionframes within those components. If we piece together each of the paths fromexpansion frames of various components of G s ( M ) along the path in thehypergraph H c ( M ) , we get a path connecting any two vertices v a and v b Lemma 27.
Applying the frame based algorithm on a 2-manifold gives us: c = β Proof.
Case1: β = 1 Suppose the 2-manifold does not have a boundary.Then clearly β = 1 . Now we will prove that in this case, c also equals .Recall that G s ( M ) takes the structure of a simple connected graph and theprocedure frameflow is equivalent to a breadth first traversal that begins witha start cell (cid:36) , where (cid:36) is not included in any of the gradient pairs. However,subsequently every neighboring 2-cell is paired with a 1-cell and added to aqueue. The neighbors of the dequeued cell are then scanned and if unpaired,they are paired with the connecting 1-cell as before. This process is continuedtill all 2-cells are exhausted (which happens at the conclusion of the breadthfirst traversal). Hence all 2-cells except the start 2-cell varpi form a gradientpair with some 1-cell, giving us c = 1 . Case2: β = 0 Now, consider the case when the 2-manifold has a boundary.So, we have β = 0 and we will prove that c also equals . Note that, inthis case, G s ( M ) has one or more connected components s.t. each of theconnected components has at least one coboundary face. For every componenta coboundary face is selected as a start cell and paired with a boundary faceto give a gradient pair. Subsequently, as before neighboring 2-cells are pairedwith connecting 1-cells if they haven’t been paired before. Newly paired2-cells are queued and this process continues till all 2-cells of the connectedcomponent are exhausted. In other words, every 2-cell of every connectedcomponent is part of a gradient pair giving us c = 0 . Hence proved. Note 3.5.
Let B be the coboundary of residual complex M . B [ i ] is partof the coboundary B that intersects with ear E i . i.e. B [ i ] = B ∩ E i . Lemma 28.
If the complex is made up of a single connected component, thenthe frame based algorithm gives us c = 1 . The case when the complex is made up of several connected components can easily bedealt with by applying the algorithm independently to each of the components. In thatcase c = C where C is the number of connected components roof. From Lemma 26, we know that the frame of expansion consists of asingle connected component that connects all 0-cells in the manifold. Thisframe is divided into N several ears say E i . Every ear is a 1-dimensionalmanifold. Suppose that we have an open ear then we have 1-dimensionalcoboundary face in such a ear which we pair with a 0-dimensional boundaryface. Subsequently, we follow a path which matches the incident unpaired0-cell to a neighboring 1-cell and we keep doing this until all 1-cells of the earare exhausted. Now suppose that we have a closed ear. Then we remove oneof the 1-cells from the ear (i.e. make it critical). This disconnects the earinto two connected components. We treat these two components of the earsas separate and proceed as in case of open ears. We now make an inductiveargument to prove that the first ear leaves a critical 0-cell. Subsequentaddition of ears do not add any criticalities. To see this consider the basecase in which we design the flow for the first ear. Here, the flow stops whenall 1-cells are exhausted. In this case, for the final 1-cell µ , there is one 0-cellwhich gets paired with µ and another incident 0-cells which remains unpaired.It is this 0-cell that becomes the sole critical 0-cell. For induction considerthe inductive hypothesis that k-ears have been attached and the number ofcritical cells remains 1. Now suppose that the (k+1)th ear is attached. Ifthe (k+1)th ear is open then the flow stops with a 1-cell on which one ofthe incident 0-cells v i belongs to a ear E i where i < ( k + 1) . Either v i isthe sole critical 0-cell or it is paired to another 1-cell belonging to E i (byinductive hypothesis). Now, suppose that the (k+1)th ear is closed. Thenhaving detached a 1-cell (which is made critical), we have two disconnectedcomponents. For each of the connected components, the flow emanating fromsubsequent pairing of 0-cells to 1-cells stops when a 1-cell is incident on a0-cell v j belonging to a ear E j where j < ( k + 1) . Once again by inductivehypothesis either v j is the sole critical 0-cell or it is paired to another 1-cellbelonging to E j . From this we conclude that c = 1 on attachment of allears. Theorem 29.
For the frame-based vector field design algorithm, each Morsenumber equals the Betti number. i.e. c i = β i Proof.
From Lemma 27 and Lemma 28, we have c = β and c = β respectively. Now, using Equation 2 in Theorem 8, we have c = β . Thuswe have c i = β i for all i . 18 .4 Discussion on Complexity Finding coboundary of M can be found in linear time by going through all2-cells in M . Finding coboundary of ears of M can be found in constanttime by mainting a proper data structure. The ear decomposition of residualcomplex M (which has the structure of a graph) itself takes linear time.Adding a gradient pair to a vector field takes constant time. The queueing,dequeueing and deletion operations also can be done in constant time bymaintaining appropriate data structures.The only nontrivial procedure in the algorithm is frameflow (). Now the frameflow () procedure can be construed as breadth first traversal on a semi-graph. We apply this procedure once on M and once on each of the earsof M . When traversals from all ears are counted, we observe that everyedge of M is encountered only once and every vertex v i is encountered D ( v i ) number of times where D ( · ) indicates degree of a vertex. So, if we sum overall vertices and edges, the total complexity of frameflow () when applied over M is linear in the number of edges of M . Hence, we see that the designof optimal discrete gradient vector field using expansion frames takes lineartime. In this section, we establish the surprising potency of critical cell cancellationsin case of 2-manifolds by using frames.
Definition 30 (Pseudo-optimal Vector Field) . We define a DGVF to bepseudo-optimal if the optimal DGVF can be obtained from it merely viacritical cell cancellations.
Definition 31 (Stable, Unstable Manifolds) . The stable manifold of a criticalcell α q are all the non-critical cells of dimension q and q + 1 with gradientpaths ending at α q . The unstable manifold of a critical cell α q are all thenon-critical cells of dimension q and q − with gradient paths starting at α q and ending at that particular non-critical cell. lgorithm 3 Optimal DGVF Redesign Using Critical Cell Cancellations procedure kingRev ( K q , M , C , V , q ) repeat Suppose critical cells σ q and K q have gradient paths to/from saddle γ . Subroutine sharedSaddle() finds such a pair { γ, σ } for given K . If γ (cid:54) = NIL, then cancel critical pair ( γ, σ ) until ( γ (cid:54) = NIL ) If q = 2 AND K q has a unique path to φ , then cancel critical pair ( φ, K ) end procedure procedure fixBdry ( d, p, M , C p , B d ) for ≤ i ≤ |B d | do Let B i := B d [ i ] and let b ij be a boundary face of B i . if (cid:104) b ij , B i (cid:105) / ∈ V AND b ij is critical then Let (cid:104) θ i , B i (cid:105) be a gradient pair if θ i (cid:54) = NIL and θ i is not a boundary face of B i then Find a gradient path from some critical cell α d to θ i and reverse it. end if Add gradient pair (cid:104) b ij , B i (cid:105) to vector field V end if end for end procedure procedure findKing ( d, p, M , C p , b q , i ) if ( p = 2 AND C p (cid:54) = NIL ) OR ( p = 1 AND i = 1) then remFrom ( C p , K ) ; else if p = 1 then K := b q [1] ; remFrom ( b q , K ) ; else K := NIL; end if K := selectRandomly ( C p ) ; return K ; end procedure procedure processComplex ( M , i, d, p ) C [1 : d ] ← identifyCritical ( M , V ) findBdry () finds B d & b d − the cobdry. and bdry. of M resp. fixBdry ( d, p, M , C d , B d ) while ( K = findKing ( d, p, M , C p , b d − , i ) (cid:54) = NIL do kingRev ( K , M , C , V , p ) end while end procedure procedure kingFlow ( M , d, V ) Divide M into manifolds M , M , . . . , M K s.t. M i ∩ M j is 0-dimensional. for ≤ i ≤ K do processComplex ( M i , i, , end for E [1 : numEars ] := earDecompose ( M ) for ≤ i ≤ numEars do processComplex ( E [ i ] , i, , end for end procedure ote 4.1. Given a connected pseudomanifold complex M , divide M into several connected components M , M , . . . , M K s.t. M i ∩ M j is0-dimensional. i.e. any of the two manifolds (with boundary) M i , M j may intersect only along points (but not along edges). If M is a manifoldwithout boundary then M will have only one connected component. M i are essentially the connected components of the semigraph G s ( M ) definedin Note 3.3 . Lemma 32. If M is a manifold without boundary then after invoking theprocedure kingRev() , we obtain a connected expansion frame. Moreover, c = β = 1 .Proof. Suppose a vector field V on manifold M (without boundary) has asingle critical cell. Then from Lemma 26, we get a single connected expansionframe connecting all vertices of M . Instead, if M is a manifold withoutboundary and if we have more than one critical 1-cells, then consider theunstable manifold of some chosen critical cell K . Since the unstable manifoldof K doesnot include the entire manifold M , the stable manifold has a 1-dimensional manifold as its boundary. From [12], we know that, if M is ann-dimensional manifold with boundary, then the boundary of M is an (n-1)-dimensional manifold (without boundary) when endowed with the subspacetopology. Therefore, the boundary of the unstable manifold is a 1-dimensionalmanifold without boundary (i.e. it consists of one or more disjoint circles).Clearly the 1-cells belonging to this boundary are not part of the 2-flow of V , else they wouldn’t be part of the boundary of the unstable manifold of K .So, the 1-cells belonging to this boundary are either part of the 1-flow of V or they are critical. Consider one of the disjoint circles that forms part ofthe boundary of the unstable manifold. If all the cells on this circle are partof the 1-flow then it will form a cycle. Hence there exists at least one critical1-cell on the boundary of the unstable manifold. Let γ be a critical that lieson the boundary of the unstable manifold of K . Clearly, there exists only onegradient path from K to γ . γ is also incident on a 2-cell say σ that doesnot lie in the unstable manifold of K . Suppose σ is itself a critical 2-cell,then γ lies on the boundary of unstable manifolds of the two critical 2-cells K and σ . Otherwise suppose that σ is matched. Because the simplicialcomplex M is a manifold, it is possible to trace any inverted gradient pathon M (such a unique inverse gradient path exists). Therefore, we trace theinverted gradient path γ, σ , . . . until we reach a critical 2-cell (say σ k ) fromwhich this path emanates. In any case, we can find a critical 1-cell γ whichis shared by critical cells K and some other critical 2-cell say σ . In this case,21ecause gradient path from σ to γ is unique we can invert this gradient pathas shown in Line Definition 6 of Procedure kingRev() of Algorithm 3. Oncethis cancellation is done, the unstable manifold of σ becomes part of thenew unstable manifold of K . Once again we search a critical 1-cell γ on theboundary of the unstable manifold s.t. which also lies on the boundary ofunstable manifold of some other critical 2-cell (distinct from K ). If such apair of critical cells is found then we cancel it and this procedure is repeateduntil all critical 2-cells belong to the unstable manifold of K (or alternativelyall critical 1-cells have two gradient paths from K .) Basically this meansthat M is a manifold without boundary that has a unique critical 2-cell. i.e. c = 1 . Since, M is a 2-manifold without boundary, β = 1 . Finally, fromCase 1 of Lemma 27, we arrive at the conclusion that the expansion frame isa connected 1-manifold that includes all 0-cells of M .If M is a manifold without boundary then G s ( M ) has a single connectedcomponent and the for loop described in Lines 38-38 of Procedure kingFlow() in Algorithm 3 gets executed only once. Also the while loop described inLines 32-34 of Procedure processComplex() in Algorithm 3 gets executedonly once for manifolds without boundary. This is because for any critical2-cell K , you always find another critical 2-cell σ s.t. both K and σ have agradient path to a common 1-cell γ unless the unstable manifold of K coversthe entire manifold M .The situation is however much different for a manifold with boundary. Forsuch a manifold the for loop and the while loop may run several iterations. Lemma 33. If M is a manifold with boundary then after invoking theprocedure kingRev() , we obtain a connected expansion frame. Moreover, c = β = 0 .Proof. We will examine the effect of the algorithm on one of the connectedcomponents M i of G s ( M ) . Consider the unstable manifold of a critical2-cell K . From [12], we know that, if M is an n-dimensional manifold withboundary, then the boundary of M is an (n-1)-dimensional manifold (withoutboundary) when endowed with the subspace topology. Hence, the boundaryof this unstable manifold will be a 1-manifold without boundary (i.e. adisjoint set of circles). The 1-cells on any one of these circle are involved onlyin 1-flows or they are critical. But all, cells of a circle can not be involved in1-flow as this would lead to a cycle in the vector field. So, every circle mustcontain a 1-cell, say γ that is critical. K has only one gradient path to γ .There exists a second gradient path that ends at γ . This gradient path eitheremanates from another critical 2-cell say σ or it emanates from a boundary22ace. Assume the case where a path to γ emanates from σ . In this case, thepair ( γ, σ ) is detected and cancelled in Lines 3-6 of Procedure kingRev() in Algorithm 3. In fact, every such pair ( γ, σ ) for a given K is detected andcancelled in the loop Lines 3-6 of Procedure kingRev() in Algorithm 3. Sofinally every critical 1-cell say φ in the boundary of the unstable manifoldof K will have a second path emanating from a boundary face. In this case,the pair of critical cells ( φ, K ) is detected and cancelled as shown in Line7 of Procedure kingRev() in Algorithm 3. Suppose that M i continues tohave critical cells that are not cancelled, then a new critical king cell K isselected and the same procedure as described above is repeated in a loopshown in Lines 32-34 of Procedure processComplex in Algorithm 3. Weexit from the loop provided there are no other critical 2-cells to process in thelist C p . In case of manifolds with boundary every critical 2-cell processed as aking cell K is itself cancelled along with cancelling all the neighboring critical2-cells that share gradient paths to the same saddles as K . Having processed M i in this manner, we are assured that eventually M i has no critical 2-cells.In fact every 2-flow for M i emanates strictly from boundary faces. Using anargument similar to that in Case 2 of Lemma 27, we know that the frameof expansion of a boundary face is a connected set. Consider the first suchboundary face b , with a frame of expansion which is a connected 1-manifold.Every 1-cell belonging to the frame of expansion of b has a second gradientpath emanating from other boundary cells { b i } . Since the M i is a manifoldwith boundary, given any pair of boundary faces b i , b j , we can find a type 2connected 2-path between them. Consider all the 1-cells in some such type2-connected path between b i and b j . Every 1-cell either lies in the frameof expansion of two boundary faces or is involved in 2-flow with a regular2-cell. This gives us a sequence of frames of expansion of boundary faces b k , b k , . . . , b k L that are sequentially pairwise connected and s.t. b k = b i and b k L = b j . Since this procedure can be applied to any two boundary faces(with expansion frames), we conclude that the set of frames of expansion of allboundary faces is a connected set, which we refer to as the expansion frameof M i . To see that the frame of expansions of all M i form a single connectedset, we consider the component hypergraph H c ( M ) . We then use the sameline of reasoning as used in Lemma 26, to conclude that the expansion frameof M is connected. Also, following all critical cell cancellations since thereare no more critical 2-cells for M i , we have c = β = 0 for each M i . So, wehave also have c = β = 0 for M ote 4.2. The residual 1-complex M is essentially the expansion frameof M following cancellation of critical cell pairs of dimensions , . Sincethere exists a preordained 1-flow (without cycles) on M , clearly given themechanism of discrete Morse theory, there must exist at least one critical0-cell. (A sub-optimal 1-flow may have more than one critical 0-cells. Butat least one is guaranteed.) The first ear is chose to be one that includesat least one of these critical 0-cells. Also the ear decomposition follows aspecial procedure. The number of ears are determined by the number ofunstable manifolds of boundary 0-cells and critical 1-cells. The first ear iseither an unstable manifold of a boundary 0-cell or a critical 1-cell thatincludes at least one critical 0-cell. The second ear is a 1-manifold that isincident on a 0-cell that belongs to the st ear and includes all the 0-cellsand 1-cells of an unstable manifold of a boundary 0-cell or a critical 1-cellthat aren’t already included in the first ear. The k th ear is a 1-manifoldthat is incident on a 0-cell that belongs to one of the previous ( k − earsand includes all 0-cells and 1-cells of an unstable manifold of a boundary0-cell or a critical 1-cell that aren’t already included as part of the previous ( k − ears. Every ear (apart from the first ear), has at least one 0-cellin its 0-dim. boundary whereas every ear may have at most two 0-cell inits 0-dim. boundary. The first boundary cell of the ear b [1] is incident onone of the previous ears. The second boundary cell b [2] may or may notbe incident on any of the previous ears. Lemma 34.
On applying a series of critical cell cancellations, the connectedexpansion frame has c = β = 0 Proof.
We shall make an inductive argument. The idea is that the first earwill have a 0-cell that is critical. Subsequent ears attached to the first earhave no 0-dimensional critical cells. Note that all ears are 1-dimensionalmanifolds (topological circles or topological line segments)
Base Case:
Suppose that we start with the first ear. Suppose that the firstear is a closed loop (i.e. a topological circle). From
Note 4.2 our first earhas at least one critical 0-cell. Suppose we call it (cid:37) . In this case (cid:37) becomesour king critical cell K . If there exist two gradient paths to (cid:37) from a saddle,then clearly we do not have any criterion for cancellation. Instead if we havea single gradient path from the saddle γ and suppose there exists anothergradient path from the γ to some other minima ϕ then from Lines 3-6 ofProcedure kingRev() in Algorithm 3, we cancel critical pair ( ϕ, γ ) and as aresult have a single critical 0-cell in the first ear. The last possibility the firstear consists of the unstable manifold of a critical 0-cell ς that (cid:37) nduction step: By the inductive hypothesis, we have processed ( k − ears so far and for all the ( k − ears taken together, we have only one critical0-cell (namely the one that was encountered in the very first ear.) Now, weneed to establish that on attachment of the k th ear we do not introduce anynew critical 0-cells. Note that for k th ear we start with b [1] as the kingcell K , where b [1] is incident on one of the previous ears (i.e. it may eitherbe our original critical cell (cid:37) , or it may be some regular 0-cell from oneof the earlier ( k − ears. Like all other ears, the k th ear is an unstablemanifold of a boundary 0-cell or a critical 1-cell. If it is the unstable manifoldof a boundary 0-cell ς then we do not have anything to prove as the flowfor this cell will simply start with ς and end at b [1] without introducingany criticalities. If the k th ear is topologically a loop, then b [1] has twogradient paths from some saddle γ and hence the criterion for cancellation isnot satisfied. Yet another case is when b [1] and b [2] are both incident onone of the earlier k ears. In this case, b [1] is either (cid:37) or a regular 0-cell and b [2] is certainly a regular cell. Also, there does not exist any other critical0-cell in this ear because the k th ear, in this case, is an unstable manifoldof a saddle. The only interesting case is when k th ear is topologically a linesegment s.t. b [2] is critical and the saddle γ has one gradient paths each to b [1] and b [2] . Since, for k th ear we start with b [1] as king cell K , we end upcancelling γ and b [2] , making the k th ear an unstable manifold of boundarycell b [2] . In each of the cases, we ensure that either the k th ear did not haveany critical 0-cell to begin with or if there does exist a critical 0-cell, then itis cancelled. Hence proved. Theorem 35.
Every discrete gradient vector field on a 2-manifold is pseudo-optimal.Proof.
Suppose that at the end of the first call to Procedure findKing() from Line 32 of Procedure processComplex() in Algorithm 3, K is not NIL . Then, we claim that the unstable manifold of K does not have anycritical 1-cells that are boundary faces. This is because, if K did have anyboundary critical 1-cells in its unstable manifold, it would have got cancelledin the loop shown in Lines 10-19 in Procedure fixBdry() in Algorithm 3. Infact, more generally every critical 2-cell at the end of first call to Procedure findKing() will have no critical boundary 1-cells in their respective unstablemanifolds. If M is a manifold without boundary, then by Lemma 32, wehave c = β = 1 and we get a connected frame of expansion in form ofresidual complex M . Instead, if M is a manifold with boundary, then fromLemma 33 we obtain c = β = 0 and a connected frame of expansion in formof residual complex M . Given a connected frame of expansion M , guarantees25hat we have c = β = 1 . Finally, using Weak Morse Inequlity we obtain c = β . Hence, we prove that for a 2-manifold, given an arbitrary vectorfield V merely by using critical cell cancellations, we may obtain the optimalvector field V . In other words, every gradient vector field on a 2-manifold ispseudo-optimal. H ( M , A ) We compute homology using Algorithm 1. Also we assume Weak MorseOptimality Condition as defined in Definition 11 on the input.As we can see from arguments in section 3, the topological explanationfor simplicity of computation of homology groups for 2-manifolds is:1. On 2-manifolds optimal Morse functions are perfect. In fact, 2-manifoldsadmit readily computable perfect Morse functions.2. A 2-manifold has optimal c = 0 or c = 1 , which can be figured out inlinear time by examining whether or not it has a boundary.3. We define and apply frames of expansion an elementary homotopytheory construct to design our algorithm.4. It can be seen that irrespective of what traversal method we use totraverse the graph like connectivity structure of 1-cells and 2-cells of a2-manifold, the frame of expansion remains connected. Furthermore,this connectivity guarantees that optimal c = 1 .5. Finally weak Morse Inequality guarantees that our c is optimal. i.e. c = β .6. Moreover, our dynamic programming based boundary operator compu-tation algorithm is pseudo-linear time (which becomes strictly linearassuming WMOC).7. Finally, assuming WMOC, the application of Smith Normal Form (asupercubical time algorithm) on input of constant size is inexpensive.8. The pseudo-optimality of arbitrary discrete Morse functions as out-lined in section 4 further strengthens our argument about simplicity ofcomputing optimal discrete Morse functions. In this work, we provide a nearly linear time algorithm for computing ho-mology (with arbitrary coefficients) on 2-manifolds - the first such algorithm.This is particularly useful to compute homology of 2-manifolds that may26ave torsion elements. The design involves the introduction and usage ofan elementary simple homotopy construct that we call expansion frames.
Having designed the optimal Morse function in linear time, we use a dynamicprogramming based pseudo-linear time boundary operator algorithm for com-puting the Morse boundary operator. Assuming the sum of Betti numbersis a small constant compared to the size of the complex, the Smith NormalForm is applied to a very smal input, giving us near-linearity. Finally, usingthe notion of expansion frames, we prove an unexpected result in discreteMorse theory: Start with an arbitrary DGVF on a 2-manifold and one mayobtain an optimal DGVF merely by application of critical cell cancellations.
References [1]
Ayala, R., Fernández-Ternero, D., and Vilches, J. A.
A graph-theoretical approach to cancelling critical elements.
Elec. Notes in Dis.Math. 37 , 285-290 (2011).[2]
Ayala, R., Fernández-Ternero, D., and Vilches, J. A.
Perfectdiscrete morse functions on 2-complexes.
Pattern Recognition Letters33(11) (2012).[3]
Bauer, U., Lange, C., and Wardetzky, M.
Optimal topologicalsimplification of discrete functions on surfaces.
Discrete & ComputationalGeometry 47 , 2 (2012), 347–377.[4]
Benedetti, B., and Lutz, F. H.
Random discrete morse theory anda new library of triangulations.
CoRR abs/1303.6422 (2013).[5]
Burton, B. A., Lewiner, T., Paixão, J., and Spreer, J.
Pa-rameterized complexity of discrete morse theory.
CoRR abs/1303.7037 (2013).[6]
Forman, R.
Morse theory for cell complexes.
Advances in Mathematics134 , 1 (Mar. 1998), 90–145.[7]
Forman, R.
A user’s guide to discrete Morse theory.
SéminaireLotharingien de Combinatoire B48c (2002), 1–35.[8]
Harker, S., Mischaikow, K., Mrozek, M., Nanda, V., Wagner,H., Juda, M., and Dlotko, P.
The efficiency of a homology algorithmbased on discrete morse theory and coreductions. In
Proc. of 3rd Intl.Workshop on CTIC (2010), vol. 1(1).279]
Hersh, P.
On optimizing discrete Morse functions.
Advances in AppliedMathematics 35 , 3 (Sept. 2005), 294–322.[10]
Joswig, M., and Pfetsch, M.
Computing optimal discrete morsefunctions.
SIAM J. Discrete Math. 20 , 1 (2004), 11–25.[11]
Juda, M., and Mrozek, M.
Z2-homology of weak 2-pseudomanifoldsmay be computed in o(nlogn) time. preprint (2009).[12]
Lee, J. M.
Introduction to topological manifolds : with 138 illustrations .Graduate texts in mathematics. Springer, New York, Berlin, Heidelberg,2000.[13]
Lewiner, T.
Constructing discrete morse functions. Master’s thesis,Department of Mathematics, PUC-Rio, july 2002.[14]
Lewiner, T., Lopes, H., and Tavares, G.
Optimal discrete morsefunctions for 2-manifolds.
Comput. Geom. 26 , 3 (2003), 221–233.[15]
Lewiner, T., Lopes, H., and Tavares, G.
Toward optimality indiscrete morse theory.
Experimental Mathematics 12 , 3 (2003), 271–285.[16]
Matsumoto, Y.
An Introduction to Morse theory . AMS, Providence,2002.[17]
Milnor, J.
Morse Theory , 1st edition ed. Princeton University Press,May 1963.[18]
Rathore, A.
Min morse: Approximability & applications.
CoRRabs/1503.03170 (2015).
Appendix7 Elementary Algebraic Topology
Definition 36 (Simplicial Complex) . A simplicial complex K is a set ofvertices and a collection L of subsets of vertices called faces. All facessatisfy the following property: The subset of a face is also a face. (i.e. B ∈ L , A ∈ B = ⇒ A ∈ L ). Maximal faces w.r.t. inclusion are known as facets . The dimension of a face B is defined to be |B| − . The dimensionof the simplicial complex itself is the maximum over the dimension of itsfaces. efinition 37 (Open Cell) . An n-dimensional open cell is a topological spacethat is homeomorphic to an open ball.
Definition 38 (Cell Complex) . A hausdorff topological space X is called afinite cell complex if1. X is a disjoint union of open cells { D ni } where D ni is an open n -cell.( i ∈ I where I is the indexing set.)2. For each open cell D ni there is a map φ ni : B n → X such that φ ni restricted to the interior of the closed ball B n defines a homeomorphismto D ni and such that φ ni ( S n − ) is contained in the ( n − -skeleton of X . (The k -skeleton of X is the union of all open cells D i of dimension r ≤ k ).3. Finally, a set α is closed in X if and only if α ∩ D j is closed in D jn for each cell D nj . Note that D jn = φ ni ( B n ) .A cell complex is said to be regular if each φ ni is a homeomorphism and if itsends S n − to a union of cells in the ( n − -skeleton of X . In lay man terms, to construct a cell complex you start with points D i ,then glue on lines D i to D i , then glue discs D i to D i and D i and so on.Therefore a cell complex is a topological space constructed from a union ofobjects called cells, which are balls of some dimension, glued together onboundaries. Cell complexes are the most convenient object to do AlgebraicTopology. But to simplify the discussion, we will instead provide a basicpresentation of simplicial homology. Notation 39.
Boundary & Coboundary of a simplex σ : We define theboundary bd ( σ ) and respectively coboundary ð σ of a simplex as ð σ = { τ | τ ≺ σ } δ σ = { ρ | σ ≺ ρ } Homology groups are the most important and general topological in-variants of simplicial and cubical complexes, that are also computationallyfeasible. At the heart of it, Algebraic Topology is essentially the use ofLinear Algebra to compute combinatorial topological invariants of a givespace. Given a simplicial complex W , can define simplicial q -chains, whichare formal sums of q -simplices (cid:80) s ∈ S a i s i where the a i are integer coefficients.The abelian group of sums of k -simplices under addition is called the ChainGroup and denoted by C q ( W, Z ) . The n -simplex (cid:52) = { v , v , · · · , v n } withstandard orientation is denoted + [ v , v , · · · , v n ] . Consider the permutationgroup of n -letters on the vertices of (cid:52) . The set of permutations fall into 2equivalence classes: even permutations and odd permutations. The set ofeven permutations induce the positive orientation + [ v , v , · · · , v n ] whereasthe set of odd permutations induce the negative orientation − [ v , v , · · · , v n ] .30 v v v v + v − ∂ −→ [ v , v ] + [ v , v ] + [ v , v ] ∂ −→ [ v ] − [ v ] Figure 3: Dim 1 Boundary Operator v v v v v v v v [ v , v , v ] − [ v , v , v ] ∂ −→ [ v , v ] + [ v , v ] + [ v , v ] − [ v , v ] ∂ −→ Figure 4: Dim II Boundary OperatorFor each integer q , C q ( W ) is the free abelian group generated by the setof oriented q -simplices of W . Let W q be the total number of q − dimensionalsimplices for simplicial complex W . Then, one can show that C q ∼ = Z W q .The boundary map ∂ q is defined to be the linear transformations ∂ q : C q → C q − .Examples of such operations are given in Fig.E3 and
Fig.E4.
This map gives rise to a chain complex: a sequence of vector spaces andlinear transformations: → C n ∂ n → C n − ∂ n − −→ ... ∂ q +2 −→ C q +1 ( W ) ∂ q +1 −→ C q ( W ) ∂ q −→ ... ∂ → C ( W ) ∂ → C ( W ) → . It can easily be proved that that for any integer q , ∂ q ◦ ∂ q +1 = 0 . In general, a chain complex C (cid:63) = { C q , d } is precisely this : a sequence ofabelian groups ( C q ) connected by an operator d q : C q → C q − that satisfies d ◦ d = 0 . 31 v v [ v , v , v ] ∂ −→ v v v [ v , v ] + [ v , v ]+[ v , v ] ∂ −→ v v v v − v + v − v + v − v = 0 Figure 5: ∂∂ = 0 gives us a chain complex.If one defines Z q = ker ∂ q and B q = im ∂ q +1 , then it follows that B q ⊂ Z q . Elements of Z q = ker ∂ q are called cycles, andelements of B q = im ∂ q +1 are called boundaries. Likewise, Z q = ker ∂ q iscalled the q − th Cycle Group and B q = im ∂ q +1 is called the q − th BoundaryGroup. Then the homology group H q measures the equivalence class of cyclesby quotient-ing out the boundaries i.e. this construction measures how farthe sequence is from being exact.The q -dimensional homology of W , denoted H q ( W ) is the quotient vectorspace, H q ( W ) = Z q ( W ) B q ( W ) · and the q -th Betti number of W is its dimension: β q = dim H q = dim Z q − dim B q Let F be a Discrete Morse function defined on simplicial complex W . Let C q ( W, Z ) denote the space of q -simplicial chains, and M q which is a subsetof C q ( W, Z ) denote the span of the critical q -simplices. Let M (cid:63) denote thespace of Morse chains. Let c q denote the number of critical q -simplices. Thenwe have, M q ∼ = Z c q . 32 heorem 40 (Forman [6]) . There exist boundary maps (cid:98) ∂ q : M q → M q − ,for each q , which satisfy (cid:98) ∂ q ◦ (cid:98) ∂ q +1 = 0 . and such that the resulting differential complex −→ M n (cid:98) ∂ n −→ M n − (cid:98) ∂ n − −→ · · · (cid:98) ∂ q +2 −→ M q +1 (cid:98) ∂ q +1 −→ M q (cid:98) ∂ q −→ · · · (cid:98) ∂ −→ M (cid:98) ∂ −→ M −→ calculates the homology of W . i.e. if we go with the natural definition, H q ( M , (cid:98) ∂ ) = ker (cid:98) ∂ q im (cid:98) ∂ q +1 Then for each q , we have H q ( M , (cid:98) ∂ ) = H q ( W, Z ) . Theorem 41 (Boundary Operator Computation. Forman [6]) . Consider anoriented simplicial complex. Then for any critical (p+1)-simplex β set: ∂β = (cid:80) critical α ( p ) P αβ αP αβ = (cid:80) γ ∈ Γ ( β,α ) N ( γ ) where Γ ( β, α ) is the set of discrete gradient paths which go from a facein ð β to α . The multiplicity N ( γ ) of any gradient path γ is equal to ± depending on whether given γ the orientation on β induces the chosen orien-tation on α or the opposite orientation. With the boundary operator above,the complex computes the homology of complex K. Theorem 42 (Forman [6]) . If a < b , are real numbers, such that [a,b]contains no critical values of Morse function { , then the sublevel set M ( b ) ishomotopy equivalent to the sublevel set M ( a ) . Theorem 43 (Forman[6]) . Suppose σ p is a critical cell of index p with f ( σ ) ∈ [ a, b ] and f − ( a, b ) contains no other critical points. Then M ( b ) ishomotopy equivalent to M ( a ) (cid:91) e pb e p where e p denotes a p-dimensional cell with boundary e pb . In Thm.43, Forman’s establishes the existence of a cell complex (letus call it the
Morse Smale Complex ) that is homotopy equivalent to the33igure 6: Frame Expansion: Example 1. Part I.original complex. For proof details please refer to Forman[6]. The boundaryoperator in Thm.41 for the chain complex construction (referred to as the
Morse complex ) tells us how to use the new CW complex that is built inconstruction described in proof of Thm.43. Note that the Morse complexitself is a chain complex and not a CW complex. But, the chain complexconstruction (referred to as the Morse complex) tells us that both theseconstructions have identical homology. lgorithm 4 Homology () procedure calcHomology ( M , A ;) V := mainFrame ( M ) ; (cid:52) c := calcbdryOp ( M , H , V ) ; H ( M , A ) := SmithNormalForm ( (cid:52) c , A ) ; end procedure procedure calcBdryOp ( M , H , V ) topologicalSort ( H , V , L , ’ASCENDING’); for ≤ i ≤ |L| ; σ := L [ i ] do if dim σ = 0 & σ · pair = NIL then (cid:52) σ = ∅ ; else if σ ≺ β & σ · pair = β then (cid:52) σ = < ∂β, σ > ×(cid:52) β ; else Let τ i ≺ σ be the set of regular cells incident on σ s.t. (cid:104) τ i , σ (cid:105) / ∈ V ; Let α i ≺ σ be the set of critical cells incident on σ ; (cid:52) σ = (cid:80) (cid:52) τ i × < ∂σ, τ i > + (cid:80) α i × < ∂σ, α i > ; end if if σ · pair = NIL & σ · revPair = NIL then (cid:52) c σ := (cid:52) σ ; end if end for end procedure lgorithm 5 Algorithm
FrameFlow () procedure findCoBdry ( M d , B d ) Go through list M d . If M d [ i ] has only one face, add M d [ i ] to B return B ; end procedure procedure addPairToVectorField ( τ, ϑ, V , M , B d , d ) if τ · revPair = NIL then delete ( τ, M d ); delete ( ϑ, M d − ) ; if τ ∈ B then delete ( τ, B ) ; end if nQ ( Q , τ ) ; ϑ · pair := τ ; τ · revPair := ϑ ; V := V + (cid:104) ϑ, τ (cid:105) end if end procedure procedure frameFlow ( M , d, V ) if ( (cid:36) = dQ ( B d )) = NIL then (cid:36) := dQ ( M d ) ; end if repeat fF := ’T’; repeat F := faces ( (cid:36) ) − (cid:36) · revPair; υ := bdry ( F ) ; if fF=’T’ & υ (cid:54) = NIL then addPairToVectorField ( (cid:36), υ, V , M , B d , d ); else delete ( (cid:36), M d ) ; end if fF := ’F’; for ≤ i ≤ |F | ; do ϑ := F [ i ] ; µ := cofaces ( ϑ ) − (cid:36) ; addPairToVectorField ( µ, ϑ, V , M , B d , d ); end for until ( (cid:36) = dQ ( Q )) (cid:54) = NIL until ( (cid:36) = dQ ( B d )) (cid:54) = NIL end procedure procedure mainFrame ( M , V ) B := findCoBdry ( M ); frameFlow ( M ,2, B , V ); (cid:8) M [1 : numEars ] , numEars (cid:9) := earDecompose ( M ); for ≤ i ≤ numEars do B [ i ] := findCoBdry ( M [ i ] ); frameFlow ( M [ i ] ,1, B [ i ] , V ); end for return V .; end procedureend procedure