arXiv:2610.28759cs.DCOct 2026

Manuscript Offprint

arXiv:2610.28759

GPU-Accelerated Construction of the Gabriel Graph: Parallelization Strategies and Applications to Large-Margin Classification and Graph-Based Clustering

Diego Sanches Nere dos Santos, Luiz Carlos Bambirra Torres

Abstract

The Gabriel graph is a proximity graph widely used in computational geometry and geometric machine learning, underlying large-margin classifiers and, as we show in this work, density-aware clustering methods. Its construction, however, has cubic time complexity O(N3)O(N^{3}) in the naive formulation, which severely limits its use on datasets beyond a few thousand samples. This paper presents a set of GPU parallelization strategies, implemented in CUDA, that make Gabriel graph construction practical at scale. We introduce (i) an implicit closed-form mapping from a linear thread index to the corresponding vertex pair (i,j)(i,j), which removes the need for an explicit O(N2)O(N^{2}) adjacency structure and lets every thread locate its pair in constant time and constant memory; (ii) a two-pass, bitmask-based, atomically-compacted edge-list construction that produces a dense edge array proportional only to the number of edges actually found; and (iii) a thread-coarsening strategy in which each thread evaluates several candidate pairs, trading launch and scheduling overhead against load balance. We evaluate these strategies on the acceleration of a Gabriel-graph-based large-margin classifier (NN-clas) and on a novel Gabriel-graph clustering algorithm that identifies connected components on a residual graph and performs GPU-parallel Union-Find with hierarchical edge-based merging. On 14 public benchmark datasets, the GPU implementation reduces Gabriel graph construction time by two to nearly four orders of magnitude relative to a sequential CPU baseline (up to 8484×8484\times), without loss of classification accuracy, and the proposed clustering method is statistically competitive with DBSCAN on the topological validity index Dunn while eliminating the need for an explicit density radius parameter.

Keywords: Gabriel graph, GPU, CUDA, parallel computing, proximity graphs, large-margin classification, clustering, computational geometry.

1 Introduction

Proximity graphs occupy a central role in geometric approaches to machine learning: they turn a set of feature vectors into a combinatorial structure whose edges encode a notion of “closeness” that can be exploited for classification, clustering, dimensionality reduction, or anomaly detection. Among proximity graphs, the Gabriel graph, introduced by Gabriel and Sokal (1969) in the context of geographic variation analysis, is particularly attractive because it depends on nothing but pairwise Euclidean distances, requires no free parameters (unlike k-nearest-neighbor or ε\varepsilon-radius graphs), and is a subgraph of the Delaunay triangulation, which guarantees several useful connectivity and locality properties (Matula and Sokal, 1980).

A vertex pair (xi,xj)(x_i, x_j) is connected by an edge in the Gabriel graph if and only if the open hypersphere having the segment xixj‾\overline{x_i x_j} as diameter contains no other point of the dataset. This purely geometric criterion has made the Gabriel graph a popular structural backbone for large-margin classifiers (Garcia et al., 2015; Arias-Garcia et al., 2024; Hanriot et al., 2024), where edges connecting samples of different classes – the support edges – approximate the decision margin between classes without solving any optimization problem.

The price of this elegance is computational: verifying the empty-hypersphere condition for every candidate pair against every other point costs O(N3)O(N^{3}) in the number of samples N, since there are O(N2)O(N^{2}) candidate pairs and each check is itself O(N)O(N). This cost quickly becomes the dominant bottleneck of any Gabriel-graph-based pipeline once N grows into the thousands, which is precisely the regime in which real-time or large-scale applications – medical diagnosis, network intrusion detection, industrial monitoring – would most benefit from these classifiers.

Because the empty-hypersphere test for a pair (i,j)(i,j) is completely independent of the test for any other pair (k,l)(k,l), Gabriel graph construction is an embarrassingly parallel problem, and is therefore a natural candidate for acceleration on Graphics Processing Units (GPUs), whose Single-Instruction-Multiple-Threads (SIMT) architecture is designed precisely to exploit this kind of massive, independent, data-parallel work (Owens et al., 2008; Nickolls et al., 2008).

Contributions. This paper isolates and details the GPU parallelization of Gabriel graph construction – the computational core shared by every Gabriel-graph-based algorithm – and studies it as a problem in its own right. Concretely, we contribute:

  1. A closed-form, O(1)O(1)-time and O(1)O(1)-memory mapping from a one-dimensional CUDA thread index k to the pair of vertex indices (i,j)(i,j) that it must evaluate, which avoids materializing an O(N2)O(N^{2}) index table (Section 4);

  2. A two-pass, bitmask-based edge construction scheme that uses atomic operations to compact the sparse set of valid Gabriel edges into a dense array proportional to the true edge count, keeping GPU memory usage close to O(∣E∣)O(|E|) rather than O(N2)O(N^2) (Section 4.3);

  3. An empirical study of thread coarsening – assigning multiple candidate pairs to each thread – showing that the best coarsening factor is dataset-dependent: it reduces execution time on one dataset but not on another (Section 4.4);

  4. Two downstream applications that validate the approach: an accelerated re-implementation of the NN-clas large-margin classifier (Arias-Garcia et al., 2024), and a new GPU-native clustering algorithm that uses connected components of a distance-filtered Gabriel graph, with an automatic elbow-based cut and a GPU parallel Union-Find with hierarchical merging (Section 5);

  5. An experimental evaluation on 14 public datasets (synthetic and real), reporting speedups of up to 8484×8484\times over a sequential CPU baseline and a statistical comparison of the resulting clustering quality against K-means and DBSCAN (Section 6).

The remainder of the paper is organized as follows. Section 2 reviews related work. Section 3 introduces the Gabriel graph and the relevant CUDA/SIMT background. Section 4 presents the parallelization strategies in detail. Section 5 describes the two applications used to validate the approach. Section 6 reports the experimental results, Section 7 discusses limitations, and Section 8 concludes with directions for future work.