• No results found

4.6 From a discrete gradient to the Morse complex:

4.6.3 Description in the cubical case

In this section, we focus on the case of X being a cubical complex embedded in a d-dimensional space to describe the algorithm BoundaryMaps. The algorithm is implemented for the experi- mental results in Section6.4. Our description adapts the presentation of the algorithm in [93] to the cubical case. For the input and the output of the algorithm, we take the notation of the previous section. The procedure and pseudocode of BoundaryMaps in the cubical case is the same as for the simplicial case and it is reported in Algorithm5. First, we make the representation of entities in the cubical case explicit. Then, we describe dissimilarities with respect to the simplicial case of the auxiliary functions called by BoundaryMaps. Afterwards, we describe the procedure of the algorithm. Finally, we provide some computational remarks on the cubical case.

A cubical complex embedded in a d-dimensional space is represented as a regular grid. A regular grid is defined by a graph G “ pN, Aq where N is the set of cells forming the regular grid and A is the set of incidence relations between the cells in N. Representing a regular grid is a much easier task than representing a simplicial complex. The regular distribution and connectivity of the cells in G makes it possible to encode the topology of the complex implicitly. By enumerating the cells in N, we can extract any relation in A using index calculations without any overhead. Facets and cofacets of a given cell are retrieved in linear time with respect to the number of facets or cofacets, respectively. The number of facets of a k-cell is at most 2k, and the number of cofacets is at most 2k.

In the case of a regular grid, the discrete gradient is encoded by assigning a Boolean value to each arc α in A, where the two cells connected by α are paired in V . Then, the discrete gradient is encoded as an array of bits of length |A|.

the following differences:

• getFacetspt, Xq is performed by index calculations in linear time in the number of facets of t;

• isPairedps,V q is performed by index calculation in linear time in the number of cofacets of s.

From the computational point of view, we focus on the dissimilarities with the simplicial case. A cell t0is popped out from Q up to 2k times equal to the number of facets of t rather than k, but this

provides a linear contribution in the same way. For each facet s1of t0we check whether it is paired

or not which takes at most time Opkq instead of depending on the number of top-simplices incident in a vertex. Then, we can conclude that each iteration of the while loop takes Opk2q. Hence, the algorithm has Opq ¨ k2q worst-case time complexity, where q is the number (counted with multiplicity) of k-cells of X inserted in the queue Q. Again, in practical cases, time complexity is dominated by the factor q. Differently from the simplicial case, parameter k can be considered constant. Degenerate case with Opqq “ Op|Xk|q exist also in the cubical case and parameter q

dominates the final time cost. In Section6.4.3, we see the measured timings for BoundaryMaps applied to some entire Morse sets of regular grids of large size and notice the advantage of the cubical case over the simplicial one.

5

Optimality by relative homology

As exposed in Section1.4, a notion of optimality is commonly associated with a complex through a discrete Morse function defined on it. Intuitively, in this case, optimality means that each critical cell corresponds to a change in topology when moving from one filtration step, induced by sublevel sets with respect to the Morse function, to the other. In this chapter, we deal with a notion of optimality that applies to a complex already equipped with a filtration. In doing this, we express optimality as a property of a discrete gradient compatible with a filtered complex instead of a discrete Morse function.

The chapter is structured as follows. First, we discuss the case of one-parameter filtered complexes. In particular, we formalize, into more general terms, the optimality notion expressed in [162] for the specific case of regular grids under a scalar-valued filtering function. Under this formalization of optimality, the algorithm proposed in [162], and generalized by our algorithm described in Chapter4, retrieves an optimal discrete gradient, for cubical complexes realized in a 3D space, an so, the algorithm itself is called optimal. We discuss why this one-parameter notion of optimality for a discrete gradient does not generalize to the multiparameter case. As a first contribution, we translate the one-parameter notion of optimal discrete gradient equivalently in terms of relative homology. Afterwards, we move to the multiparameter case and provide our second contribution about optimality. This consists in generalizing the optimality definition via relative homology to the multiparameter case. Successively, as a third contribution, we prove that a Morse complex compatible with a multiparameter filtered complex induced by sublevel sets of a filtering function preserves the relative homologies involved in the optimality definition. This fact is used in the final part to guarantee that the one-parameter optimality of the algorithm in [162] holding for 3D cubical complexes is preserved in the multiparameter case by our algorithm described in Chapter4. Finally, we show an additional case where optimality of the algorithm described in Chapter4holds, that is for abstract 2-dimensional simplicial complexes.

All along this chapter, we assume to be given a Lefschetz complex with intersection property X , a filtration X of X (either one or multiparameter), a discrete gradient V compatible with X , its Morse set M “ MpV q, and the corresponding filtered Morse complex M.