# Human Clustering Based on Graph Embedding and Space Functions of Trajectory Stay Points on Campus
## 4 Discussion  
Spatio-temporal clustering based on human movement trajectories has been widely investigated based on location and time attributes in available research. Relevant clustering algorithms using geometric and temporal similarities of trajectories can reveal spatio-temporal patterns of human activities with similar location sequences. However, the space function of trajectory stay points, as one of the basic drivers of intentional human movements, has not been incorporated explicitly in previous works. It is necessary to identify individuals who visit spaces of the same type of function but at different locations. In this way, it is possible to effectively reveal the spatial dynamics of human mobility in view of space function and interactions between functions of spaces and human spatio-temporal behaviors.  
In our work, human clusters were generated based on space functions and time durations spent by individuals. Thirty-five types of space functions were categorized in our research region, and three typical time durations are considered to indicate connections among individuals in spaces of the same function. With trajectory data of 3000 individuals collected from the campus Wi-Fi network over nine days, it was found that the network size and relevant statistics are inversely proportional to time duration, which agrees with common understanding of characteristics of human gathering activities. Since individuals often visit multiple spaces with different functions in a certain period, the network represents variant-dimensional connections among individual nodes. Graph embedding techniques are appropriate tools to transform network neighboring data into low-dimensional, fixed-length feature vectors. Node2 Vec was introduced in this work to learn and generate continuous representations of nodes with a biased random walk strategy. K-means was then used to conduct clustering in the vector space of the learned network representation. This clustering algorithm minimizes the variance in each cluster and maximizes differences between clusters. It enables us to input a suitable number of clusters, which is more effective than other algorithms requiring more parameters. It is effective in answering questions like how many types of campus inhabitants there are.  
Figure 14: Distribution of clustering results across space functions within the 24 h scenario.  
Inertia and the silhouette score are employed to determine suitable numbers of clusters based on the elbow method. Each resulting number of clusters for the corresponding time duration is inversely proportional to the time duration. This is in agreement with characteristics of human group activities. Two additional indicators measuring clustering performance are used to identify appropriate settings of biased random walk strategies.  
Upon analysis and comparison of clustering results, it was found that the largest clusters across all three scenarios exhibited common characteristics. They included the widest variety of space functions, with dormitories being the most frequent, followed by laboratories, classrooms, and public areas, suggesting that these clusters likely represent student groups. These results are consistent with the characteristics of major campus inhabitants and their corresponding activity patterns.  
Based on the statistical results, it can be observed that the total number of individuals in larger clusters is directly proportional to the number of individuals who stay in dormitory spaces. By examining other stay points of these clusters, it can be validated that these individuals are primarily students. A more detailed analysis of their additional stay points allows for further distinctions between different groups of students. In contrast, for smaller clusters, dormitory stays do not reveal a clear pattern, as there are few or no records of dormitory stays. Instead, the stay points of these smaller groups are concentrated in offices, classrooms, and laboratories.