# Cooperative Content Caching Framework Using Cuckoo Search Optimization in Vehicular Edge Networks
## 6 Cooperative Content Caching Framework
### Optimisation Using Cuckoo Search  
In our model, we use nature inspired optimization technique named cuckoo search (CS), to find the shortest path with minimum time spam and cost, as shown in Figure 5. Each cuckoo lays eggs in a number of host nests but the cuckoo will find a host bird with high quality based on the probability. Cuckoo search with Levy flight will take a lot of smaller steps after taking random longer steps. CS parameters are Inertia location or the cuckoo itself, number of host nests, number of step sizes, number of eggs, and brood parasitism. Algorithm 2 shows the working of Cuckoo search. As compared to ACO, the CS has less parameters; there is no dependency to take the next step and brood parasitism is the best parameter to find better output; moreover, it will not stick into local optima. The objective function is shown in Equation (14), where a new iteration is taken by cuckoo p, using current iteration \(x_{p}\textsuperscript{! }\), Levy flight distribution function is used to update the solution _Levy_ (\(\lambda\)), while \(\alpha\) is the step size. \[f(x)\to x_{p}\textsuperscript{!}+\alpha\oplus\textit{Levy}\ (\lambda) \tag{14}\]  
```
1. Begin
2. Compute. \(\lambda\), \(\alpha\),
3. For k = 1 to Np do
4. Compute. u, v and step of levy flight as \(\text{Levy}(\lambda)=(\text{u}/\text{v}-\lambda)\)
5. Compute D: distance between current route V\({}^{\text{k}}\) and best route V\({}^{*}\)
6. Compute. step size h = D. \(\alpha\). Levy (\(\lambda\))
7. Apply inverse mutation operator f\({}_{\text{inv}}\) to find new route
8. V\({}^{k}\) = f\({}_{\text{inv}}\) (V\({}^{k}\), h, Q1, Q2)
9. Compute reliability of new route
10. R\({}_{\text{P}}\leftarrow\{\text{R}_{\text{P}},\text{R}^{k}\}\): reliability score of new route
11. V\({}_{\text{P}}\leftarrow\{\text{V}_{\text{P}}\,\text{V}^{k}\}\): store new reliable route
12. If R\({}^{k}\) > R\({}^{\prime}\) then
13. Update R\({}^{*}\) with new one R\({}^{k}\)
14. Update V\({}^{k}\) and V\({}^{*}\)
15. End if
16. End for
17. Return best route and reliability score

Figure 5: Working of cuckoo search. ### Content Caching with Clustering

First, MBS and RSUs will cache popular information together. When a user requests content, it is already cached on the server and provided quickly. If a user requests content that has not been cached on the server, the request will be sent to the central cache. Another component of our research is to create clusters based on user requests; when a car sends a request, RSU searches the cluster for the data and provides it instantly. Clustering saves time because the entire coverage area is not explored. ## 7 Performance Evaluation and Results

We simulated the vehicular edge environment consisting of the edge servers (RSU and MBS) and several users located within the coverage area of the RSUs. We use 3 MBS and 10 RSUs in each MBS and exploit the K-Means clustering technique for user grouping. When a vehicle sends requests to the RSU, it searches that content in those clusters near users. The coverage area of RSU is 100 m, and MBS is 1000 m. If RSU finds the content, it sends that node's location to the requesting node. By clustering, there is no need to search out all users in the coverage area. The dataset used in our experiment is MovieLens, collected from the MovieLens website [41]. We have only considered those movies that have more than 10 user rates. To decide which are most popular, we set two parameters: first, the high rating given by users to different movies and second, how many users rate a movie. At the end, those movies that most users rate get high preference as compared to those which are rated by only a few users. In order to simulate the users' content request process, we consider the movie ratings given by a user as the request for that movie just as assumed in [42]. We compared the proposed technique (CS) with the state-of-the-art scheme (ACO) to assess the performance based on cache hit ratio, delay, delivery cost, and caching cost.