Generating minimal boundary maps

In this paper we examine the descriptive potential of a combinatorial data structure known as"Generating Set"in constructing the boundary maps of a simplicial complex. By refining the approach of \cite{Dumas} in generating these maps, we provide algorithms that allow for relations among simplices to be easily accounted for. In this way we explicitly generate faces of a complex only once, even if a face is shared among multiple simplices. The result is a useful interface for constructing complexes with many relations and for extending our algorithms to $\Delta$-complexes. Once we efficiently retrieve the representatives of"living"simplices i.e., of those that have not been related away, the construction of the boundary maps scales well with the number of relations and provides a simpler alternative to JPlex. We finish by noting that the generating data of a complex is equivalent in information to its incidence matrix and we provide efficient algorithms for converting from an incidence matrix to a Generating Set.


Abstract
In this paper we examine the descriptive potential of a combinatorial data structure known as Generating Set in constructing the boundary maps of a simplicial complex. By refining the approach of [1] in generating these maps, we provide algorithms that allow for relations among simplices to be easily accounted for. In this way we explicitly generate faces of a complex only once, even if a face is shared among multiple simplices. The result is a useful interface for constructing complexes with many relations and for extending our algorithms to ∆complexes. Once we efficiently retrieve the representatives of "living" simplices i.e., of those that have not been related away, the construction of the boundary maps scales well with the number of relations and provides a simpler alternative to JPlex. We finish by noting that the generating data of a complex is equivalent in information to its incidence matrix and we provide efficient algorithms for converting from an incidence matrix to a Generating Set.
Keywords: topological data analysis; boundary maps; incidence matrix; simplicial complex

Introduction
We use [4] as a background reference. Let X = N k=0 X k be a simplicial complex where X k is the set of k-dimensional simplices and N is the maximum dimension of a simplex in X. If we denote by C k the free Abelian group generated by the set X k , the boundary map δ k : C k → C k−1 is the linear map defined on a k-simplex α = {v 0 , v 1 , . . . v k } by the linear combination δ k (α) = k i=0 (−1) i α i where 1 ≤ k ≤ N and α i = α − {v i }. For k > N , we define δ k to be the zero map. We encode this mapping into a matrix M k by letting each column represent a k-simplex α in X k and each row a (k − 1)-simplex α i in X k−1 such that the column entry for (α i , α) is the coefficient (−1) i of the linear combination δ k (α) above and zero otherwise. It is easy to show that δ k−1 (δ k (α)) = 0 for all k-simplices α, i.e. the element Constructing a matrix M k for each dimension k allows one to compute the homology groups of the chain complex C = {C k } N k=0 . The k-th homology group is defined as the following quotient: where ker(M k ) is the kernel of δ k , i.e. all k-chains α such that δ k (α) = 0, and im(M k+1 ) is the image of all (k + 1)-chains under δ k+1 . This quotient is valid because, as we remarked before, the boundary of a boundary is always zero, hence the boundary of any (k + 1)-simplex must itself have a trivial boundary under δ k , and therefore im(δ k+1 ) ⊆ ker(δ k ).
Once the boundary matrix M k is constructed, computing homology groups can be then done by the Gaussian row reduction. In particular, by taking the codimension of the image im(δ k+1 ) inside the kernel to retrieve the k-th Betti numbers of the complex, i.e. the number of kdimensional "holes" in C. As Carlsson points out in [5] in his seminal paper on topological data analysis (TDA), the Gaussian method is in general too inefficient to be used on large scale complexes. However, if one only desires the Betti numbers of C then alternatively one can use the Smith normal form of our boundary matrices which allows for the computation of all Betti numbers at once and is much more efficient. Algorithms for computing Betti numbers have been studied in depth by others, and in fact much that can be done in the field of topological data analysis relies on efficient computation of Betti numbers over filtered complexes as in [1,3]. Once we have the Betti numbers, another tool known as "barcodes" can be developed as a nice way of representing topological features at multiple time steps or distance thresholds; these are often referred to as "persistent" in our data, as they remain invariant over relatively large intervals of the parameter. See [7].
Here however we do not discuss such algorithms in detail, but instead we focus on the generation of the boundary matrix itself. In [1], some of the difficulties in generating a boundary matrix efficiently are discussed along with a process for trying to generate the boundary map while avoiding the repeat work of the naive algorithm that stems from many simplices sharing the same sub-complex. We first provide a recursive algorithm that can be used to generate any set of independent complexes without repeats. We then expand upon this algorithm to generate any complex with work proportional to that of generating complexes of independent simplices. To do this as generally as possible we introduce the concept of generating sets, which are a collection of data that describes our complex in a way that is completely combinatorial. One benefit of such a description is the relative ease of describing a type of cellular complex known as the ∆-complex. This is made possible by the construction of a relational map between simplices, which can be deduced from our combinatorial descriptors. We provide algorithms for constructing the relational map, and then in turn the boundary matrix by a method that does not require the explicit generation of any maximal simplex more than once. This gives an algorithmic complexity that improves with the number of relations we have, and also allows us to use a convenient high level description of our complex. We conclude by discussing algorithms for constructing a generating set from the incidence matrix of a complex.

Generating Set:
We define the Generating Set of a complex C to be a pair of sets G = (S, R). The set with d i < d j for i < j is a set of tuples where for each tuple (n i , d i ) there are n i maximal simplices of dimension d i in C. By maximal simplices we mean simplices that are not the face of another simplex in C. The set R = {r 1 , r 2 , . . . r m } is a set of relations among faces of maximal simplices where r i = (α 1 , . . . α p ) with all α j ∈ r i of the same dimension. Observe that the number of k-simplices generated by S can be calculated by the following function: We may also want to calculate j(S m , k) by the same formula but taken over the set S m of all pairs (n i , d i ) with d i ≤ m for a fixed m.
Generating Set can provide a nice interface for constructing certain complexes known as ∆-complexes. Take the complex of the torus as an example. One way to construct it inductively (as JPlex does) is by first adding all necessary vertices, then drawing edges between certain vertices, and finally filling up faces bounded by three edges. This method, while efficient computationally, is tedious, and also does not allow for much simplification of the complex. One valid generating set for the torus would be the following: As long as we have identified all the faces in R (all sub-simplices are also identified between related simplices), that is sufficient to construct the boundary maps of the ∆-complex of the torus.
To generate the maximal simplices to which we later glue faces to make our complex, we provide the following algorithm: The algorithm P (S) simply partitions out the vertices into tuples that form all the maximal simplices.

3.2.
From generating sets to boundary maps. Let an ordered set of matrices be given by D = {D 0 , D 1 , . . . , D N } where D i is the boundary map from the i-chains to the (i − 1)-chains in the complex C. We would like to construct D by using only our Generating Set in a way that is not wasteful. Henceforth, let G = (S, R) be the Generating Set for a complex C. Our goal is to generate a list of matrices D k representing the maps δ k . Doing this with no relations is straightforward and once we have this, in theory we can add in our relations by simply multiplying each boundary matrix D k by a permutation matrix M and removing rows and columns of non-representative simplices. Henceforth we may refer to this method as the naive approach to dealing with relations. Also, we may sometimes refer to the naive method of generating faces of a simplex by which we mean computing all boundaries for all faces. Observe, the initial cost of generating the boundaries of all simplices is wasteful given that we know that some (potentially many) of them will disappear after identifications. Besides generating dead simplices, generating the list of permutation matrices is also computationally expensive when done inductively. What we describe is instead a method of constructing boundary maps only for the simplices that are still "alive", while generating relational maps only for simplices that are "dead". We do this by exploiting the patterns predictable from our generation data.

3.3.
Constructing a relational map. The first step in our process is to pick a representative for each equivalence class constructed by our relation set, and to keep that representative valid through successive relations. We define the function Lor : C → C/R to be the map α →α whereα is the lexicographically lowest simplex to which α is related, i.e.α = min{β | α ≡ β}. This presents us with one method of constructing the equivalence classes with a valid representative, by simply iterating over all simplices, and placing them in their respective equivalence classes, finding the lowest, and constructing such a mapping. However, this is potentially wasteful in the sense that independent of the number of relations, we will have a runtime of 2 O(N ) . In theory this is not necessary as we have our relational data up front and should be able to construct a map only modifying those simplices that appear in our relation. Below we describe an inductive approach to doing so. To make use of our previous notation, we will also consider the maps Lor r which will assigned the lowest related simplex of α given that the last relation accounted for was r.
Theorem: 3.1. There exists an algorithm such that given a map Lor r , we can then construct in time n2 O(k) the map equivalent to Lor s for any other remaining relation s where k is the dimension of simplices in s and n is the number of simplices in s.

Proof.
Let H be a dictionary or lookup table which stores the mapping of Lor r . Define RLor(α) to be equal to Lor r (Lor r (α)). Let s = {α 1 , . . . , α n } be an unaccounted for relation in H. If all α i in s are not accounted for in H then we simply update H with all α i mapping to the minimum simplex in s. Now suppose that s and H are not disjoint. Here the process is similar in the sense that if the minimum of s is also in s ∩ H, call it β, then we simply add all the elements of s to H by mapping α i ∈ s to RLor(β). Suppose that the minimum of s is not in s ∩ H. Then for all simplices α in s ∩ H we map RLor(α) = a to β if β < a and vice versa otherwise. Given the recursive definition of RLor we know that anything which had a as its lowest order relation in H will now have the correct relation as well. RLor in tandem with H gives us Lor s . We then must also add all subrelations among α i ∈ s induced by s. We do this by decomposing all α i and matching their respective faces of a given dimension giving us new relations. We update all such relations in the same process, without decomposing further. This gives us a final runtime of n2 O(k) .
Observe that this is in fact an improvement from the naive approach as in the worst case scenario every simplex in C is in a relation which then requires iteration over all simplices and therefore does the same amount of work as the naive algorithm previously discussed. We now present an algorithm for constructing our list of boundary maps D for the complex C using our generating data. First, we construct a partition of a set of natural numbers from our generating data which will represent our linearly independent simplices without relations. This can be done by computing P (S) from above to give usS. In the following we also assume access to a function pos : C → N where pos(x) is equal to the relative order of x among simplices of the same dimension in C. The arguments of our algorithm are a simplex α ∈S, an index p used in recursion, and the matrix list D which we are updating for the whole complex of α. Proof. We claim that BCON(α, 0, D) iterated over all simplices α ∈S is such an algorithm. Observe that BCON, in its first step terminates if the simplex α has already been related away by an explicit relation. Hence, we know that any representative simplex inS will continue into the loop. Because we are using Lor(α * ) for all faces of α we know each face gets mapped properly to the representative of its equivalence class. Lastly, the recursive call using the Lor(α * ) guarantees the update all the sub-simplices of α using only the representatives of each equivalence class. Observe that the only way for any simplex to be related away entirely is by an explicit relation or a consequence of an explicit relation of higher order simplex. As we previously showed all simplices not related away explicitly will pass into the loop. Hence we know that BCON not only ignores all non-representative simplices, but also correctly computes boundaries for all representatives.
It is worth noting that part of what makes BCON efficient is that it does in fact improve upon the naive approach to boundary generation over a complex, although it may not be immediately obvious. The parameter p that BCON makes use of recursively is actually preventing the generation of repeat faces in α. If one wants to pre-generate the simplices in C, as they do in [1] for example, this algorithm is straightforward to modify to do so: remove the matrix operations and recursively keep a list of all faces generated from α.
We have assumed the existence of a function pos that gives us the relative order of a simplex among all other simplices in C of the same dimension. In practice we can compute this by explicitly generating all sub-complexes of C, ordering them lexicographically, and using the position of each simplex to calculate its order. This method suggests an amortized algorithm which makes use of a lookup table storing the location of each simplex. However, we can also calculate the order of a simplex α by solely using G which does not require the generation of the entire complex which up until now we have tried to avoid. For completeness we now illustrate one method of calculating pos(α), with the understanding that there may be better ways to implement this. Notationally we assume α is the set of vertices {α 0 , α 1 , . . . , α n } with d α = |α| − 1 and G = (S, R) P os(α): if α 0 ≤ j(S dα , 0): return Simple examples. We have already illustrated some of the simplicity that generating sets provide in describing complexes in the example of the torus above. From experimentation with constructing different complexes it is reasonable to conjecture the existence of certain patterns that may simplify the generation of the relational data used in the generating set for certain topological features. Looking back at the ∆-complex for the torus we can see that the relations among boundaries are matched together in reverse lexicographical order (this is not a pattern that necessarily holds in higher dimensional tori).
We have yet to look at patterns that seem promising for constructing more general features. Here we conclude with a much simpler example, which at one time JPlex used as an exercise in its tutorial; that being the example of constructing a 7-dimensional hole. In our test code we make use of a function getBoundary that maps a simplex (a list of natural numbers) to its (ordered) set of simplices that make up its boundary. We also make use of coupleSimps which takes two lists of simplices A, B and returns a new list This is not the only way to construct this specific example, as we could also use the generating set S = {(1, 8)} with no relations, and remove the highest order boundary matrix from our list of boundary maps. However, the above example is a good illustration of how easily we can describe a complex through its generating set.

Converting to Generating Sets
Consider the representation of a complex C encoded in matrix M in the following way. Similar to the boundary matrix, each column in M represents a simplex in C except all maximal simplices of dimension at least 1 are given a column (as opposed to only simplices of some fixed dimension). The rows of M are given to the vertices of C, and each column in turn represents the complex formed by the power set of all vertices with non-zero rows in M . We may refer to M as the incidence matrix of complex C. This representation of C is equivalent in information to the generating sets we have discussed thus far.
Note: this version of the incidence matrix is not the same as what is defined in [2] and possibly elsewhere. The term incidence matrix is sometimes also used in this context to refer to a matrix that encodes the relations among simplices, similar to one of the naive approaches we discussed in section 1 for representing relations. In other contexts it is sometimes used as being nearly equivalent to what we have defined to be the boundary matrix, which is how it is used in [2]. We will give an algorithm for converting from M to a generating set, with the observation that going from generating sets to a matrix M as described is much more straightforward.
Theorem: 4.1. Let G = (S, R) be the generating data for the complex C and let matrix M n×m be its incidence matrix. Then S can be constructed from M in time O(mn).
Proof. The algorithm is straightforward. For each column of M we count the number of non-zero entries. If this count gives us the value k we then know we have a maximal (k−1)-simplex. By keeping a running count of each (k − 1)-simplex, we get the total number of k-simplices for all 1 ≤ k ≤ n.
To encode relational data in a set R is also straightforward in theory. Let a k-simplex α and an -simplex β be in a complex C. Suppose that α, β share the same x + 1 ≤ k, non-zero rows in their representation in incidence matrix M . We then form a relation between α x , the xdimensional face of α, and β x , the x-dimensional face of β.
We now present an algorithm for obtaining the relational data of incidence matrix M given that we have already calculated S, the simplicial data for complex C, from M . To do this we assume for the moment access to two functions. The first is O : C k ×{0 . . Here λ = loc(α) is a function where α is the λ-th simplice of dimension |α| − 1 in the columns of the incidence matrix M c .

Conclusion
We have introduced the notion of Generating Sets and have shown how they can be used to construct the boundary matrix of both a simplicial complex as well as its representation as a ∆-complex. We have calculated the complexity of such a construction, and have shown that this is at least an improvement on the naive algorithm of building and gluing inductively. In our approach we have illustrated how given a set of relations we can save work by not repeatedly generating a simplex as both a representative and non-representative of its equivalence class. Finally we conclude by showing that the incidence matrix can be thought of as equivalent to a generating set, and present algorithms to convert from incidence matrix to generating set.