# A Numerical Approach for the Filtered Generalized Cech Complex
## 6 The Algorithm Cech.scale for Higher-Dimensional Disk Systems  
It is not clear how to generalize the Algorithm 3 to determine the Cech scale of a disk system in \(\mathbb{R}^{d}\) with \(d>2\). However, it is possible to calculate the Cech scale if the \(d\)-disk system consists of only three 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 Cech structure of a disk system immersed in a high-dimensional euclidean space. Many applications in topological data analysis concerns to the study of low-dimensional topological features associated to a point data cloud immersed in a high-dimensional representation space. The key observation is that  
\[\bigcap_{i=1}^{3}D(c_{i};r_{i})\
eq\emptyset\Leftrightarrow\bigcap_{i=1}^{3}(D (c_{i};r_{i})\cap P)\
eq\emptyset,\]  
where \(P\) is the affine plane generated by the set \(\{c_{1},c_{2},c_{3}\}\). Thus, the problem of determining whether \(\bigcap_{i=1}^{3}(D(c_{i};r_{i})\cap P)\) is empty or not, can be treated as one in the plane, constructing a disk system in \(\mathbb{R}^{2}\) that preserves the affine configuration of the points \(\{c_{1},c_{2},c_{3}\}\) in the affine space \(P\subset\mathbb{R}^{d}\). To do this, we set the first center \(c_{1}\) as the origin in \(\mathbb{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.  
Figure 8: The miniball of the point cloud \(N\). More precisely, to any \(d\)-disk system with three elements, say \(M=\{D_{1}(c_{1};r_{1}),D_{2}(c_{2};r_{2}),D_{3}(c_{3};r_{3})\}\), we associate the following 2-disk system, which clearly preserves the affine configuration of the original centers \(\{c_{1},c_{2},c_{3}\}\),  
\[\operatorname{Aff}(M)=\{D_{1}(\check{c}_{1};r_{1}),D_{2}(\check{c}_{2};r_{2}), D_{3}(\check{c}_{3};r_{3})\}\]  
where \(\check{c}_{1}:=(0,0)\), \(\check{c}_{2}:=(\|c_{2}-c_{1}\|,0)\), \(\check{c}_{3}:=(\|c_{3}-c_{1}\|\cos(\theta),\|c_{3}-c_{1}\|\sin(\theta))\), where \(\theta\) is the angle between the vectors \(c_{2}-c_{1}\) and \(c_{3}-c_{1}\), which satisfies the following relationship:  
\[\cos\theta=\frac{\langle c_{2}-c_{1},c_{3}-c_{1}\rangle}{\|c_{2}-c_{1}\|\cdot \|c_{3}-c_{1}\|}.\]  
The Algorithm 4 is a variant of Algorithm 1, taking as input a \(d\)-disk system in \(\mathbb{R}^{d}\) and a non-negative parameter \(\lambda\), and as output the Cech weight function of the 2-skeleton of the generalized Cech complex structure. The algorithm first preprocess each triplet of \(d\)-disks as a 2-disk system, then the Cech scale is calculated. ```
Input : A \(d\)-disk system \(M\) and a parameter \(\lambda\geq 0\). Output : The Cech-weight function \(\omega:\mathscr{C}_{M}(\lambda)^{(2)}\to\mathbb{R}\). 1 Calculate \(\mathscr{C}_{M}(\lambda)^{(1)}\);
2 for\(\{D_{i},D_{j}\}\in\mathscr{C}_{M}(\lambda)^{(1)}\)do
3\(\operatorname{LN}_{ij}\leftarrow\lambda\)-\(\operatorname{\textsc{LowerNbrs}}(D_{i})\,\cap\,\lambda\)-\(\operatorname{\textsc{LowerNbrs}}(D_{j})\);
4 for\(D_{k}\in\operatorname{LN}_{ij}\)do
5\(N\leftarrow\operatorname{Aff}(\{D_{i}(c_{i};r_{i}),D_{j}(c_{j};r_{j}),D_{k}(c _{k};r_{k})\})\);
6 Calculate \(\omega(N)\leftarrow\mu_{N}\);
7 if\(\omega(N)\leq\lambda\)then
8 Update \(\mathscr{C}_{M}(\lambda)^{(2)}\leftarrow\mathscr{C}_{M}(\lambda)^{(2)}\cup\{D_ {i},D_{j},D_{k}\}\);
9 end if
10
11 end for
12
13 end for return\((\mathscr{C}_{M}(\lambda)^{(2)},\omega:\mathscr{C}_{M}(\lambda)^{(2)}\to \mathbb{R})\)
```  
**Algorithm 4**2-skeletal Cech-weight function. Figure 10 shows the performance (in \(10^{-6}\) s) of the C/C++ script Cech.scale (available in [24]) and the preprocessing of the \(d\)-disk system to a 2-disk system. Figure 9: Affin configuration of the \(d\)-disk system. **Remark 1**.