## 1 Introduction
converted indoor location data into a sequence of stationary points with semantic information and clustered the trajectories using the DBSCAN algorithm [13]. [PERSON] et al. utilized a density clustering algorithm to cluster the trajectories and computed the similarity between trajectories to identify the anomalous trajectories [14]. [PERSON] et al. proposed a tracking algorithm based on hidden Markov models (HMM) to predict indoor user trajectories [15]. [PERSON] et al. proposed methods that can adaptively change the HMM parameters to realize the prediction of different types of user trajectory data [16]. [PERSON] et al. proposed a Markov chain-based campus trajectory prediction model by building a state transfer matrix to describe the transfer probabilities between different times and locations [17]. Existing studies show that traditional methods mainly cluster the spatial density of trajectory points. However, these methods ignore key features in the trajectory, such as time, direction, and speed. Directly analyzing the raw data will have the problem of a more extensive sample set, and the temporal performance of the convergence of the clustering is not quite in line with the expectation. In the aspect of the trajectory prediction, the prediction by using the traditional HMM will still have the inaccurate results. This is because the state transfer probability matrix describes the probability of a user moving from one location to another. Existing research does not take into account the problem that the user stays in a location for too long, which leads to a state transfer probability of 0 and partial prediction failure. To address these problems, this paper proposes a network handover algorithm based on predicting the user's mobile trajectory. The algorithm applies to VHO and HHO prob lems in indoor VLC/Wi-Fi heterogeneous networks. It reduces the number of handovers while improving system throughput, providing users with more stable and reliable communication services. The main contributions of this paper can be summarized as the two following points:  
1. Important location points are extracted from the massive trajectory data to be clustered using the DBSCAN algorithm, and the clustering results are used as the hidden state of HMM to predict the user's next possible location. This avoids the problem of prediction failure caused by the state transfer probability matrix being zero during the prediction process by introducing a linear smoothing mechanism. 2. An adaptive network handover strategy based on Q-learning is proposed. The strategy selects the best network access point for the user by considering the current network state, user trajectory, and service quality. A seamless handover protocol is introduced throughout the handover process for seamless data transmission. The rest of the paper is organized as follows: Section 2 presents the system model for VLC/Wi-Fi heterogeneous networks, including the channel model and optical path blocking model for VLC and Wi-Fi. Section 3 details the proposed network handover algorithm based on location prediction, mainly consisting of trajectory clustering, movement prediction, and seamless handover protocol. Section 4 verifies the effectiveness of the algorithm in this paper. Finally, Section 5 summarizes this paper and outlines future research directions.