Topological Data Analysis: Simplicial Complexes, Persistent Homology, and the Mapper Algorithm

Topological Data Analysis (TDA) is an applied mathematical and machine learning discipline that extracts coordinate-invariant structural and qualitative features from complex, high-dimensional datasets. By translating unstructured point clouds into continuous geometric shapes and topological spaces, TDA identifies multiscale connectivity patterns, cyclic loops, and multidimensional voids that are invisible to linear projections (such as PCA) or localized distance metrics.

This article details the theoretical foundations of algebraic topology for data science, simplicial complex construction, persistent homology computations, persistence diagrams, and the Mapper algorithm.


1. Metric Spaces and Simplicial Complexes

In topological data analysis, raw data is modeled as a finite metric space (X, d_X), where X = \{x_1, x_2, \dots, x_N\} \subset \mathbb{R}^D is a point cloud and d_X is a distance metric (e.g., Euclidean or geodesic distance).

Abstract Simplicial Complexes

A geometric k-simplex \sigma = [v_0, v_1, \dots, v_k] is the convex hull of k + 1 affinely independent vertices:

An Abstract Simplicial Complex K is a collection of finite non-empty sets (simplices) such that:

  1. Every non-empty subset of a simplex \sigma \in K is also in K (closed under taking faces).
  2. The intersection of any two simplices in K is either empty or a shared face.
Simplicial Representation:
  0-Simplex (Vertex)    1-Simplex (Edge)     2-Simplex (Triangle)     3-Simplex (Tetrahedron)
         (v0)              (v0)-----(v1)            (v0)                       (v0)
                                                   /    \                     / | \
                                                  /      \                   /  |  \
                                                (v1)----(v2)               (v1)-(v2)-(v3)

Complexes from Point Clouds

To reconstruct the continuous topological manifold \mathcal{M} from discrete sample X:

  1. Čech Complex (\check{C}_\epsilon(X)): A simplex \sigma = [x_0, \dots, x_k] \in \check{C}_\epsilon(X) if and only if the closed balls of radius \epsilon/2 centered at x_i have a non-empty mutual intersection:
    \bigcap_{i=0}^k B\left(x_i, \frac{\epsilon}{2}\right) \neq \emptyset

    By the Nerve Theorem, if the union of balls is contractible, \check{C}_\epsilon(X) is homotopy equivalent to \bigcup_{x \in X} B(x, \epsilon/2).

  2. Vietoris-Rips Complex (\text{VR}_\epsilon(X)): A computationally tractable approximation where \sigma = [x_0, \dots, x_k] \in \text{VR}_\epsilon(X) if and only if all pairwise distances satisfy d(x_i, x_j) \le \epsilon for all 0 \le i < j \le k.

The Vietoris-Rips and Čech complexes satisfy the interleaving relationship:

\check{C}_\epsilon(X) \subseteq \text{VR}_\epsilon(X) \subseteq \check{C}_{2\epsilon}(X)

2. Homology Groups and Betti Numbers

Homology algebraically measures topological "holes" of varying dimensions within a simplicial complex K.

Chain Complexes and Boundary Operators

Let C_k(K) be the vector space of k-chains (formal linear combinations of k-simplices over a field \mathbb{F}, typically \mathbb{Z}_2).

The Boundary Operator \partial_k: C_k(K) \to C_{k-1}(K) maps a k-simplex to an alternating sum of its (k-1)-faces:

\partial_k [v_0, v_1, \dots, v_k] = \sum_{i=0}^k (-1)^i [v_0, \dots, \hat{v}_i, \dots, v_k]

where \hat{v}_i denotes the omission of vertex v_i.

A fundamental property of boundary operators is:

\partial_{k-1} \circ \partial_k = 0 \quad (\partial^2 = 0)
Chain Complex Algebraic Sequence:
... ---> C_{k+1}(K) --∂_{k+1}--> C_k(K) --∂_k--> C_{k-1}(K) ---> ... ---> C_0(K) --∂_0--> 0
                                   |
           +-----------------------+-----------------------+
           |                                               |
     Z_k = ker(∂_k) (k-Cycles)                       B_k = im(∂_{k+1}) (k-Boundaries)

Because \partial^2 = 0, every boundary is automatically a cycle (\operatorname{im}(\partial_{k+1}) \subseteq \ker(\partial_k)).

Homology Groups and Betti Numbers

The k-th Homology Group H_k(K) is the quotient vector space of cycles modulo boundaries:

H_k(K) = \frac{\ker(\partial_k)}{\operatorname{im}(\partial_{k+1})} = \frac{Z_k(K)}{B_k(K)}

The dimension of H_k(K) is the k-th Betti Number \beta_k = \dim(H_k(K)):


3. Persistent Homology and Filtrations

In real data, no single choice of scale parameter \epsilon captures the true topology without noise. Persistent Homology tracks topological features across a nested sequence of complexes (a filtration):

\emptyset = K_0 \subseteq K_1 \subseteq K_2 \subseteq \dots \subseteq K_m = K

where K_i = \text{VR}_{\epsilon_i}(X) with \epsilon_0 < \epsilon_1 < \dots < \epsilon_m.

Filtration Progression over Scale Parameter ε:
  ε = 0.5 (Disconnected)      ε = 1.2 (1D Loop Born)        ε = 2.5 (Void Filled / Dies)
     (.)     (.)                    (.)---(.)                      (.)====(.)
                                    /       \                      || \\// ||
     (.)     (.)                  (.)       (.)                    (.)====(.)
                                    \       /
     (.)     (.)                    (.)---(.)                      (Solid 2-Complex)
   β₀ = 6, β₁ = 0                 β₀ = 1, β₁ = 1                  β₀ = 1, β₁ = 0

Persistence Diagrams and Barcodes

As \epsilon increases, topological homology classes appear (are "born" at scale b) and merge with older classes or fill in (and "die" at scale d).

Each topological feature is encoded as a point (b_i, d_i) \in \mathbb{R}^2 in a Persistence Diagram or as a horizontal interval [b_i, d_i) in a Persistence Barcode:

Persistence Diagram (PD):
  Death (d)
    ^
    |          . (True 1D Circular Feature)
    |
    |       . .
    |      .. . (Topological Noise)
    |    ./
    +----+-------------------------> Birth (b)
       Diagonal (d = b)

Stability Theorems and Distances

The distance between two persistence diagrams D_1 and D_2 is measured via the Bottleneck Distance W_\infty:

W_\infty(D_1, D_2) = \inf_{\gamma} \sup_{p \in D_1} \|p - \gamma(p)\|_\infty

where \gamma ranges over all bijections from D_1 \cup \Delta to D_2 \cup \Delta (with \Delta being the diagonal with infinite multiplicity).

The Stability Theorem (Cohen-Steiner et al.) guarantees that small perturbations in input point cloud data induce strictly bounded perturbations in persistence diagrams:

W_\infty(\operatorname{Dgm}(f), \operatorname{Dgm}(g)) \le \|f - g\|_\infty

4. Vectorization and Machine Learning Integration

Because persistence diagrams are variable-sized point multi-sets with non-standard metric geometries, TDA uses functional embeddings for machine learning pipelines:

  1. Persistence Landscapes (\lambda_k(t)): Sequences of piecewise linear continuous functions mapping diagrams to Banach spaces L^p(\mathbb{R}), enabling standard averaging, PCA, and hypothesis testing.
  2. Persistence Images (PI(x, y)): Convolves rotated birth-persistence coordinates (b, d-b) with 2D Gaussian kernels weighted by a ramp function w(y), producing fixed-size matrix representations for Convolutional Neural Networks.
  3. Betti Curves: 1D functional traces \beta_k(t) plotting Betti number counts as a function of filtration scale t.

5. The Mapper Algorithm for Dimensionality Exploration

The Mapper Algorithm produces a low-dimensional graph abstraction representing the structural topology of high-dimensional data.

The Mapper Pipeline:
High-Dimensional Point Cloud X ⊂ ℝᴰ
            |
  [ Apply Filter / Lens Function f: X → ℝᵈ (e.g., UMAP, Density, Eccentricity) ]
            v
1D / 2D Lens Values in Projection Space
            |
  [ Decompose Projection Space into Overlapping Bins / Covers U = {U_α} ]
            v
  [ For each cover U_α, pull back data f⁻¹(U_α) and apply Partial Clustering ]
            v
  [ Construct Simplicial Complex Nerve: Nodes = Clusters; Edges = Shared Points ]
            v
Topological Skeleton Graph Output
import numpy as np

def generate_synthetic_torus(n_samples: int = 1000, R: float = 2.0, r: float = 0.5) -> np.ndarray:
    """Generates 3D point cloud on the surface of a torus."""
    theta = np.random.uniform(0, 2 * np.pi, n_samples)
    phi = np.random.uniform(0, 2 * np.pi, n_samples)
    x = (R + r * np.cos(theta)) * np.cos(phi)
    y = (R + r * np.cos(theta)) * np.sin(phi)
    z = r * np.sin(theta)
    return np.column_stack([x, y, z])

6. Applications in Computational Science and AI

+---------------------------+-----------------------------------+------------------------+
| Domain                    | TDA Role                          | Target Topological Feature|
+---------------------------+-----------------------------------+------------------------+
| Drug Discovery            | Molecular conformation analysis   | Cavities in binding pockets|
| Financial Time Series     | Market crash / regime detection   | 1D loop entropy bursts |
| Neuroscience              | Functional brain network topology | Multidimensional cliques|
| Deep Learning / LLMs      | Representation geometry in layers | Intrinsic manifold dim |
| Materials Science         | Nanoporous material zeolites      | Persistent 2D pore voids|
+---------------------------+-----------------------------------+------------------------+

References

  1. Edelsbrunner, H., & Harer, J. L. (2010). Computational Topology: An Introduction. American Mathematical Society.
  2. Carlsson, G. (2009). Topology and Data. Bulletin of the American Mathematical Society, 46(2), 255–308.
  3. Chazal, F., & Michel, B. (2021). An Introduction to Topological Data Analysis: Fundamental and Practical Aspects for Data Scientists. Foundations and Trends in Machine Learning.
  4. Singh, G., Mémoli, F., & Carlsson, G. (2007). Topological Methods for the Analysis of High Dimensional Data Sets and 3D Object Recognition. Eurographics Symposium on Point-Based Graphics.
  5. Cohen-Steiner, D., Edelsbrunner, H., & Harer, J. (2007). Stability of Persistence Diagrams. Discrete & Computational Geometry, 37(1), 103–120.