# Weight-Based PA-GPSR Protocol Improvement Method in VANET
## 4 Proposed Protocol
### Perimeter Forwarding Route Maintenance Strategy Based on Weight  
In this section, a weight calculation method based on the data packet delivery angle and assisted by reliable node density was proposed to realize the improvement of the PA-GPSR protocol's perimeter forwarding strategy. The perimeter forwarding strategy of the PA-GPSR protocol was to use the left-hand and right-hand rules for forwarding while copying data packet, as well as to use the recently sent table to reduce the overhead of the routing protocol, i.e., those that had already forwarded left-handed data packets could no longer forward right-handed data packets. The weight-based perimeter forwarding strategy reduces redundant paths and further reduces end-to-end delay. The specific weight calculation method is defined as follows:  
\[P_{n}=\beta_{1}\cos\theta_{n}+\beta_{2}\frac{RN_{n}}{S} \tag{9}\]  
In Formula (9), \(\theta_{\text{n}}\) is the data packet delivery angle, while \(\beta_{\text{i}}\) is the weight coefficient, i.e., \(\beta_{1}+\beta_{2}=1\) and \(\beta_{1},\beta_{2}\in[0,1]\). The calculation formula of \(\theta_{\text{n}}\) is defined via Formulas (10) and (11):  
\[\cos\theta_{n}=\frac{\left|y_{i}-y_{s}\right|}{\sqrt{\left(x_{i}-x_{s}\right) ^{2}+\left(y_{i}-y_{s}\right)^{2}}} \tag{10}\]  
\[\theta_{n}=\left\{ \begin{array}{l}\theta_{right}=arccos(cos\theta_{i}), node\;i\;is\;in\;the\;first\;quadrant\\ \theta_{left}=arccos(cos\theta_{i}),node\;i\;is\;in\;the\;second\;quadrant\\ \theta_{left}=\pi-arccos(cos\theta_{i}),node\;i\;is\;in\;the\;third\;quadrant\\ \theta_{right}=\pi-arccos(cos\theta_{i}),node\;i\;is\;in\;the\;forth\;quadrant \\ \end{array} \right. \tag{11}\]  
As shown in Figure 6, we first calculated the packet delivery angle and reliable node density of node S for nodes A, K, D, and B, and then select node K as the next hop node based on weight. The packet delivery angle of the neighbor nodes in the left and right halves of the plane was calculated, and the weight was then determined based on the density of the reliable nodes; the next relay node for perimeter forwarding was determined based on the weight. The weight formula proposed in this section was calculated using multiple indicators; thus, a reliable weight distribution method is needed. The CRITIC method comprehensively measures the objective weight of indicators and uses the objective attributes of the data to evaluate them. It is an effective objective empowerment method [39]. Firstly, we obtained the relevant data to form the original data matrix \(X\), where \(X(m,n)\) represented the n-th item of the m-th sample. The values of the evaluation indicators are defined as follows:  
\[X= \begin{pmatrix}X_{1,1}&\dots&X_{1,n}\\ \vdots&\ddots&\vdots\\ d_{m,1}&\dots&a_{m,n}\end{pmatrix}  \tag{12}\]  
To eliminate the effects of inconsistent dimensions, dimensionless processing was carried out. The forward indicator was selected, and the weight coefficient selected is shown in Formula (13):  
\[x_{ij}^{\prime}=\frac{max(x_{j})-x_{ij}}{max(x_{j})-min(x_{j})} \tag{13}\]  
Before calculating the amount of information \(C_{j}\), we first calculated the volatility \(S_{j}\), as shown in Formula (14), where \(X_{j}\) is the mean of each indicator, and \(S_{j}\) is the standard deviation of the j-th indicator. \[x_{ij}^{\prime}=\frac{max(x_{j})-x_{ij}}{max(x_{j})-min(x_{j})} \tag{14}\]  
The correlation matrix \(R\) of the indicator was used to calculate the conflict, as shown in Formula (15):  
\[R=\frac{\sum_{j,k=1}^{n}(x_{ij}-\overline{x}_{j})(x_{ik}-\overline{x}_{k})}{ \sqrt{\sum_{j=1}^{n}(x_{ij}-\overline{x}_{j})^{2}\sum_{k=1}^{n}(x_{ik}- \overline{x}_{k})^{2}}} \tag{15}\]  
We then calculated the conflict \(A_{j}\), as shown in Formula (16), where \(r_{ij}\) represented the correlation coefficient of the i-th and the j-th indicators. The stronger the correlation with other indicators, the lesser the conflict and the greater the weight.