# A Numerical Approach for the Filtered Generalized Cech Complex
## 5 The Cech.scale Algorithm  
Our main algorithm (Algorithm 3) computes the Cech scale of a given 2-disk system \(M\). The key aspect on which this algorithm is based, is precisely the function \(\rho_{M}\). Before we describe the algorithm, we need to analyze additional properties of \(\rho_{M}\). It follows immediately from Lemma 4 that \(\rho_{M}(\lambda)\geq 0\) for every \(\lambda\geq\mu_{M}\). Also, if at the Vietoris-Rips scale it holds that \(\rho_{M}(\
u_{M})\geq 0\), then \(\mu_{M}=\
u_{M}\) by the minimality of the Cech scale. We conclude that in this case (this is, \(\rho_{M}(\
u_{M})\geq 0\)), the Cech scale is easily computable. On the other hand, if \(\rho_{M}(\
u_{M})<0\) then the Cech scale satisfies \(\mu_{M}\in(\
u_{M},\sqrt{4/3}\
u_{M}]\) and moreover \(\rho_{M}(\mu_{M})=0\). This is a consequence of the continuity of \(\rho_{M}\), and the fact that \(\rho_{M}(\lambda)<0\) for every \(\
u_{M}\leq\lambda<\mu_{M}\) and \(\rho_{M}(\lambda)\geq 0\) for \(\mu_{M}\leq\lambda\). Thus, to find the Cech scale of a 2-disk system \(M\) for which \(\rho_{M}(\
u_{M})<0\), we need to solve the equation \(\rho_{M}(\lambda)=0\). We propose a numerical approach to solve the equation \(\rho_{M}(\lambda)=0\) and calculate the Cech scale under the hypothesis \(\rho_{M}(\
u_{M})<0\), as in this case, we actually know that \(\mu_{M}\in(\
u_{M},\sqrt{4/3}\
u_{M}]\) (see Section 2) as consequence of the generalized Vietoris-Rips Lemma. We chose the bisection method for this purpose. We will denote the implementation of bisection method for the map \(\rho_{M}\) through the interval \([a,b]\), by \(\operatorname{bisection}(\rho_{M},a,b)\). The output of \(\operatorname{bisection}(\rho_{M},a,b)\) is a real number \(\lambda\in[a,b]\) such that \(\rho_{M}(\lambda)=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 Cech 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 2 (below) has as input a 2-disk system \(M\), and produces as output the Cech scale \(\mu_{M}\) as well as the intersection point \(\{c_{M}\}=\bigcap_{D_{i}\in M}D_{i}(c_{i};\mu_{M}\,r_{i})\). This algorithm takes a naive approach to calculate the Cech scale, and is established to completeness and to be a reference for the principal algorithm (Algorithm 3). The following lemma claims that the Algorithm 2 is consistent. Lemma 5: _For any 2-disk system \(M\), the Algorithm 2 has as output the Cech scale \(\mu_{M}\) of \(M\), and the unique intersection point \(\{c_{M}\}=\bigcap_{D_{i}\in M}D_{i}(c_{i};\mu_{M}\,r_{i})\)._  
Proof: In the case \(\rho_{M}(v_{M})\geq 0\), it is clear that the algorithm has generated asseverated data (steps (2)-(3)). In otherwise, for the case \(\rho_{M}(v_{M})<0\), we assign \(\mu^{*}:=\sqrt{4/3}\,v_{M}\). Then, \(\rho_{M}(v_{M})\cdot\rho_{M}(\mu^{*})\leq 0\) and lets call again \(\mu^{*}\) the output root in step (7). To check if \(\mu^{*}\) is the Cech scale we are looking for, we calculate in step (8) the set of pairwise intersection points of the \(\mu^{*}\)-rescaled system, contents in \(\bigcap_{D_{i}\in M}D_{i}(c_{i};\mu^{*}\,r_{i})\). If the set \(\sqcap M_{\mu^{*}}\) is unitary, then necessarily \(\bigcap_{D_{i}\in M}D_{i}(c_{i};\mu^{*}\,r_{i})\) is unitary, due the geometry of its boundary (see proof of Lemma 3). In such case (negative validation of step (9)) the steps (10)-(13) are omitted and, from Lemma 1, the algorithm returns the Cech scale as well as the intersection point \(\sqcap M_{\mu^{*}}\) at step (14); in otherwise (positive validation of step (9)), the root \(\mu^{*}\) is not the Cech scale (see Figure 5), and then we should find another scale \(\mu^{\prime}\in(v_{M},\mu^{*})\) such that \(\rho_{M}(\mu^{\prime})>0\), and repeat from step (7).