arXiv:2611.25114cs.LGNov 2026

Manuscript Offprint

arXiv:2611.25114

Fast and Memory-Light Evaluation of Density-Based Clusterings with the DISCO Index in R

Amin Entezari

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

DISCO is a recent internal cluster validity index for density-based clustering that, unlike earlier indices, also evaluates the quality of noise labels. The discoCVI package makes DISCO available in R. This article describes the design of the package and a typical workflow, in which DISCO is used to compare clusterings and to choose the parameters of HDBSCAN without ground truth, followed by the implementation introduced in version 0.2.0. DISCO is defined through density-connectivity distances between all pairs of points, so direct implementations store several n-by-n matrices. We show that every quantity DISCO needs can be read off the single-linkage merge tree of the mutual-reachability minimum spanning tree, so that the index can be computed exactly with memory that grows linearly with the number of points, while the running time remains quadratic as in the original definition. The implementation is tested against the previous version, agrees with the original Python implementation to within 3×10−133\times 10^{-13}, and corrects the score of singleton clusters to match the published definition. In benchmarks, discoCVI is 23 to 138 times faster than its previous version for 500 to 4,000 points and 3 to 9 times faster than the Python reference for 500 to 8,000 points, using a fraction of the memory of both, and it scores 100,000 points in about 50 seconds with less than 200 MB of memory.

1 Introduction

Clustering without ground truth needs internal cluster validity indices (CVIs), which score a partition using only the data and the labels. They are used to compare the output of different algorithms and, above all, to choose the parameters of a clustering algorithm when no labelled data exist. For density-based algorithms such as DBSCAN (Ester et al., 1996) and HDBSCAN (Campello et al., 2013), which find clusters of arbitrary shape and label low-density points as noise, classical indices such as the silhouette coefficient (Rousseeuw, 1987) are a poor fit: they favour convex clusters and have no notion of noise. Density-based indices such as DBCV (Moulavi et al., 2014) address the first problem, and the recent DISCO index (Beer et al., 2026) also addresses the second: it scores every point labelled as noise according to whether it really lies in a sparse region far from all clusters.

Existing software. Several CRAN packages provide internal validity indices: cluster computes the silhouette coefficient, clusterCrit and fpc offer a wide range of classical indices (fpc also implements the density-based index CDbw), and DBCVindex implements DBCV (Chicco et al., 2025). None of them evaluates noise labels. The original DISCO implementation is written in Python and is not distributed as a package. discoCVI (Entezari, 2026) makes DISCO available in R; its first release translated the reference implementation line by line.

The gap. DISCO is defined through the density-connectivity distance (dc-distance) (Beer et al., 2023) between every pair of points. Both the reference implementation and discoCVI 0.1.1 therefore build the full matrices of mutual-reachability distances and dc-distances. Time and memory grow quadratically with the number of points nn: version 0.1.1 needs about 19 seconds and 1.2 GB to score 4,000 points, and a few thousand points more exhaust a laptop. Because an index is usually evaluated for many candidate clusterings, this cost is multiplied by the size of the search, which matters for running time and also for the energy use of the analysis (Strubell et al., 2019; Schwartz et al., 2020; Lannelongue et al., 2021).

This article. We describe the design of discoCVI and a typical workflow, and then the implementation introduced in version 0.2.0, which computes DISCO exactly without any n×nn\times n matrix. We show that this is possible because the dc-distance between two points equals the height at which they are merged in the single-linkage tree of the mutual-reachability graph, so that all per-cluster sums and minima of dc-distances can be accumulated in one pass over that tree. We report tests against the previous version and against the original Python implementation, and a benchmark of time, memory and energy.