# A Placement Method of the 5G Edge Nodes Based on the Hotspot Distribution of Mobile Users
## 3 Our Proposed Method
### The Extraction Algorithm of User Cluster Areas  
Compared with other clustering algorithms, the DBSCAN algorithm can quickly cluster and effectively process noise points, and it does not predefine the number of clusters. Therefore, we use the DBSCAN algorithm to extract the cluster areas of users in the first stage. In the DBSCAN algorithm, the following parameters are involved, which have a decisive effect on the clustering result.  
1. \(\varepsilon\)-neighborhood: Given a point \(p\), all the points whose distance from \(p\) is within _Eps_ are called the \(\varepsilon\)-neighborhood.
2. _MinPts_: This is the threshold of the number of points in the \(\varepsilon\)-neighborhood. That is, the minimum number of points in the \(\varepsilon\)-neighborhood when \(p\) becomes the core point.
3. Core point: If the \(\varepsilon\)-neighborhood of a location point contains at least _MinPts_ location points, then the point is called the core point.
4. Boundary point: If the location \(p\) is not a core point but falls in the neighborhood of a core point, then \(p\) is called a boundary point.
5. Noise point: If the point \(p\) is neither a core point nor a boundary point, then point \(p\) is called a noise point.  
When using the BDSCAN algorithm to cluster data sets, the distance parameter _Eps_ and density threshold _MinPts_ need to be determined first. The selection of two parameters directly determines the quality of the clustering results. Current experiments show that when _MinPts_ is constant if the _Eps_ is too large, most points will converge into the same cluster; If the _Eps_ is too small, it will split one cluster into multiple clusters. When _Eps_ is constant, if the _MinPts_ are too large, more points will be marked as noise points; if the _MinPts_ are too small, more points will be clustered into core points. Because the above two parameters are closely related to the sample locations in the dataset, we need to optimize two parameters by many experiments in Section 4.  
Algorithm 1 gives the user cluster area extraction algorithm based on BDSCAN. The input of this algorithm is the trajectory data set \(D\) of all users, _Eps_, and _MinPts_. The output is the set \(C\) of user cluster areas obtained by clustering.  
In Algorithm 1, the location, timestamp, and user number of all user trajectories are combined into a new set _NTS_. At the same time, the location coordinates of all user trajectories are formed into a new set of _NLS_, which is used as the input of the DBSCAN clustering algorithm in Python.  
Then, this algorithm calls the DBSCAN instance for clustering and gets the clustering result for all locations, named the clustering label.  
Each bit in the cluster label corresponds one-to-one to each location in the _NLS_. If the label value is \(-1\), the location point is a discrete point. If the label value is an integer greater than \(0\), it means that the location points have been successfully clustered. All locations with the same label value belong to the same cluster area.  
Finally, according to the label value of the cluster result, the location with the same label value, the time stamp, and the user number corresponding with this location are stored in set \(C\).