# Predictive Migration Performance in Vehicular Edge Computing Environments
## 3 Proactive Approach to MEC Resource Management  
The analysis of the proactive service migration is done by enhancing our hierarchical community-based approach to service allocation and migration presented in [18] with a mobility prediction module that targets handover prediction. As depicted in the diagram in Figure 2, the approach taken to resource management is hierarchical and closely follows the geographical dispersion of the network provider base stations and associated MEC servers in the local MEC datacentres. The hierarchical approach is also aligned with the multi-layer distribution of the MEC resources, as described in the ETSI MEC specification [16]. The main idea is that, in order to solve the problem of where to place a newly requested MEC service, the decision making is divided into two stages. In the initial stage, the best possible group, or a so-called community, of MEC servers is identified such that: (1) There are enough resources to fulfil the service request and (2) the latency between the identified community and the vehicle requesting the service is at its minimum. The result of the first stage of decision making is a list of potential communities where the service can be placed in an increasing order based on the latency that would be experienced by the end-user equipment. This list is then used in the second stage of decision making, where the best possible MEC server is chosen from the identified community of MEC servers. While the high-level goal of the first stage is to ensure minimum latency, the lower-level goal of the second stage is the smart use of the available MEC servers' resources for load balancing, server consolidation, minimum energy consumption, or a combination of multiple goals. In a formal representation of this hierarchical community-based resource management approach, each MEC host is denoted as \(H_{i}\), where \(i=1,\ldots,H\) and \(H\) is the total number of MEC servers in the 5G edge network. The available resources of each server \(\vec{H}_{i}\) at the moment \(t\) are described with the vector \(\{C_{i}(t),M_{i}(t),S_{i}(t),B_{i}(t)\}\), where \(C_{i}(t)\) is the available processing power at the moment \(t\), bounded with \(C_{max}\). Similarly, \(M_{i}(t)\) is the current available RAM memory bounded with \(M_{max}\), \(S_{i}(t)\) is the current available storage capacity bounded with \(S_{max}\), and \(B_{i}(t)\) is the available network bandwidth bounded with \(B_{max}\). Using a community detection algorithm over the graph that describes the service provider links between all MEC servers in the network, such as the Girvan-Newman algorithm [19], the natural hierarchical structure of communities of MEC servers in the network, or the network dendrogram, can be discovered, denoted with \(Com_{i}\), and \(i=0,\ldots,D\), where \(Com_{0}\) is the highest-level community that contains all MEC servers in the network, and \(Com_{D-H-1}\) to \(Com_{D}\) are the lowest-level communities that contain each individual single MEC. Depending on the size and complexity of the network provider, there can be one or multiple levels in the community dendrogram in between these two extreme cases. Similarly, the MEC services requested are represented as service requirement vectors \(\vec{S}_{i}(t_{s},t_{e})=\{SC_{i},SM_{i},SS_{i}\}\), which describe the amount of resources needed by the service \(S_{i}\) that is requested at \(t_{s}\) and is no longer needed at \(t_{e}\). The first stage of the hierarchical community-based placement algorithm aims to optimise an objective function that can be described as finding \(j\) such that the latency between the vehicle requesting the service \(S_{i}\) at \(t_{s}\) and the MEC host community \(Com_{j}\) is minimised while the chosen community has enough resources to host the service for each dimension of the resource vectors \(\sum_{k\in Com_{j}}(H_{k}^{-}(t))\leq\vec{S}_{i}(t_{s},t_{e})\).