arXiv:2610.06795cs.LGOct 2026

Manuscript Offprint

arXiv:2610.06795

Round-Trip KNN Clustering: multiscale hierarchical cluster detection on directed nearest-neighbour graphs

Eraldo Pereira Marinho, Caetano Mazzoni Ranieri, Fabricio Aparecido Breve

Abstract

We introduce Round-Trip KNN Clustering (RTKNNC), a graph-based method for finding cluster structure at several neighbourhood scales without requiring the number of clusters in advance. Unlike approaches that first make a k-nearest-neighbour (KNN) graph undirected, RTKNNC keeps both directions of the neighbour relation: which points a given point selects and which points select it. Incoming selections are treated as weighted votes that help decide which local connections remain visible during a recursive forward-and-reverse traversal. Repeating the procedure for increasing K reveals how groups persist or merge as the neighbourhood scale grows; for the reference inverse-square model before structural refinement, clusters can merge but do not split. Because graph connectivity can occasionally join distinct groups through a sparse bridge or a small region of overlap, we add an optional label-free refinement. It first tests whether an already formed component is better described by two or three Gaussian subpopulations, and accepts a subdivision only when the proposed groups are large enough and consistent with the visible KNN graph. Across eight synthetic datasets and K=2,…,16K = 2, \ldots, 16, independent C and Python implementations produced identical partitions in all 120 reference runs. Refinement increased adjusted Rand index from 0.7817 to 0.9627 on a variable-density benchmark and from 0.8083 to 0.9853 on a sparse-bridge benchmark. Comparisons with seven external clustering methods show competitive performance while preserving a label-free cluster-construction process.

Keywords: k-nearest-neighbour graph, graph-based clustering, reverse nearest neighbours, round-trip closure, structural refinement, multiscale clustering

1 Introduction

Nearest-neighbour relations provide a simple way to describe local structure in data. They are used in classification, density estimation, graph construction, manifold learning, outlier detection, and clustering [2, 7, 13, 19, 20]. For clustering in particular, local neighbourhood information is attractive because it can reveal non-convex or unevenly populated groups that are poorly described by a centroid or by a single global distance threshold. Existing approaches exploit shared neighbours, mutual or reciprocal KNN graphs, reverse nearest neighbours, and density-based connectivity [3, 6, 10, 14, 16, 29].

A directed KNN graph contains two complementary views of every point. Its outgoing links tell us which points it regards as neighbours; its incoming links tell us which other points regard it as a neighbour. These views are not generally equivalent, and making the graph undirected at the outset discards that asymmetry. RTKNNC is built around keeping it. Each outgoing KNN selection casts a weighted vote, and the votes received by a point provide a local measure of how strongly it is supported by its neighbourhood. This support is then used to determine which nearby links are visible during cluster formation.

For a fixed value of K, the method can be described intuitively as an expansion process. Starting from a seed, RTKNNC follows visible links both forward, to selected neighbours, and backward, to points that selected the current point. Every newly reached point is explored in the same way, and the process stops when no additional points can be added. We call this a round trip, and the final set a saturated round-trip closure. Clusters therefore arise from local graph connectivity rather than from a prescribed geometric shape. The number of clusters is not supplied to the algorithm.

The neighbourhood size K also provides a natural notion of scale. Small values describe very local structure, whereas larger values allow information to propagate over broader neighbourhoods. Running the method independently for increasing K produces a sequence of cluster layers that makes persistent groups and mergers directly visible. In this paper, hierarchical refers to this organisation across neighbourhood scales, not to a conventional linkage-based agglomerative procedure. For the reference inverse-square voting rule, before the optional structural refinement is applied, we show that these layers have a useful merge-only property whenever they are proper partitions: as K increases, a cluster may persist or merge with another one, but it does not split.

Any clustering method based on connectivity faces a familiar difficulty: a small number of links can join groups that are otherwise well separated. A sparse chain of points may act as a bridge, or two populations of different densities may overlap in a narrow region. RTKNNC therefore includes an optional structural-refinement stage that is applied only after a connected component has already been formed. The purpose of this stage is not to replace the round-trip method with a Gaussian-mixture clustering algorithm. Instead, a Gaussian-mixture model is used locally as a test of whether the existing component contains evidence for two or three internal populations. The proposed subdivision is accepted only when the statistical evidence is strong, every resulting group is large enough, and the groups remain coherent in the visible KNN graph. Reference labels are never used to make this decision, and the KNN adjacency lists themselves are not rewritten.

This separation is important. The round-trip graph determines how local evidence propagates and therefore produces the original cluster candidates; the optional refinement is a conservative correction for cases in which connectivity alone has joined distinguishable populations. It also lets us study two questions separately: how vote allocation changes the visible graph, and when a connected component needs an additional structural check.

KNN graphs, shared-neighbour evidence, and reciprocal or reverse-neighbour relations are established ingredients [3, 6, 10, 16, 29]. The contribution of RTKNNC is to combine them into a directed round-trip process whose behaviour can be followed across neighbourhood scales. Recent KNNG-CS work is related in its use of weighted incoming KNN links to define node importance [17]; there, however, the quantity supports greedy coreset selection, whereas RTKNNC uses incoming votes to regulate graph traversal and cluster formation.

The main contributions of this paper are:

  1. a clustering procedure that retains the direction of KNN relations and combines forward and reverse traversal with weighted incoming votes and local visibility;

  2. a multiscale construction in which cluster structure is followed as K changes, together with a proof of merge-only coarsening for the unrefined reference inverse-square model;

  3. a controlled family of vote-allocation rules—uniform, inverse-distance, inverse-square, and sigmoid—that allows their effects to be compared under the same per-source vote budget;

  4. an optional label-free refinement that tests already formed components for supported internal subdivisions and accepts them only after size and graph coherence checks; and

  5. an experimental evaluation covering implementation agreement, vote-model ablations, multiscale behaviour, structural-refinement cases, and comparison with seven external clustering methods.

The remainder of the paper is organised as follows. Section 2 reviews related neighbour- and graph-based clustering approaches. Section 3 introduces the notation needed to describe the directed KNN graph and the round-trip relation. Section 4 presents the voting, visibility, expansion, refinement, and multiscale construction. Section 5 describes the datasets, implementation checks, parameter sweeps, and comparison protocol. Section 6 reports the results, Section 7 discusses the behaviour and limitations of the method, and Section 8 summarises the main findings.

References (29)