# Towards Intelligent Zone-Based Content Pre-Caching Approach in VANET for Congestion Control
## 3 Materials and Methods
### Construction of Zones
The measured computational time complexity of the CNN model in Algorithm 3 is O (k, n, d\({}^{2}\) with and space complexity is O(n), where n defines the total dataset used in testing and training). The main steps in Algorithm 3 are  
1. Get zone from Algorithm 1;
2. ZoR for dissemination from Algorithm 2;
3. The originated data are captured and handled through the manager nodes, with road and traffic conditions captured through every incident vehicle;
4. Store data in the manager node from the real environment;
5. Set initial velocity and position to the initial stage;
6. Set the training data for valuable variables;
7. Calculate the prediction value for every sample dataset;
8. Calculate the error;
9. If step 8 is not good, then training starts for the provided dataset;
10. The model is effectively trained. ```
Input: Table 1, Algorithm 1, \(V_{ZaR}\), Geocast Network, Data\({}_{train}\) Output: Target ZoR, Messages Dissimination, Network Development Steps:
0. Prepare Dataset
1. \(Z_{i}\)\(\leftarrow\) Algorithm 1 \(\therefore\) Get Zone from Algorithm 1
2. \(ZOR_{i}\)\(\leftarrow\) Algorithm 2 \(\therefore\) ZoR for dissemination from Algorithm 2
3. \(Data_{VANET}\)\(\leftarrow\)\(\left( \begin{array}{c}Video,\ Emerge\ Road\ Conditions,\ traffic\\ conditions,\ Control\ messages\end{array} \right)\) \(\therefore\) The originated data are captured and handled through the Manager nodes with road and traffic conditions captured throughout every incident vehicle. 4. \(MN_{M}^{learn}\)\(\leftarrow\)\(step\) 3 \(\therefore\) Store data in the manager node from the real environment
5. \(Initialize:\ V_{0}^{0}\)\(\&\)\(P_{i}^{0}\)\(\therefore\) Set initial velocity and position to the initial stage Train Model
6. for\(i=1\ to\ Data_{train}\)do\(\therefore\) Set the training data for valuable variables
7. for\(j=1\ to\ N\)do\(\therefore\) Calculate the prediction value for every sample dataset
8. \(calculate\_error(prediction\ Values)\) \(\therefore\) Calculate the error
9. \(if(\{step\ 8\})\)
10. \(Apply(weighted\ values)\);
11. \(ML_{VANET}\)\(\leftarrow\)\(Trained()\)
12. End for
13. End for
14. Return:\(ML_{Mald}^{pre-catch}(Trained)\) Test Model
15. Prepare: \(Date_{Testing}^{pre-catch}\)
16. for\(k=1\ to\ M\)do
17. \(Test\left(Data_{Testing}^{pre-catch}\right)\)\(\leftarrow\)\(Prediction\) - Results;
18. \(Capture\)\(\left( \begin{array}{c}prediction\ accuracy,\\ average\ delay, hit ratio, throughput\end{array} \right)\);
19. End for
20. Return: Graphical Results
```  
**Algorithm 3** Machine Learning-Based Content Pre-Caching  
A dedicated CNN-based machine learning model is adopted in our proposed system. The machine learning model is embedded in RSU. This makes the efficiency of the proposed system more accurate early prediction of content pre-caching. The machine learning scenarios are easily met using dependent machine learning objectives. The proposed system was trained through plenty of previous pre-caching examples from different vehicle requests. The algorithm efficiently predicts the content request based on previous request rates of vehicles. Consequently, the proposed machine learning-based content pre-caching strategy provides full convenience to people who drive on highways. This research focused on improving the zone-based content pre-caching through machine learning. The proposed machine learning pre-caching provides the network with a new pre-caching protocol to enhance the safety of passengers and drivers. The main goal of the research is to provide an effective and reliable safety control system. ZoR is considered to enhance the services of the system with enlist effectiveness. This paper focused on emergency pre-caching, which enhances vehicle security events in ZoR. To achieve a pre-caching, a CNN-based supervised machine learning algorithm is used. After evaluating the proposed system and discussing its working, we explained performance evaluation with obtained results from the proposed technique.