A numerical approach for the filtered generalized Cech complex

In this paper, we present an algorithm to compute the filtered generalized \v{C}ech complex for a finite collection of disks in the plane, which don't necessarily have the same radius. The key step behind the algorithm is to calculate the minimum scale factor needed to ensure rescaled disks have a nonempty intersection, through a numerical approach, whose convergence is guaranteed by a generalization of the well-known Vietoris-Rips Lemma, which we also prove in an alternative way, using elementary geometric arguments. We present two applications of our main results. We give an algorithm for computing the 2-dimensional filtered generalized \v{C}ech complex of a finite collection of $d$-dimensional disks in $\mathbb{R}^d$. In addition, we show how the algorithm yields the minimal enclosing ball for a finite set of points in the plane.

Of particular interest to us is the generalizedČech complex structure: whereas the standardČech complex is induced by the intersection of a collection of disks with fixed radius, the generalized version admits different radii (see [14]); when radiuses are rescaled, using the same scale factor each time, the corresponding simplicial complexes forms the filtered generalizedČech complex.
There exist efficient algorithms to calculate the standardČech complex (e.g. [6]), and software currently available to obtain the associated filtration (cf. [16,17]); also, in [13] the authors propose an algorithm to approximate theČech filtration. On the other hand, we can find algorithms to calculate the generalizedČech complex (e.g. [14]), however as far as we know, there are neither algorithms nor software to provide the filtered generalizedČech complex. In the present work we show an algorithm to compute the filtered generalizedČech complex for a finite collection of disks, specifically, in the plane. Actually, we also show an algorithm to build up to the 2-dimensional filtered generalized structure (or 2-skeleton), for higher dimensional disk systems, which many applications only require, as we can see in [2,7,12,18,20].
The key step behind these proposed algorithms, is to calculate the minimum scale factor (calleď Cech scale) needed to ensure that the rescaled disks have a nonempty intersection; the generalized Vietoris-Rips Lemma over multiple radii will allow us to calculate these scales numerically.
We must emphasize that, our main algorithm (Algorithm 5) is only generalizable to higher dimensional disk systems to obtain the 2-dimensional filtered generalizedČech structure, as we show as an application. Additionally, we show how our algorithm yields the minimal enclosing ball for a finite set of points in the plane. This paper is organized as follows. In Section 2 we introduce basic notions and notation which will be used throughout the paper. We define the Vietoris-Rips system and theČech system, associated to a finite collection of closed d-disks (or d-disk system) in terms of their intersection. We also introduce the fundamental notions of Vietoris-Rips scale andČech scale for a d-disk system, as the infimum over all rescaling factors such that the d-disk system becomes a Vietoris-Rips system or aČech system respectively. In Lemma 5 we state and prove a generalization, over multiple radii, of the well-known Vietoris-Rips Lemma [7, Th. 2.5] using elementary geometric arguments. In [1] can be found a proof in the generalized case, following the ideas in [7].
In Section 3 we describe the generalized versions of standard Vietoris-Rips andČech simplicial complex structures, to the case of d-disk systems with different radiuses. We explain how their respective filtrations are induced by weight functions, and we propose an algorithm to obtain thě Cech-weight function of a given d-disk system, associating to eachČech simplex its correspondinǧ Cech scale.
Section 4 focuses on studying the intersection properties of collections of disks in the plane. We define a real-valuated function associated to each 2-disk system, such that, if it turns out to be nonnegative, then itsČech scale agrees with its Vietoris-Rips scale, being then easy to compute; otherwise, theČech scale will correspond to a root of such function, and we propose a numerical approach to obtain thisČech scale (Section 5), supported on the generalized Vietoris-Rips Lemma which provides appropriated bounds.
Section 5 contains our main result, the Cech.scale algorithm, whose input is a 2-disk system, and the output is the correspondingČech scale, as well as the unique intersection point of the rescaled disk system at itsČech scale (see Remark 3).
Finally, we conclude the paper illustrating two applications in Section 6. First, we recall the miniball problem, to show how our Cech.scale algorithm yields the minimal enclosing ball for a finite point cloud in the plane. Secondly, we present an algorithm for computing theČech filtration of the 2-skeleton of the generalizedČech complex structure for a d-dimensional disk systems in an arbitrary euclidean space R d .

Vietoris-Rips andČech systems
Throughout this paper, a finite collection of d-disks in euclidean space R d with positive radius, will be called d-disk system. In this section we introduce and analyze two fundamental subclasses of d-disk systems, namely, the Vietoris-Rips systems and theČech systems. We study the infimum of those scales that turn a d-disk system into a Vietoris-Rips orČech system. We conclude this section presenting a generalized version of the Vietoris-Rips Lemma, extended to d-disk systems.
For each λ ≥ 0, and d-disk system M as in (1) we define the collection and say that λ is a scale. Geometrically, the set M λ consists of d-disks with the same centers than those in M , but with rescaled radii by λ. Clearly, only when λ > 0 the set M λ will be again a d-disk system. Note that M 1 = M , and M 0 is the set consisting of the centers of the d-disks in M .

Definition 2.
Let M be a d-disk system. The Vietoris-Rips scale of M is defined by, Analogously, theČech scale of M is defined by, A straightforward calculation shows the following characterizations: M is a Vietoris-Rips system if and only if, ν M ≤ 1 (in particular, ν Mν M = 1); similarly, M is aČech system if and only if, Note that it is not hard to calculate the Vietoris-Rips scale ν M for a given d-disk system M = {D 1 , D 2 , . . . , D m }: if r i denotes the radius of D i , and c i − c j represents the distance between the center of D i and D j , then For a d-disk system M with just one disk, its Vietoris-Rips scale is ν M = 0; if M = {D 1 , D 2 } has two disks, then ν M = c 1 − c 2 /(r 1 + r 2 ). Actually, in both cases the Vietoris-Rips scale agrees with theČech scale.
On the other hand, calculating theČech scale is a more complicated issue if the d-disk system has at least three disks.
ConcerningČech scales, we have the following remark, which will become important for our implementation. Indeed, suppose this were not true. Then there would be p 1 , p 2 ∈ D i ∈M D i (c i ; µ M r i ) such that p 1 = p 2 . By convexity of the d-disks, it follows that the middle pointp = 1 2 (p 1 + p 2 ) must belong to    This 2-disk system is a Vietoris-Rips system and also aČech system. In this case, we have ν M = √ 26/6 ≈ 0.8498, and actually, the ν M -rescaled 2-disk system M ν M (center picture), has an empty intersection, i.e. D i ∈M D i (c i ; ν M r i ) = ∅, so it corresponds to a Vietoris Rips system which is not aČech system. For such disk system, the Cech.scale algorithm in Section 5 yields to µ M = 0.9188 and theČech system M µ M is shown in the right picture.
There exists a close relationship between Vietoris-Rips systems andČech systems. Obviously, everyČech system is also a Vietoris-Rips system, but the opposite statement does not hold in general (as we saw in the example above). However, we have the following result which extends the standard Vietoris-Rips Lemma [7,Th. 2.5], to any Vietoris-Rips system (compare with [1,Th. 3.2] and [13,Th. 4]).
Proof. First, we prove the result for the case where M has at most d + 1 disks, say M = for every t ∈ I v := (0, 2 v, c i − c M / v 2 ); this implies that c M + tv ∈ D(c i ; µ M r i ) for any i = 1, . . . , m and t ∈ I v , which is a contradiction since c M is the only point in the intersection i D(c i ; µ M r i ). Therefore, c M is in the convex hull. Now, defineĉ i := c i − c M and let θ ij denote the angle between vectorsĉ i andĉ j . Since c M is in the convex hull of {c 1 , ..., c m }, then the vector 0 ∈ R d can be written as a convex combination Taking out the common factor ĉ i , we have m j=1 a j ĉ j cos θ ji = 0. Now, taking the sum over i, we deduce that Note that cos θ ii = 1. On the other hand, if were cos then, for each j we should have m i=1 cos θ ji = 1 + m j=1,j =i cos θ ji > 0. But, this contradicts (2) because m j=1 a j = 1 and a j ≥ 0. Therefore, there must exist i = j, say i = 1 and j = 2, such that cos (1 + cos(θ 12 )) ≤ 1.
It follows from inequality above and from the AM-GM inequality, that A straightforward calculation on (4) leads us to the following inequality For a collection with more than d + 1 disks, the claim is a consequence of the Helly's Theorem (see [3,Problem 29]) which establishes that for any finite collection of convex subsets of R d greater than d, if the intersection of every d + 1 of such sets is nonempty, then the whole collection has a nonempty intersection. This concludes the proof.
The upper bound 2d/(d + 1) in Lemma 5 is optimal: it suffices to take a d-disk system with d + 1 disks of equal radii and pairwise tangents (cf. [8,Sec. III.2]).
In the Example 4 we can see what the Vietoris-Rips Lemma claim for the 2-disk system M : To conclude this section, notice that as for aČech system µ M ≤ 1, then the Vietoris-Rips Lemma implies the following result.

Filtered generalized simplicial structures for d-disk systems
In this section we introduce two simplicial structures associated with a d-disk system M , as well as the filtration induced by rescaling the system M . The importance of these notions lies in their relation to the topological analysis through persistent homology of filtered simplicial structures, induced by point clouds with non-homogeneous neighborhoods.
Let M be a d-disk system. Denote by VR(M ) the family of all Vietoris-Rips subsystems of M , this is, Analogously, denote by C (M ) the set of allČech subsystems, On the other hand, recall that a simplicial structure on a (finite) set V is defined as a family ∆(V ) ⊂ 2 V of subsets of V such that: if σ ∈ ∆(V ) and τ ⊂ σ, then τ ∈ ∆(V ). Is immediate that for any σ ∈ VR(M ), every d-disk subsystem τ ⊂ σ is also in the family τ ∈ VR(M ). The same property is valid for the family C (M ). These properties imply that VR(M ) and C (M ) are simplicial complexes.
We refer to VR(M ) as the generalized Vietoris-Rips complex associated to the d-disk system M , and to C (M ) as the generalizedČech complex of M .
The above construction allows us to study the topology of a data cloud through the persistent homology of the generalized Vietoris-Rips orČech complexes, i.e. to perform a topological data analysis. However, to perform such analysis it is necessary to construct a filtered simplicial structure. We will define a filtration through weight functions.
For example, to the generalizedČech complex C (M ) of the d-disk system M , the function ω : C (M ) → R, σ → µ σ which assigns theČech scale to anyČech subsystem σ ⊂ M , is a weight function, called theČech-weight function. The analogous property holds for the Vietoris-Rips complex and the Vietoris-Rips scale (see [1] for the construction of the filtered generalizedČech complex using weighted point clouds).
Moreover, from the definition we have for theČech-weight function and to every nonnegative We will denote by C M (λ) the family C (M λ ) for λ ≥ 0, i.e. the family of allČech subsystems of the λ-rescaled disk system M λ , in order to make the dependence explicit with respect the the parameter. We establish the analogous definition for VR M (λ), for any λ ≥ 0.
It is important to note that there is no restriction on the scale λ ≥ 0, additional to the nonnegativity, i.e. we allow greater values of λ than 1, in the interest of studying the generalizedČech complex of rescaled disk systems beyond the original.
For λ ≤ λ we have the families contention: VR M (λ ) ⊂ VR M (λ) and C M (λ ) ⊂ C M (λ). In general, given a simplicial complex ∆ and a weight function ω : ∆ → R, any increasing sequence λ 1 < · · · < λ s of real numbers induces a simplicial filtration: ∆ 1 ⊂ · · · ⊂ ∆ s for ∆ i := ω −1 ((−∞, λ i ]). Thus, for any d-disk system M , the generalizedČech complex C (M ) has a filtered simplicial complex structure, Of course, even when we can vary the scale λ on a interval, the length of the above filtration is finite. Now the importance of theČech scale in the construction of the filtration of the generalizedČech complex is evident. The goal of the next sections is the construction of algorithms to numerically estimate theČech scale of everyČech subsystem of M .
To any d-disk system M , the simplicial substructure C (M ) (1) given by the 1-skeleton of the generalizedČech complex of M is a basic combinatorial structure (actually, a graph) that can be easily defined, it just takes the relationship into account if every two vertices are neighbors: the set of vertices is M , and there exists an edge {D i , D j } whenever D i ∩D j = ∅. TheČech-weight function restricted to C (M ) (1) is, in fact: ω({D i }) = 0 to every vertice, and ω({D i , D j }) = c i −c j /(r i +r j ) to any edge.
In Algorithm 1 we calculate theČech-weight function ω : C M (λ) (dim) → R, for the dim-skeleton of a λ-rescaled d-disk system M . To do this, we assume an arbitrary linear order in the d-disk system M , and for every disk D ∈ M we consider the following set (cf. [22]): λ-LowerNbrs(D) = {D ∈ M |D < D, ω({D,D}) ≤ λ}.
Algorithm 1:Čech-weight function of a d-disk system. Input : A d-disk system M , a nonnegative parameter λ and an integer dim ≥ 2.
Output: TheČech-weight function ω : We conclude the section with an application of Algorithm 1 to a 2-disk system.

Intersection properties of disk systems
In this section we focus on studying 2-disk systems in the plane, called simply disk systems. As we have seen in the last section, the study of theČech scale is a key aspect to the construction and study of filtered generalizedČech complex. In this section, we establish several intersection properties of disk systems, which will lead us to be able to calculate theČech scale. Let Let D i and D j be two disks such that D i ∩ D j = ∅. We define D i D j to be the unitary set {d ij } constructed as follows: (1) If ∂D i ∩∂D j = ∅, then d ij ∈ ∂D i ∩∂D j is the only one point with the property d ij −c i , n ij ≥ 0, where n ij = (−b, a) is the normal vector to c j − c i = (a, b), (2) If ∂D i ∩∂D j = ∅, we define d ij as the unique intersection point in ∂D i (c i ; λr i )∩∂D j (c j ; λr j ), for λ given as the minimal scale such that D i (c i ; λr i ) ⊂ D j (c j ; λr j ), i.e. λ = c i −c j /|r i −r j |. In particular, when D i and D j are concentric, then D i D j = {c i } = {c j }. On the other hand, if the disks D i and D j are internally or externally tangent, then d ij = d ji . We can think about d ij , when ∂D i ∩ ∂D j is not empty, as the intersection point of the boundaries at the left of the vector from c i to c j . Figure 3 shows the above construction.
We will denote by d ij (λ), instead of simply d ij , for the intersection point of the λ-rescaled disks D i (c i ; λr i ) and D j (c j ; λr j ).
In order to studyČech systems, we give the following characterization, according the intersection points d ij .  In the first case, necessarily c M ∈ ∂D i ∩ ∂D j for some i, j and, it follows d ij = c M ∈ D k for all k.
For the second case, if a ∈ ∂A ⊂ A belongs to the boundary and is in the intersection of two arcs, say ∂D i and ∂D j , then a = d ij and it satisfy d ij ∈ D k for every k = i, j.
For the last case, if A = D i for some i, then for each j = i we have d ij ∈ A ⊂ D k for all k = i, j. Therefore, in any case there exists such point d ij .
The converse is clear by definition of aČech system.
This criterion was presented in [14, Sec. III] for a disk system. Next, we define the map ρ, which in a certain sense quantifies the intersection of a disk system. This map will allow us to discern the minimal scale in which a disk system has the nonempty intersection property. It follows, by construction, that ρ M is continuous throughout the interval [ν M , ∞). Indeed, given three disks D i (c i ; r i ), D j (c j ; r j ) and D k (c k ; r k ), denote by Λ If r i = r j , then for each k = i, j the map Λ k i,j is continuous in the range Figure 4 shows in bold red color the geometric place of {d ij (λ), d ji (λ)} which vary continuously respect to the parameter λ and also the distance from it to the fix point c k . On the other hand, for r i = r j the points {d ij (λ), d ji (λ)} vary continuously respect to λ on the line showed in the right picture of Figure 4. Therefore, λr k − d ij (λ) − c k also depend continuously of λ. The continuity of ρ M is a consequence of the continuity of each map Λ k i,j and the continuity of the min-max functions: The map ρ M plays a key role in the rest of this work. The Algorithm 2 allows to systematically reach the value ρ M (λ). In addition, we present the next characterization ofČech systems in therms of ρ M .

The Cech.scale algorithm
Our main algorithm (Algorithm 5) computes theČech scale of a given disk system M . The key aspect on which this algorithm is based, is precisely the function ρ M . Before we describe the algorithm, we need to analyze additional properties of ρ M .
It follows immediately, from Lemma 10, that ρ M (λ) ≥ 0 for every λ ≥ µ M . Also, if at the Vietoris-Rips scale it holds that ρ M (ν M ) ≥ 0, then µ M = ν M by the minimality of theČech scale. We conclude that in this case (this is, ρ M (ν M ) ≥ 0), theČech scale is easily computable.
On the practical side, we conclude that a priori validation of the sign of the evaluated function ρ M (ν M ) is a useful step in an efficient procedure that computesČech scales. For this purpose, we present the Algorithm 3 which has as output the logical TRUE if ρ(λ) ≥ 0, for given disk system M and scale λ.  Notice that some radii configurations yields high probability of getting the same Vietoris-Rips andČech scale: in the case of a Vietoris-Rips system M with 3 elements and equal radii, the probability that M is also aČech system is p 3 := P(µ M = ν M ) = 3π/(8π − 3 √ 3) ≈ 0.47; for a Vietoris-Rips system with m-elements and equal radii, the probability to be aČech system is p m−2

3
. We propose a numerical approach, in order to solve the equation ρ M (λ) = 0, to calculate theČech scale under the hypothesis ρ M (ν M ) < 0, since in this case, we actually know that µ M ∈ (ν M , 4/3ν M ] (see Section 2) as consequence of the generalized Vietoris-Rips Lemma. We have chosen the bisection method for this purpose. We will denote the implementation of bisection method for the map ρ M through the interval [a, b], by bisection(ρ M , a, b). The output of bisection(ρ M , a, b) is a real number λ ∈ [a, b] such that ρ M (λ) = 0. For the numerical method we are working with a precision of 10 −12 .
It is important to mention that the numerical method regula falsi was also used instead of the numerical method of bisection, in order to calculating theČech scale. However, in our context the efficiency of the program using the regula falsi numerical method is not better than if the numerical method of bisection is used.
The Algorithm 4 (below) has as input a disk system M , and produces as output theČech scale µ M as well as the intersection point {c M } = D i ∈M D i (c i ; µ M r i ). This algorithm takes a naive approach to calculate theČech scale, and is established to completeness and to be a reference for the principal algorithm (Algorithm 5).
Algorithm 4: TheČech scale calculation for disk system. Input : A disk system M . Output: TheČech scale µ M and the intersection point c M .
Then, ρ M (ν M ) · ρ M (µ * ) ≤ 0 and lets call again µ * the output root in step (8). To check if µ * is theČech scale we are looking for, we calculate the set of pairwise intersection points of the µ * -rescaled system M µ * , in step (9).
If the set M µ * is unitary, then steps (10)- (14) are omitted and the algorithm returns theČech scale as well as the intersection point M µ * at step (15); in otherwise, the root µ * is not theČech scale (see Figure 5), and then we should find another scale µ ∈ (ν M , µ * ) such that ρ M (µ ) > 0, and repeat from step (8). It is possible, for some configurations of the disk system, that the map ρ M has a behavior as in Figure 5. The last iterative part is a finite process because ρ M is algebraic over Q, then eventually the set M µ * will be unitary and theČech scale will be calculated.  On the other hand, if the disk system M consists of just three disks and ρ M (ν M ) < 0, then itš Cech can be computed with only one application of the numerical method, as we asseverate in the following lemma. On the other hand we may assume, without loss of generality, that r 1 = max i {r i } and let c M = d 23 (µ M ) be the intersection point at theČech scale. By the triangle inequality we have that for any λ > µ M , the following two inequalities holds: and at least one of them must be strict. Then The following algorithm takes advantage of the unicity property for the root of ρ M , in a disk system with three disks. Essentially, the algorithm consist in iterating the Algorithm 4 systematically over every triplet of disks from M . Proof. If ρ M (ν M ) ≥ 0, the algorithm returns the right data: steps (1)- (5).
On the other hand, by Helly's Theorem (cf. [3]) the disk system M = {D 1 , . . . , D m }, as a finite family of convex sets in the plane, has a nonempty intersection D i ∈M D i if, and only if, D i ∩ D j ∩ D k = ∅ for every triplet 1 ≤ i < j < k ≤ m. Let µ be the maximalČech scale over every triplet in the disk system M , i.e.
It follows that every µ-rescaled triplet has a nonempty intersection. Hence, the µ-rescaled disk system M µ also has the nonempty intersection property. Moreover, for every triplet N ⊂ M . Therefore, µ is actually theČech scale of the disk system, this is, µ M = µ.
In steps (6)- (19) the algorithm search the scale µ systematically, over every triplet {D i , D j , D k } ⊂ M , updating the maximal scale found if necessary in steps (15)- (17). By Lemma 13, everyČech scale calculation over any triplet, requires just one application of the bisection method. This implies the correctness of the algorithm.
Additionally, the condition in step (9) avoids calculating unnecessaryČech scales of triplets N = {D i , D j , D k }. In effect, if λ * is the maximalČech scale found until the verification of the triplet N , and the condition in step (9) does not satisfy, i.e.
then, whatever is theČech scale of N , it would be not greater than λ * .
The computational evidence to support the Algorithm 5 is more efficient than Algorithm 4, is given in Figure 7. The graphic shows the average time (in seconds) to computation of both algorithms, with respect to the number of disks in a randomly generated disk system (see Remark 16).  Given a finite point cloud N ⊂ R d the miniball problem consists in finding the center c ∈ R d and minimum radius r ∈ R + of a d-disk D = D(c; r) ⊂ R d such that N ⊂ D.
There exist many different approaches to solve this problem, and a variety of algorithms to reach the miniball data (e.g. [9,21]). In fact, theČech scale has a close relation with the miniball problem, as we establish in the next lemma. Lemma 15. Let N be a finite point cloud in R d , and let N 1 be the associated d-disk system defined by Then, theČech scale µ N 1 is the radius of the minimal enclosing ball of N , and the intersection point Proof. Let µ N 1 be theČech scale of the disk system N 1 and let c N 1 be the intersection point of the µ M -rescaled disk system. Then the point c N 1 belongs to every disk D i (c i ; µ N 1 · 1), i.e.
On the other hand, by definition ofČech scale, µ N 1 is the minimal radius (scale) with such property. Therefore, by uniqueness, D(c N 1 ; µ N 1 ) must be the minimal ball enclosing the point cloud N .
In particular, for a point cloud N in the plane we can apply our algorithm Cech.scale (Algorithm 5) to the disk system N 1 , and get the minimal enclosing ball of N .
In Figure 8 we show a point cloud N (black dots) and the disk system N 1 (blue circles). Applying the Cech.scale script to N 1 we get theČech scale µ N 1 (radio of the red circle) and the point c N 1 (red point, center of the red circle). For the miniball problem there are many efficient algorithms available online, which are easy to find. For example, the C++ script in [10] can compute the miniball for point clouds in any dimension (efficiently up to dimension 10,000).
6.2. The algorithm Cech.scale for higher dimensional disk systems. It is not clear how to generalize the Algorithm 5 to determine theČech scale of a d-disk system in R d with d > 2. However, it is possible to calculate theČech scale if the d-disk system consists of only three d-disks. This makes it possible to calculate the 2-skeleton associated with a d-disk system in an arbitrary dimension.
The relevance of this application lies in the possibility of calculating the 2-dimensional filtered simplicialČech structure of a d-disk system immersed in a high-dimensional euclidean space.
The key observation is that where P is the affine plane generated by the set {c 1 , c 2 , c 3 }.
Thus, the problem of determining whether (D(c i ; r i ) ∩ P ) is empty or not, can be treated as one in the plane, constructing a disk system in R 2 that preserves the affine configuration of the points {c 1 , c 2 , c 3 } in the affine space P ⊂ R d . To do this, we set the first center c 1 as the origin in R 2 , and "translate" the others centers preserving their original configuration, taking care of moving the second center on the x-axis, as in Figure 9. The next algorithm is a variant of Algorithm 1, taking as input a d-disk system in R d and a nonnegative parameter λ, and as output theČech weight function of the 2-skeleton of the generalizeď Cech complex structure. The algorithm first preprocess each triplet of d-disks as a 2-disk system, then theČech scale is calculated.