# A GNSS/5G Integrated Three-Dimensional Positioning Scheme Based on D2D Communication
## 2 Methods
### GNSS/5G Integrated Three-Dimensional Positioning Scheme
#### 2.3.1 GNSS/5G Integrated Three-Dimensional Positioning Based on DBSCAN  
Firstly, we describe DBSCAN briefly. Then, the GNSS/5G integrated three-dimensional positioning algorithm exploiting the joint TOA/RSS method is proposed. * DBSCAN  
Clustering classifies the data set into different groups according to a standard of association. As a result, the data points in the same cluster are similar, while the data points in different clusters are not. The input of the clustering is a sample data set and a standard of similarity between two points, and the output is some partitions of the sample data set without intersection [32]. DBSCAN is a density-based clustering, which assumes that the clusters can be determined by the density of the data set [33]. To be specific, the clusters are the collections of data points with high density separated by the regions of low data point density. That is, the density of the data points within a cluster is considerably higher than those outside of the cluster. We denoted \((\varepsilon,MinPts)\) as the neighborhood parameters to depict the closeness of the data point distribution, which reflects the size of the neighborhood and the minimum data points in a cluster, respectively. Here, for an arbitrary data point \(dp_{i}\), \(\varepsilon-neighborhood\) is defined as:  
\[N_{\varepsilon}(dp_{i})=\big{\{}dp_{i}\in Data\big{|}dist\big{(}dp_{i},dp_{j} \big{)}\,\leq\varepsilon\big{\}} \tag{13}\]  
where \(Data=(dp_{1},dp_{2},\cdots,dp_{n})\) is the data set, and \(dist(\cdot)\) represents the distance between two data points. \(N_{\varepsilon}(dp_{i})\) denotes the data points at a distance from \(dp_{i}\) shorter than \(\varepsilon\). If the \(\varepsilon-neighborhood\) of data point \(dp_{i}\) exceeds \(MinPts\), i.e., \(|N_{\varepsilon}(dp_{i})|\geq MinPts\), \(dp_{i}\) is called a _core object_. According to [34], some definitions can be given intuitively in Figure 3. The yellow dashed lines and the blue solid points represent the \(\varepsilon-neighborhood\) and the data points, respectively. Assume that \(dp_{3}\) is a core object, and then, \(dp_{2}\) and \(dp_{1}\) are directly density-reachable and density-reachable from \(dp_{3}\), respectively, as shown in Figure 3. In addition, \(dp_{1}\) and \(dp_{6}\) are density-connected. The key idea of DBSCAN is that, for a given size of neighborhood \(\varepsilon\), each formed cluster contains as many as density-connected data points, the amount of which is at least \(MinPts\)[32]. * GNSS/5G Integrated Three-Dimensional Positioning Algorithm Based on DBSCAN  
At first, we exploit the GNSS measurements to calculate the initial positions for the requesting nodes. As we all know, the GNSS positioning is in the accuracy of several meters in the kinematic situation. In addition, the cooperative nodes only know their inaccurate positions. In other words, the known position of each MU in the network is not accurate. However, more accurate positions of the cooperative nodes further used in the following algorithm can improve the position accuracy of the requesting nodes. Hence, we also take into account the prior information of the cooperative nodes in the clustering process to obtain more accurate positions of them, i.e., the cooperative nodes are also regarded as the requesting nodes, and then, the BSs and other MUs are seen as the reference nodes. According to this, the positions of the requesting nodes and the cooperative nodes, i.e., the positions of the MUs, are all in need of revision in the DBSCAN algorithm. For each MU, there are \(M\) BSs and \(N-1\) other MUs potential for positioning. Actually, not all of these potential nodes can finally be the reference nodes. According to the analysis in Section 2.2, the distance between the reference nodes and the requesting node should be short enough to guarantee the QoS, otherwise they cannot be taken into account as the reference nodes. Here, the requesting nodes and the cooperative nodes share the potential reference nodes in the same set of the MUs in addition to the BSs.