# A Novel Context-Aware Reliable Routing Protocol and SVM Implementation in Vehicular Area Networks
## 4 Mathematical Analysis for Proposed Protocol  
The operation of the proposed protocol is defined below:  
1. The likelihood that a direct connection among two vehicles will remain uninterruptedly accessible over a definite time duration is known as link reliability. Assumed a prediction time \(T_{P}\) for constant accessibility of a particular link \(l\) among two vehicles at \(t\), the link reliability \(r(l)\) is specified as below: \[r(l)=P\{\text{to continue to be available until }t+T_{P}|\,\text{available at }t\}\]
2. For the proposed work, evaluation for the Euclidean distances among the data points and centroids are calculated to allocate points to the closest centroid. The \(x_{i}\) dataset is generated based on the following parameters such as the location of the vehicle, the direction, the velocity of the vehicle, and the Point of Interest (POI). 3. A process for clustering N data inputs \(x_{1},x_{2},\ldots\ldots x_{N}\) into \(k\) clusters \(C_{i},i=1,\ldots k\), each comprising \(n\)\(\underset{i}{\text{ }}\) data points, \(0<n_{i}<N\), reduces the subsequent mean-square-error (MSE) value: \[J_{MSE}=\sum_{i=1}^{k}\sum_{x_{i}\in C_{i}}\left\|x_{i}^{(j)}-c_{j}\right\|^{2}\] (3) where \(x_{t}\) is a vector signifying the \(t\)th input and \(c_{j}\) signifies the geometric centroid of the cluster \(C_{i}\). To minimize an objective value, a squared error function is used, which represents the distance between data point \(x_{t}\) and the cluster center \(c_{j}\). \[I(x_{i},j)=\left\{ \begin{array}{ll}1&\text{if }i=\text{arg min}(\|x_{i}-c_{j} \|^{2})j=1,\ldots\ldots k\\ 0&\text{otherwise}\end{array} \right\}\] (4) Here, \(c_{1},c_{2},c_{j},\ldots\ldots c_{k}\) are known as cluster centers which are acquired by the subsequent steps: 4. Set \(k\) cluster centers \(c_{1},c_{2},c_{j},\ldots\ldots c_{k}\). For each input \(x_{t}\) and \(k\) cluster, perform stages 2 and 3 until all clusters congregate. 5. Evaluate cluster membership value using Equation (4) and determine the membership of each input in every \(k\) cluster whose cluster center is nearest to that centroid. 6. For each \(k\) cluster, establish \(c_{j}\) to be the center of all data inputs in cluster \(C_{i}\). 7. Consequently, the k-means clustering divides the routes into two clusters named GOOD and BAD. The cluster with high mean square error (MSE) is labeled as BAD, and the cluster with low MSE is labeled as GOOD. Machine learning techniques are implemented to train the data accumulated from produced simulations and train  
Figure 4: Support vector machine approach. [PERSON] in every iteration with random inputs until the best results are achieved. The pseudo-code has been explained in Algorithm 1. 8. In this step, Radial Basis Function (RBF) is used for transforming the given input vector into n-dimensional data. Gaussian RBF mathematical expression is represented as follows: \[K(c_{1},c_{2})=\exp\Bigl{(}-\gamma\|c_{1}-c_{2}\|^{2}\Bigr{)}\] (5) where, \(K(c_{1},c_{2})\) represents the kernel function for two classes \(c_{1}\) and \(c_{2}\), \(\gamma>0\) and represented \(\gamma=\frac{1}{2a^{2}}\). For this, we gather data from the produced simulations and train SVM with arbitrary inputs in every iteration until the optimal result is attained. However, the input data is firstly normalized before utilizing for training. The SVM recognizes the malicious activity of the vehicle in the network and transmits the results to the response unit, which has its own set of regulations to produce an outcome. 9. After training the routing data with SVM, during the execution, we evaluate the following parameters of each route from source to target: 1. PDR: It signifies the ratio of all packets effectively received at the receiver to all the data packets transmitted by the source vehicle. 2. Average E2E delay: It signifies the average time that the packets take to reach the destination. 3. Throughput: It signifies the total packets that are transferred from the sender to the receiver node in a given amount of time.