Proximity Alert: Ipelets for Neighborhood Graphs and Clustering
Abstract
Neighborhood graphs and clustering algorithms are fundamental structures in both computational geometry and data analysis. Visualizing them can help build insight into their behavior and properties. The Ipe extensible drawing editor, developed by Otfried Cheong, is a widely used software system for generating figures. One particular aspect of Ipe is the ability to add Ipelets, which extend its functionality. Here we showcase a set of Ipelets designed to help visualize neighborhood graphs and clustering algorithms. These include: -neighbor graphs, furthest-neighbor graphs, Gabriel graphs, -nearest neighbor graphs, -nearest neighbor graphs, -mutual neighbor graphs, -mutual neighbor graphs, asymmetric -nearest neighbor graphs, asymmetric -nearest neighbor graphs, relative-neighbor graphs, sphere-of-influence graphs, Urquhart graphs, Yao graphs, and clustering algorithms including complete-linkage, DBSCAN, HDBSCAN, -means, -means++, -medoids, mean shift, and single-linkage. Our Ipelets are all programmed in Lua and are freely available.
Keywords and phrases:
neighborhood graphs, clustering, proximity graphs, Ipelets, visualizationCategory:
Media ExpositionCopyright and License:
Arushi Srinivasan, Yixuan Sun, Vahe Zaprosyan, and David M. Mount; licensed under Creative Commons License CC-BY 4.0
2012 ACM Subject Classification:
Theory of computation Computational geometryEditors:
Hee-Kap Ahn, Michael Hoffmann, and Amir NayyeriSeries and Publisher:
Leibniz International Proceedings in Informatics, Schloss Dagstuhl – Leibniz-Zentrum für Informatik
1 Introduction
We present a set of Ipelets for visualizing clustering and neighborhood graph algorithms on point sets in . These Ipelets include: -neighbor graphs, furthest-neighbor graphs, Gabriel graphs, -nearest neighbor graphs, -nearest neighbor graphs, -mutual neighbor graphs, -mutual neighbor graphs, asymmetric -nearest neighbor graphs, asymmetric -nearest neighbor graphs, relative-neighbor graphs, sphere-of-influence graphs, Urquhart graphs, Yao graphs, and clustering algorithms including complete-linkage, DBSCAN, HDBSCAN, -means, -means++, -medoids, mean shift, and single-linkage. Some of these are also implemented in CGAL [9]. All our Ipelets are programmed in Lua and are freely available on GitHub. To install any Ipelet, download the file from the GitHub repository, and place it in the ipelets sub-folder of your Ipe folder. This work builds on previous ipelets to add functionality in various contexts [14, 4, 12, 8]. Our contribution is in line with that of several other researchers who have worked on neighborhoods of point sets, such as Voronoi diagrams and Delaunay triangulations [14, 4], and -skeletons [11]. Ipelets can be invoked from the “Ipelets” menu, see Figure 1 for usage instructions.
2 Neighborhood graphs
In this section, we describe the neighborhood graphs our Ipelets compute on point sets. We loosely separate them by type and briefly describe our contributions.
2.1 Nearest-neighbor variants
Nearest neighborhood graphs are fundamental tools in data analysis on a point set . A point is connected to when one is the nearest neighbor of the other. The -nearest neighbor graph connects to when is among the nearest neighbors of ; the -nearest neighbor graph connects to when is the nearest neighbor of ; mutual nearest neighbor graphs connect to when each is the other’s nearest neighbor; the -mutual neighbor graph connects to when each is among the other’s nearest neighbors; the -mutual neighbor graph connects to when each is exactly the other’s nearest neighbor; asymmetric nearest neighbor graphs connect to when exactly one is the other’s nearest neighbor; asymmetric -nearest neighbor graphs connect to when exactly one has the other among their nearest neighbors; asymmetric -nearest neighbor graphs connect to when exactly one has the other as their nearest neighbor; and furthest neighbor graphs connect to when is ’s furthest neighbor. See illustration in Figure 2.
2.2 Proximity graphs
A proximity graph is a graph in which points are connected when a region-based condition is satisfied, often in the context of network analysis. The Gabriel graph connects two points and when the disk defined by the diameter of and contains no other points [10]. A relative neighborhood graph connects two points and exactly when no point is closer to both and than they are to each other, or equivalently, no point is in the lune of and (intersection of the ball at with on its boundary and the ball at with on its boundary) [15]. A sphere of influence graph assigns to each point a disk with radius given as the distance to its nearest neighbor and connects points when their disks overlap [16]. An -graph connects pairs of points if they lie within of each other. A Urquhart graph is the Delaunay triangulation with the longest edge of each triangle removed [17]. A Yao graph divides the plane into sectors by angle around points, and points are connected to their closest neighbor per sector [18]. See visuals in Figure 3.
3 Clustering
In this section, we describe the clustering algorithms we implemented for point sets. As before, we loosely separate them by type and briefly describe our contributions.
3.1 Centroid-based
Centroid-based clustering partitions a point set in space into clusters using a centroid-based method. The -Means clustering partitions points into clusters, assigning points to its nearest centroid and recomputing the centroids iteratively until it is stable. The -Means++ variant is similar, except it chooses initial centroids that are likely to be far apart to improve convergence. Unlike -means, -Medoids clustering uses preexisting points in the data as the centroids of the cluster [13]. Each iteration, a point replaces the medoid if it decreases the total intra-cluster distance. Illustrations of the methods can be seen in Figure 4.
3.2 Hierarchical
Hierarchical clustering methods work by treating each point as a cluster and iteratively merging clusters until only a specified number remain. Single-linkage clustering defines the cluster distance between clusters as the minimum pairwise distance between their points, while complete-linkage clustering uses the maximum [7]. See Figure 5.
3.3 Density-based
Density-based clustering partitions a point set into clusters based on how densely points are packed. DBSCAN groups points that are within a specified distance, , of each other and have a minimum number of neighboring points (MinPts). Points meeting these criteria form clusters (distinguished by colors), while points that don’t are labeled as noise [6]. HDBSCAN, on the other hand, applies a hierarchical approach to density-based clustering [3]. It builds a mutual reachability graph and a minimum spanning tree to identify clusters at varying densities. Instead of relying on a fixed distance threshold like DBSCAN, HDBSCAN evaluates the stability of clusters across different scales. It then uses the Excess of Mass method to select stable clusters. Mean shift computes where each point would converge if moved towards the mean of its neighbors within the given bandwidth radius. Points whose trajectories converge on the same location form a cluster [5]. See Figure 6.
4 Conclusion
In this paper, we presented a collection of Ipelets for visualizing neighborhood graphs and clustering algorithms on point sets in . These tools are designed to assist in the understanding of these structures and their properties, and we hope they will be useful to researchers, educators, and artists alike. All Ipelets are freely available on GitHub.
References
- [1] Gitan Balogh, June Cagan, Bea Fatima, Auguste H. Gezalyan, Danesh Sivakumar, Arushi Srinivasan, Yixuan Sun, Vahe Zaprosyan, and David M. Mount. Proximity Alert: Ipelets for Neighborhood Graphs and Clustering. Software (visited on 2026-05-12). URL: https://github.com/Otcavo/Ipelets-Full-Library, doi:10.4230/artifacts.25979.
- [2] Gitan Balogh, June Cagan, Bea Fatima, Auguste H. Gezalyan, Danesh Sivakumar, Arushi Srinivasan, Yixuan Sun, Vahe Zaprosyan, and David M. Mount. Proximity Alert: Ipelets for Neighborhood Graphs and Clustering. Audiovisual (visited on 2026-05-12). URL: https://youtu.be/NQr-SY1x2qc, doi:10.4230/artifacts.25983.
- [3] Ricardo J. G. B. Campello, Davoud Moulavi, and Jörg Sander. Density-based clustering based on hierarchical density estimates. In Advances in Knowledge Discovery and Data Mining, pages 160–172. Springer, 2013. doi:10.1007/978-3-642-37456-2_14.
- [4] Otfried Cheong. The IPE extensible drawing editor. Version 7.2.28, 2024-03-12. URL: https://ipe.otfried.org/.
- [5] Dorin Comaniciu and Peter Meer. Mean shift: A robust approach toward feature space analysis. IEEE Transactions on Pattern Analysis and Machine Intelligence, 24(5):603–619, 2002. doi:10.1109/34.1000236.
- [6] Martin Ester, Hans-Peter Kriegel, Jörg Sander, and Xiaowei Xu. A density-based algorithm for discovering clusters in large spatial databases with noise. In Proceedings of the 2nd International Conference on Knowledge Discovery and Data Mining (KDD), pages 226–231, 1996. URL: http://www.aaai.org/Library/KDD/1996/kdd96-037.php.
- [7] Brian S. Everitt, Sabine Landau, Morven Leese, and Daniel Stahl. Cluster Analysis. Wiley, 5th edition, 2011. doi:10.1002/9780470977811.
- [8] Klint Faber, Auguste H. Gezalyan, Adam Martinson, Aniruddh Mutnuru, Nithin Parepally, Ryan Parker, Mihil Sreenilayam, Aram Zaprosyan, and David M. Mount. French onion soup, ipelets for points and polygons (media exposition). In 41st International Symposium on Computational Geometry (SoCG 2025), pages 83:1–83:6. Schloss Dagstuhl – Leibniz-Zentrum für Informatik, 2025. doi:10.4230/LIPIcs.SoCG.2025.83.
- [9] Andreas Fabri and Sylvain Pion. CGAL: The computational geometry algorithms library. In Proceedings of the 17th ACM SIGSPATIAL international conference on advances in geographic information systems, pages 538–539, 2009. doi:10.1145/1653771.1653865.
- [10] K. Ruben Gabriel and Robert R. Sokal. A new statistical approach to geographic variation analysis. Systematic Zoology, 18(3):259–278, 1969. doi:10.2307/2412323.
- [11] David G. Kirkpatrick and John D. Radke. A framework for computational morphology. In G. T. Toussaint, editor, Computational Geometry, pages 217–248. North-Holland, 1985. doi:10.1016/B978-0-444-87806-9.50013-X.
- [12] Nithin Parepally, Ainesh Chatterjee, Auguste H. Gezalyan, Hongyang Du, Sukrit Mangla, Kenny Wu, Sarah Hwang, and David M. Mount. Ipelets for the convex polygonal geometry (media exposition). In 40th International Symposium on Computational Geometry (SoCG 2024), pages 92:1–92:7, 2024. doi:10.4230/LIPIcs.SoCG.2024.92.
- [13] Hae-Sang Park and Chi-Hyuck Jun. A simple and fast algorithm for K-medoids clustering. Expert Systems with Applications, 36(2):3336–3341, 2009. doi:10.1016/j.eswa.2008.01.039.
- [14] postechDNN. Ipelet. https://github.com/postechDNN/postechDNN/commits/ipelet/dnn/IPELET, 2022. (Commit hash: de82a8d).
- [15] Godfried T. Toussaint. The relative neighbourhood graph of a finite planar set. Pattern Recognition, 12(4):261–268, 1980. doi:10.1016/0031-3203(80)90066-7.
- [16] Godfried T. Toussaint. A graph-theoretical primal sketch. Computational Morphology, pages 229–260, 1988.
- [17] RB Urquhart. Algorithms for computation of relative neighbourhood graph. Electronics Letters, 16(14):556–557, 1980.
- [18] Andrew Chi-Chih Yao. On constructing minimum spanning trees in -dimensional spaces and related problems. SIAM Journal on Computing, 11(4):721–736, 1982. doi:10.1137/0211059.
