Pith. sign in

REVIEW 3 major objections 4 minor 10 references

$k$-means considered harmful: On arbitrary topological changes in Mapper complexes

T0 review · 3 major / 4 minor · reviewed 2026-08-06 · deepseek-v4-flash

Pith's one-line read Fixed-count clustering such as k-means can change the topology of a Mapper complex arbitrarily, making Mapper output unreliable as a description of data shape.

desk verdict Useful practitioner warning about fixed-count clustering in Mapper, but the 'arbitrary distortion' claim is asserted rather than proven. read the letter →

arxiv 2507.06212 v1 pith:CWBHV26D submitted 2025-07-08 cs.CG

classification cs.CG MSC 55N3162H30
keywords Mapperk-meanstopologicaldataanalysisnervelemmafixed-countclusteringcomplexlensfunction
verification ladder T0 review T1 audit T2 compute T3 formal

The pith

A machine-rendered reading of the paper's core claim, the machinery that carries it, and where it could break.

The reading

The paper argues that using clustering algorithms with a fixed, globally chosen number of clusters—most prominently $k$-means—inside the Mapper construction can change the output Mapper complex in arbitrarily large ways, not merely add small noise. The mechanism is that each preimage of a lens function has its own natural number of clusters; a single global $k$ is almost guaranteed to split clusters in some preimages and merge them in others. Splitting can create spurious holes or components, and merging can collapse genuine topological structure, so the final complex no longer describes the shape of the data. This matters because Mapper is widely used to visualize and explore data shape, and many popular Mapper tutorials and libraries currently recommend $k$-means or fixed-count agglomerative clustering. The paper's central recommendation is that fixed-count clustering should be avoided in Mapper, in favor of adaptive methods such as the original largest-gap heuristic.

What carries the argument

The load-bearing object is the refined covering step of the Mapper algorithm: each preimage $L^{-1}Y_i$ is handed to a clustering algorithm, and the clusters become the vertex sets of the nerve complex. What carries the argument is the fixed-count constraint of the clustering method, combined with the nerve lemma, whose assumptions require each cover element to be contractible. The paper's mechanism is the unavoidable over- and under-production of clusters that results when one global $k$ is applied to cover elements with different natural component counts. This mechanism, together with the universality result that Mapper complexes can realize arbitrary complexes, is what turns a routine clustering mismatch into potentially arbitrary topological distortion.

What would settle it

Take a dataset whose ground-truth shape is two parallel strands, choose a lens such that every cover element contains exactly two well-separated components, and run Mapper with $k=2$ on many such datasets; if the resulting complexes remain within a bounded homotopy type of the ground truth even when clusters are forced to be over- or under-produced, the claim that fixed-count clustering produces arbitrary distortion in realistic settings would be weakened.

Watch

Extended reading notes

Core claim

The central claim is that a fixed-count clustering algorithm is structurally incompatible with the Mapper refinement step, because it forces exactly $k$ clusters onto every pullback cover element regardless of how many connected components the data actually has there. Over-production of clusters splits single components and can create holes or extra branches when the pieces reconnect in neighboring cover elements; under-production identifies distinct strands and quotients out real topological features. Building on the earlier observation that breaking nerve-lemma assumptions can produce arbitrary topological changes, and on the recent universality result that any sufficiently small simplicial complex can be realized as a Mapper complex over a large dataset, the paper concludes that the merging and splitting induced by fixed-count clustering can result in arbitrarily large distortions of the Mapper complex. The paper emphasizes that the problem is the mandated global count itself, not uneven point density, so preprocessing or switching to another fixed-count method does not fix it.

Load-bearing premise

The argument assumes the generic over- and under-production of clusters by fixed-count methods actually drives the Mapper complex through the full range of arbitrary topological distortions, rather than only through the limited set observed in the single illustrated example.

Editorial extensions

If this is right

  • Mapper complexes built with $k$-means or fixed-count agglomerative clustering cannot be trusted as descriptions of data shape; conclusions about loops, components, and flares may be clustering artifacts.
  • Choosing a different fixed $k$ does not fix the problem, since the distortion comes from the global mandate rather than the specific value; tuning may move features but not remove the mechanism.
  • Preprocessing the data will not resolve the issue, because the mismatch is between a global parameter and cover-wise natural cluster counts.
  • Adaptive clustering—for example the largest-gap hierarchical heuristic from the original Mapper paper, or per-preimage cluster-count selection via a quality score such as silhouette—avoids the specific failure mode and should be the recommended practice.
  • Open-source Mapper tutorials and documentation that currently suggest KMeans or fixed-count agglomerative clustering should be revised, since following them can silently corrupt downstream analyses.

Reading between the lines

Editorial extensions of the paper, not claims the author makes directly.

  • A natural extension, not stated in the paper: the same mechanism should affect any clustering parameter that is fixed globally, including scale parameters such as a fixed distance threshold, not just a fixed cluster count.
  • One practical diagnostic suggested by the argument: compare the Mapper output from $k$-means against the output of an adaptive clusterer on the same data; large differences concentrated in cover elements where the natural cluster count is far from $k$ would corroborate the mechanism.
  • If the claim is right, Mapper-based discriminative statements that two datasets differ because their Mapper complexes differ become unsafe under fixed-count clustering, since the global $k$ alone could generate the difference.
Share X Bluesky LinkedIn Reddit HN

Editorial analysis

A structured set of objections, weighed in public.

Desk editor's note, referee report, and a circularity audit.

Referee Report

3 major / 4 minor

Summary. The paper argues that using fixed-count clustering algorithms such as k-means in the Mapper construction can arbitrarily distort the topology of the output. It reviews the Mapper algorithm and k-means, documents instances in open-source Mapper tutorials where k-means or fixed-count agglomerative clustering is used, and warns that fixed-count methods over-produce or under-produce clusters in the pullback cover elements, causing spurious holes, mergers, and other topological changes. It then suggests adaptive alternatives such as the largest gap heuristic, silhouette scoring, and DBSCAN. The supporting evidence is a single illustrative example (Figure 1) and appeals to prior results on nerve-lemma failures and universality of Mapper graphs.

Significance. The warning is practically important: if correct, it identifies a class of widely used Mapper implementations (Kepler-Mapper, tda-mapper, and others) that can be misleading, and it points to concrete tutorial code where fixed-count clustering is used. The paper also correctly emphasizes that the problem is the global fixed count itself, not uneven point density, so preprocessing or changing the fixed k cannot solve it. That said, the central claim is currently not derived: the paper asserts that fixed-count clustering is 'all but guaranteed' to cause 'arbitrarily large' topological distortions, but offers only one hand-illustrated example and no theorem or quantitative analysis connecting k-means outputs to the cited universality results.

major comments (3)
  1. [Section 4, paragraph 3] The claim that a fixed-count clustering algorithm is 'all but guaranteed' to over-produce clusters in some cover elements and under-produce clusters in others is asserted without a formal model or evidence. No probability distribution over datasets, lenses, and covers is given, nor is there any argument about how often over/under-production occurs for k-means in realistic settings. As written, this is an informal plausibility statement, not a result.
  2. [Section 4, paragraphs 4-5] The inference from the cited existence theorems to 'arbitrarily large changes' does not follow. Vejdemo-Johansson and Leshchenko (2020) show that breaking nerve-lemma assumptions can produce arbitrary topological changes, and Alvarado et al. (2024) show that any graph is realizable as a Mapper graph, but both are existential results: they do not state that k-means or any fixed-count clustering algorithm realizes those changes. The paper provides no construction or quantitative bound linking k-means outputs to these results. To sustain the word 'arbitrary', the paper would need either a theorem showing that for any target distortion there exists a dataset, lens, cover, and fixed k such that k-means produces that distortion, or a substantial empirical study; neither is present.
  3. [Figure 1] Figure 1 is the only concrete evidence for the central claim, but it lacks the dataset description, the exact construction of the lens and cover, the k-means initialization parameters, and any quantitative measure of topological distortion. It also does not specify how the 'expected output' is defined (e.g., by single-linkage clustering or by connected components). Without these details, the figure is not reproducible and cannot support the strong 'arbitrary' claim.
minor comments (4)
  1. [Section 2] The phrase 'V oronoi cells' has a spacing typo and should read 'Voronoi cells'.
  2. [Section 5] The sentence 'one of the reviewers graciously suggested using the silhouette score' is an unusual meta-comment for a research paper; consider removing or rephrasing it.
  3. [References] The Alvarado et al. reference is an arXiv preprint; please include the arXiv identifier version and, if available, a DOI or publication venue.
  4. [Figure 1 caption] The caption should state explicitly how the bottom-row outputs are generated, including the clustering algorithm used for the 'expected output' and any parameters used for the 2-means and 4-means runs.

Circularity Check

0 steps flagged · score 2.0 of 10

No circular reduction found; the argument rests on external nerve-lemma and mapper-universality theorems, with an under-supported but non-circular inference about k-means.

full rationale

The paper's derivation chain is: (1) failures of the nerve lemma can change Mapper topology arbitrarily (Vejdemo-Johansson and Leshchenko 2020); (2) any graph or sufficiently small complex is realizable as a Mapper output (Alvarado et al. 2024); (3) fixed-count clustering such as k-means is all but guaranteed to over- or under-produce clusters in cover elements; and (4) therefore such clustering choices can produce arbitrarily large topological distortions. Steps (1) and (2) are cited theorems, not fitted data or definitions of the conclusion. Although the first citation shares an author with the present paper, that prior result is about general nerve-lemma obstructions and does not assume k-means or the target claim, so it functions as independent external support rather than a self-citation chain. Step (3) is asserted rather than proven, and Figure 1 is the only illustration; the leap from existence results to 'nearly certainly' for k-means is a logical-evidence gap, not a circularity. No parameter is fitted and then renamed as a prediction, and no quantity is defined in terms of the conclusion. The strongest criticism of the paper is that the 'arbitrary' distortion claim for realistic k-means use is under-argued, which is a correctness or evidentiary concern outside circularity analysis.

Assumptions & free parameters 0 free parameters · 3 assumptions · 0 invented entities

No free parameters are fitted and no new entities are introduced. The paper's argument is entirely an application of two cited results: the nerve lemma critique and the Mapper universality theorem.

assumptions (3)
  • standard math Nerve Lemma (good cover yields correct topology)
    The paper's critique assumes the Nerve Lemma as the reference standard for Mapper output fidelity, citing it in Section 4.
  • domain assumption Alvarado et al. 2024: any graph is realizable as a Mapper graph
    Used in Section 4 to argue that Mapper outputs can, in principle, be arbitrary; the paper extends this to claim k-means can realize such distortions.
  • domain assumption Vejdemo-Johansson and Leshchenko 2020: breaking nerve lemma assumptions can create or remove homology features
    Used as the bridge from bad covers to arbitrary topological changes, cited in Sections 3 and 4.

how reviews work

0 comments
Cite this review

Pith. "Pith review of $k$-means considered harmful: On arbitrary topological changes in Mapper complexes." pith.science (2026). https://pith.science/paper/CWBHV26D

@misc{pith2026250706212,
  author       = {Pith},
  title        = {Pith review of: $k$-means considered harmful: On arbitrary topological changes in Mapper complexes},
  year         = {2026},
  howpublished = {\url{https://pith.science/paper/CWBHV26D}},
  note         = {Machine review of arXiv:2507.06212}
}
read the original abstract

The Mapper construction is one of the most widespread tools from Topological Data Analysis. There is an unfortunate trend as the construction has gained traction to use clustering methods with properties that end up distorting any analysis results from the construction. In this paper we will see a few ways in which widespread choices of clustering algorithms have arbitrarily large distortions of the features visible in the final Mapper complex.

Discussion (0). Continue with ORCID to comment.

Reference graph

Works this paper leans on

10 extracted references · 9 canonical work pages

  1. [1]

    Topological methods for the analysis of high dimensional data sets and 3d object recognition

    Gurjeet Singh, Facundo M \'e moli, Gunnar E Carlsson, et al. Topological methods for the analysis of high dimensional data sets and 3d object recognition. PBG@ Eurographics, 2: 0 091--100, 2007

  2. [2]

    Extracting insights from the shape of complex data using topology

    Pek Y Lum, Gurjeet Singh, Alan Lehman, Tigran Ishkanov, Mikael Vejdemo-Johansson, Muthu Alagappan, John Carlsson, and Gunnar Carlsson. Extracting insights from the shape of complex data using topology. Scientific reports, 3 0 (1): 0 1236, 2013

  3. [3]

    Python mapper: An open-source toolchain for data exploration, analysis and visualization

    Daniel Müllner and Aravindakshan Babu. Python mapper: An open-source toolchain for data exploration, analysis and visualization. http://danifold.net/mapper, 2013

  4. [4]

    Hendrik Jacob van Veen, Nathaniel Saul, David Eargle, and Sam W. Mangham. Kepler mapper: A flexible python implementation of the mapper algorithm. Journal of Open Source Software, 4 0 (42): 0 1315, 2019. doi:10.21105/joss.01315. URL https://doi.org/10.21105/joss.01315

  5. [5]

    giotto-tda: A topological data analysis toolkit for machine learning and data exploration, 2020

    Guillaume Tauzin, Umberto Lupo, Lewis Tunstall, Julian Burella Pérez, Matteo Caorsi, Anibal Medina-Mardones, Alberto Dassatti, and Kathryn Hess. giotto-tda: A topological data analysis toolkit for machine learning and data exploration, 2020

  6. [6]

    tda-mapper, November 2024

    Luca Simi. tda-mapper, November 2024. URL https://doi.org/10.5281/zenodo.14194667

  7. [7]

    Certified mapper: Repeated testing for acyclicity and obstructions to the nerve lemma

    Mikael Vejdemo-Johansson and Alisa Leshchenko. Certified mapper: Repeated testing for acyclicity and obstructions to the nerve lemma. In Topological Data Analysis: The Abel Symposium 2018, pages 491--515. Springer, 2020

  8. [8]

    Any graph is a mapper graph, 2024

    Enrique G Alvarado, Robin Belton, Kang-Ju Lee, Sourabh Palande, Sarah Percival, Emilie Purvine, and Sarah Tymochko. Any graph is a mapper graph, 2024. URL https://arxiv.org/abs/2408.11180

Show all 10 references
  1. [9]

    Silhouettes: a graphical aid to the interpretation and validation of cluster analysis

    Peter J Rousseeuw. Silhouettes: a graphical aid to the interpretation and validation of cluster analysis. Journal of computational and applied mathematics, 20: 0 53--65, 1987

  2. [10]

    An efficient density based clustering algorithm for large databases

    Yasser El-Sonbaty, Mohamed A Ismail, and Mohamed Farouk. An efficient density based clustering algorithm for large databases. In 16th IEEE international conference on tools with artificial intelligence, pages 673--677. IEEE, 2004

Pith tools

Reviewed August 6, 2026 · model on record in the stance chip above.