# Multi-Tier Cellular Handover with Multi-Access Edge Computing and Deep Learning
## 5 Proposed Algorithm
### Proposed DL LSTM Algorithm
#### 5.2.1 Handover Logic  
This algorithm relies on the previous MRs to predict the best BS to handover to. This decision happens in the current MR time stamp. Each UE's last seven MRs for potential BSs are stored in the aggregated edge of the MEC. In addition, the connected BS CQIs are also stored in the aggregated edge of the MEC. In addition, the connected BS CQIs are also stored in the aggregated edge of the MEC. \begin{table}
\begin{tabular}{c c c c c} \hline \hline \multirow{2}{*}{**Index**} & \multirow{2}{*}{**Code**} & \multicolumn{3}{c}{**Classification**} \\ \cline{3-5}  & & **CQI** & **DRR** & **Direction** & **Speed** \\ \hline
1 & GMCF & & & & Fast \\ \hline
2 & GMCL & & & & Low \\ \hline
3 & GMAF & & & & Fast \\ \hline
4 & GMAL & & & & Low \\ \hline
5 & GNCF & & & & Fast \\ \hline
6 & GNCL & & & & Low \\ \hline
7 & GNAF & & & & Fast \\ \hline
8 & GNAL & & & & Low \\ \hline
9 & OMCF & & & & Fast \\ \hline
10 & OMCL & & & & Low \\ \hline
11 & OMAF & & & & Fast \\ \hline
12 & OMAL & & & & Low \\ \hline
13 & GNCF & & & & Fast \\ \hline
14 & OnCL & & & & Low \\ \hline
15 & ONAF & & & & Fast \\ \hline
16 & ONAL & & & & Low \\ \hline
17 & PMCF & & & & Fast \\ \hline
18 & PMCL & & & & Low \\ \hline
19 & PMAF & & & & Low \\ \hline
20 & PMAL & Poor & & & Low \\ \hline
21 & PNCF & & & & Fast \\ \hline
22 & PNCL & & & Low \\ \hline
23 & PNAF & & & & Fast \\ \hline
24 & PNAL & & & Low \\ \hline \hline \end{tabular}
\end{table} 
Table 6: All 24 classification of the proposed DL LSTM. \begin{table}
\begin{tabular}{c c c c} \hline \hline \multicolumn{1}{c}{**Dimension**} & **Classification** & **Letter Code** & **Value Range** \\ \hline \multirow{2}{*}{User Direction} & Closer & C & \(\Delta\) RSS \(\geq\) 0 dBm \\  & Away & A & \(\Delta\) RSS \(<\) 0 dBm \\ \hline \multirow{2}{*}{User Speed} & Fast & F & \(|\Delta\) RSS \(|\geq\) 5 dBm \\  & Low & L & \(|\Delta\) RSS \(|<\) 5 dBm \\ \hline \end{tabular}
\end{table} 
Table 5: _Cont._stored for the past seven timestamps. These seven CQIs are averaged to ensure shadow fading and small-scale fading effects are minimized. Furthermore, the same is performed for the actual data rate to ensure fluctuations are filtered out. If the BS has a CQI that is higher than \(1\) for longer than seven consecutive time stamps, MR variations are considered to save power for low mobility UEs. The pseudocode below describes these logical steps (Algorithms 1 and 2). ```
1 procedure: Classify BSs based on MRs
2 for each potential detected BS
3 ifCQI \(\geq\) 1 then
4 Calculate all remaining parameters to input into the LSTM
5 Predict potential BS classification based on the inputs
6 Store the classification for the user at the aggregated edge
7 endif
8 endfor
9 endprocedure
``` ```  
**Algorithm 1** Classification logic  
The reasons why these MR occurrence limits were chosen are highlighted below:  
* For high mobility UEs, the MRs will not go below 80 ms, as it will drain the UE's battery at a high rate;
* For low mobility UEs, the MRs will not go above 400 ms, as this will impact the response of a handover decision if it is required for sudden changes in movements. For this algorithm, the TTT is replaced with a dynamic LUT-based trigger mechanism. LUTs provide a very fast and simple approach to solving repetitive problems. Additionally, outcomes can be easily modified to achieve the desired outcomes. All handover decisions require 5 (~70%) or more instances of each predicted classification. For example, if a UE is fast-moving, the classification 'fast' within the last seven predictions must occur at least five times. Otherwise, it will be considered a slow-moving UE. Table 7 shows the possible handover decisions based on the predicted classification for the potential BS and the parameters of the current connected BS. The classification for the potential BS is the classification obtained from executing Algorithm 1 for the new detected  
BS to which the UE may connect.