# A Placement Method of the 5G Edge Nodes Based on the Hotspot Distribution of Mobile Users
## 3 Our Proposed Method
### The Hotspot Extraction Algorithm Based on the Sliding Time Window  
The characteristic of the BDSCAN algorithm is to cluster all the locations in one target area without considering the time factor. Therefore, when a small number of users (such as 10 users) are clustered over a long period of time in a certain area, the area will be clustered into a clustering area. However, the fact is that this clustering area may not be a real cluster area for users. For example, if an area has a small number of user locations per hour (such as about 10), but the cumulative locations will reach 240 in 24 h and 1680 in a week, so, when the DSCAN algorithm is used to cluster this area, it may be clustered into a clustering area. But when the 1680 locations may be owned by 10 users, it is clear that this clustering area is not a real cluster area, and therefore cannot be called a hotspot. In the real world, a user hotspot is always associated with time. For example, the student canteen is a hotspot only in the morning, noon, and evening; the student classroom is generally a hotspot during non-meantimes; a hospital is a hotspot area from 7 a.m. to 10 p.m.; and a dormitory is a hotspot area from 7 p.m. to 11 p.m. Therefore, we need to determine whether each cluster area based on DBSCAN is a hotspot area according to duration time and number of users in each cluster area. For example, if a student canteen is a hotspot in a day from 7:30 to 8:30, 11:30 to 12:30, and 18:00 to 19:00, then the duration time of this hotspot area is 3 h.  
In order to extract the user number and duration time of each cluster, we designed a feature extraction algorithm of cluster area based on the sliding time window. This algorithm is shown in Algorithm 2. Firstly, this algorithm defines a time window, denoted by \(T_{d}\), and sets a threshold (\(P_{t}\)) of the number of users in the cluster area. The threshold is defined as the minimum number of users in a given area at a given time. A cluster area can be identified as a hotspot only when the user number in a cluster area exceeds \(P_{t}\) in a period of time. Based on historical data, this threshold needs to be less than the parameter _MinPts_ in DBSCAN. In practice, if a cluster area only accidentally meets the user number threshold in a hotspot for a short time, it is not an actual hotspot. To avoid fake hotspots in cluster areas, we also need to set a time slice threshold, called as \(S_{t}\). Threshold \(S_{t}\) is as follows: a cluster area is considered a hotspot area only when the number of users in at least \(S_{t}\) consecutive time slices is greater than \(P_{t}\). Algorithm 2 shows the process of extracting user features and time features of each cluster based on a sliding time window. The idea of this algorithm is as follows:  
For each cluster area \(C_{i}\), the calculation time interval is set into [\(T_{s}\), \(T_{e}\)], where \(T_{s}\) is the start time and \(T_{e}\) is the end time. Starting from \(T_{s}\), the number of users corresponding to the current cluster within [\(T_{s}\), \(T_{s}+T_{d}\)] is counted, and save the result to \(UserNum\). If \(UserNum\geq P_{t}\), the consecutive time slices number (called \(SliceNum\)) is added by 1, and the total number of users in this cluster area is added by \(UserNum\). Further, if \(SliceNum\) is equal to \(S_{t}\), the duration time of the \(i\)th cluster area is recorded as \(CF_{i}^{T}\leftarrow\)\(CF_{i}^{T}\) + \(SliceNum\) * \(T_{d}\). If \(SliceNum\) is greater than \(S_{t}\), \(CF_{i}^{T}\leftarrow\)\(CF_{i}^{T}\) + \(T_{d}\). Then, the time window is slid forward using \(T_{d}\), and then the above processes are repeated until (\(T_{s}+T_{d}\)) \(>T_{e}\).