# Clustering of Road Traffic Accidents as a Gestalt Problem
## 2 Related Work and Main Idea  
The research question of traffic accident clustering has been devoted significant research attention [3; 4; 5; 6]. For a more comprehensive overview, the reader may consult [3; 7; 8]. Here, we reflect on selected methodological aspects and emphasize the main idea of this particular study. Some of the widely applied clustering algorithms (e.g., k-means type algorithms [9; 10]) take the number of clusters as an input parameter (cf. also [11]). In practice, the observed data are clustered repetitively by varying the input number of clusters; then, the optimal number of clusters is selected with respect to some criterion. One  
Figure 1: The map of road traffic accidents with injuries or death that occurred in “inner” Belgrade over the one-year period from January 2021 to December 2021. The map was generated using the ArcMap component of the Esri’s ArcGIS suite ([[https://www.esri.com](https://www.esri.com)]([https://www.esri.com](https://www.esri.com))). of such criteria is based on the pooled within-cluster sum of squares around the cluster means [12]:  
\[WOSS(t)=\sum_{i=1}^{t}\left(\frac{1}{2n_{i}}\sum_{j,k\in C_{i}}d_{jk}\right)\,, \tag{1}\]  
where \(t\) is the number of clusters, \(C_{i}\) is the \(i\)th cluster, \(n_{i}\) is the number of observations assigned to cluster \(C_{i}\), and \(d_{jk}\) is the pairwise distance between observations \(j\) and \(k\). A plot of the within-cluster dispersion versus the applied number of clusters typically contains an elbow that indicates the optimal number of clusters [12]. An alternative method to determine the optimal number of clusters is described in [13]. In general, the requirement that the number of clusters should be given a priori represents a limitation. In addition, the k-means algorithm considers the entire dataset and generates spherical shape clusters that are not necessarily suitable to represent traffic-accident-prone areas [8]. To address these limitations, the density-based DBSCAN algorithm [14] is aimed at eliminating noise from data and allowing for clusters of arbitrary shapes. Instead of an a priori given number of clusters, this algorithm accepts two different parameters: the maximum neighborhood radius and the minimum number of points required to form a dense region. The OPTICS algorithm [15] is an extension of the DBSCAN algorithm that produces a density-based clustering structure of a dataset. It is shown in [8] that the density-based clustering algorithms perform better than the k-means algorithm in the context of traffic-accident analysis. Similarly to them, the algorithm introduced in this paper allows for clusters of arbitrary shapes and does not require that the number of clusters is given in advance. The proposed clustering approach is not density-based, but inspired by the Gestalt principle of proximity [16]. According to this principle, when humans are confronted with a number of the same visual stimuli (e.g., points on a two-dimensional plane), the most natural form of grouping involves the smallest interval. For example, for the set of points given in Figure 2i, the most natural arrangement would be abc/def/ghi, while for the set in Figure 2 ii the natural grouping would be adg/beh/cfi. It is important to note that the natural grouping is by no means impeded by increasing the number of points [16]. We build on the Gestalt principle of proximity and introduce a novel approach to automatic spatial clustering of road traffic accidents. At the level of specification, our study aims at detecting road segments of spatially prolonged and high traffic accident risk. A road segment is considered to be of spatially prolonged risk if it is related to a nonempty set \(N\) of traffic accident locations, which can be considered close to each other by means of transitive closure.