cs.LGJan 9, 2026

A Fast and Effective Method for Euclidean Anticlustering: The Assignment-Based-Anticlustering Algorithm

Authors: Philipp BaumannOlivier GoldschmidtDorit S. HochbaumJason Yang

Organizations: Department of Business Administration, University of Bern, Engehaldenstr. 4, 3012 Bern, Switzerland · Riverside County Office of Education, Riverside, CA 92501, USA · Industrial Engineering and Operations Research Department, University of California, Berkeley, CA 94720, USA

Abstract

Anticlustering is an NP-hard combinatorial optimization problem that consists of partitioning a set of objects into equal-sized groups called anticlusters such that the objects in the same anticluster are as dissimilar as possible and thereby representative of the entire set of objects. Here we study the case where the dissimilarity metric is the squared Euclidean distance between the respective feature vectors. Applications of Euclidean anticlustering include social studies, cross-validation, creating mini-batches for stochastic gradient descent, and finding balanced K-cut partitions. In particular, machine-learning applications such as mini-batch generation involve million-scale datasets and very large values of K, making scalable anticlustering algorithms essential. We propose a new algorithm, the Assignment-Based Anticlustering (ABA) algorithm, that scales to instances with millions of objects and hundreds of thousands of anticlusters within seconds to minutes, which is far beyond what existing anticlustering methods can manage. We demonstrate here, via an extensive computational study, that our algorithm outperforms existing anticlustering methods in both solution quality and running time. This is so also for anticlustering with categories. For the related problem of balanced K-cut partitioning, our algorithm is superior to the well-known METIS method. The code of our algorithm is available on GitHub.

Explore similar work

Jul 2, 2026cs.DS

Scalable and Distributed Silhouette Approximation

The silhouette is one of the most widely used measures to assess the quality of a kk-clustering of a dataset of nn elements. Its evaluation requires no information beyond the clustering assignment. In addition, the silhouette is extremely easy to interpret, providing a score to measure the quality of a clustering as a whole or for each element. The exact computation of the: (i) silhouette of each element of a dataset; and (ii) the global silhouette of the clustering; require Θ(n2)Θ(n^2) distance calculations, under general metrics. The quadratic complexity Θ(n2)Θ(n^2) is extremely prohibitive, especially on massive modern datasets. Surprisingly, existing approximate methods using O(n2)O(n^2) distance calculations are heuristics not offering provable and controllable guarantees on the quality of their results. We introduce the first rigorous and efficient algorithms to estimate: (i) the (local) silhouette of each element of a dataset; and (ii) the (global) silhouette; of any metric kk-clustering. Our methods, based on sampling, perform O(nkε2ln(nk/δ))O(nk\varepsilon^{-2}\ln (nk/δ)) distance computations, and provide estimates with additive error O(ε)O(\varepsilon) with probability at least 1δ1-δ. That is, parameters ε\varepsilon and δδ in (0,1)(0,1) control the trade-off between accuracy and efficiency. We also introduce a scalable and distributed design of our methods for the MapReduce and Massively Parallel Computing (MPC) frameworks. Our distributed algorithms use a constant number of rounds and sublinear local memory. Finally, we perform extensive experiments against state-of-the-art approaches. The results show that our new techniques yield the best trade-off between accuracy and efficiency for both local and global silhouette estimation. In addition, our methods scale efficiently to massive datasets for which an exact computation of the silhouette is not practical.
Ilie Sarpe, Federico Altieri, Andrea Pietracaprina +2
May 13, 2026cs.LG

Fast and effective algorithms for fair clustering at scale

Clustering is an unsupervised machine learning task that consists of identifying groups of similar objects. It has numerous applications and is increasingly used in fairness-sensitive domains where objects represent individuals, such as customers, employees, or students. We address a fair clustering problem in which objects belong to protected groups. The problem consists of partitioning the objects into a predefined number of clusters while attaining a user-defined target level of fairness, meaning that each protected group is sufficiently represented in each cluster. The objective is to minimize the clustering cost, defined as the sum of squared Euclidean distances between the objects and the centers of their clusters. Since clustering cost and fairness are generally in conflict, managing the trade-off between them is essential in practical applications. Existing methods provide limited control over this trade-off and either fail to scale to large datasets or, when they scale, produce low-quality solutions. We propose a general framework for fair clustering that provides precise control over the cost-fairness trade-off and introduce three heuristics based on it. The first heuristic focuses on solution quality and the flexibility to incorporate additional constraints, the second improves scalability while retaining high solution quality, and the third is designed for maximum scalability, producing solutions for instances with millions of objects in seconds. The proposed heuristics outperform existing approaches in comprehensive numerical experiments on benchmark datasets. The source code of our heuristics and instructions for reproducing the experiments are publicly available on GitHub.
Claudio Mantuano, Manuel Kammermann, Philipp Baumann
Jun 10, 2022cs.LG

Anisotropic View Distance Metric for High-Dimensional Data: Theory, Geometry, and Fast Computation

K-Means clustering algorithm is one of the most commonly used clustering algorithms because of its simplicity and efficiency. K-Means clustering algorithm based on Euclidean distance only pays attention to the linear distance between Euclidean distance is an efficient and interpretable similarity measurement, but its effectiveness may deteriorate in sample spaces with anisotropic structures, redundant features, or complex feature interactions. In this paper, we propose a novel distance metric called View distance. Inspired by orthographic projection, the proposed metric projects the sample space onto n(n1)/2n(n-1)/2 two-dimensional planes and defines the final distance as the sum of the Euclidean distances across the projected planes. Theoretical derivations verify that the View distance strictly satisfies the metric axioms and norm constraints. Beyond that, the View distance achieves feature coupling through projection and not only enables constant features to indirectly participate in distance calculation, but also suppresses interference from redundant features while exhibiting anisotropic geometric properties. Furthermore, to address the high computational complexity and poor scalability of full-projection View distance, we propose a two-dimensional projection plane selection strategy based on iterative Maximum Weight Matching, which reduces the computational complexity of distance calculation from O(n2)\mathcal{O}(n^2) to O(k)\mathcal{O}(k). Extensive experiments on 12 diverse datasets demonstrate that View distance and the deterministic selection strategy provide competitive or superior performance compared with Euclidean distance and other LpL_{p} metrics while maintaining strong interpretability and computational efficiency. The View distance provides a new perspective and option for similarity measurements.
Yiqun Zhang, Hou-biao Li