# Improved Road Segment-Based Geographical Routing Protocol for Vehicular Ad-hoc Networks
## 3 Improved Road Segment-Based Geographical Routing Protocol
### Score Function for HN Prioritization  
After the explanation of the routing parameter calculation, this section presents the score function calculation for HN prioritization. The first metric is position, where vehicle node is presented in central position. The progressive distance towards the destination is one of the significant routing metrics in the geographical routing protocol. The next routing metric is the direction towards the destination where the next forwarder node only selects the node that is moving towards the destination to avoid looping issues. The direction difference-oriented score \(S_{d_{i}}\) for a vehicle can be expressed as given in Equation (5).  
\[S_{d}\ =\ \left\{\begin{array}{c}1,\ \big{|}\ d_{i+1}-d_{i}\big{|}\cong 0^{ \circ}\\ 0,\ \big{|}\ d_{i+1}-d_{i}\big{|}\cong 180^{\circ}\\ \alpha^{|d_{i+1}-d_{i}|},\ \big{|}\ d_{i+1}-d_{i}\big{|}\leq 180^{\circ}\\ 1-\alpha^{|d_{i+1}-d_{i}|},\ \big{|}\ d_{i+1}-d_{i}\big{|}>180^{\circ}\end{array}\right. \tag{5}\]  
where \(\alpha\) is the decisive factor for direction, which is considered 0.5 in the network environment, and the direction of vehicle is represented as \(d_{i}\) and \(d_{i+1}\). It is clarified that when the direction of both the vehicles is the same \(\big{|}\ d_{i+1}-d_{i}\big{|}\cong 0^{\circ}\), the direction-based score is 1 in Equation (5). Similarly, when the direction of the vehicles is opposite to each other \(\big{|}\ d_{i+1}-d_{i}\big{|}\cong 180^{\circ}\), the direction-based score is 0 in Equation (5). Furthermore, when the difference in the direction of the vehicles is \(\big{|}\ d_{i+1}-d_{i}\big{|}\leq 180^{\circ}\), the direction-based score is between 0 and 0.5. Similarly, when the difference in direction of the vehicles is \(\big{|}\ d_{i+1}-d_{i}\big{|}>180^{\circ}\), direction-based score is between 0.5 and 1. This is effectively represented in Equation (5). Similar representation also follows in Equation (6) where the speed difference-based score is calculated using the function. The third metric is link quality when there is a tie in the direction-oriented score \(S_{d}\) between two or more nodes, and then ISR checks the speed-based link quality of the nodes and chooses the better node between them, as shown in Equation (6), for calculating speed difference-oriented score \(S_{s}\).  
\[S_{s}\ =\ \left\{\begin{array}{c}1,\ \frac{s_{i}}{s_{i+1}}\cong 1\\ 0,\ \frac{s_{i}}{s_{i+1}}\geq 2\\ \beta^{\frac{s_{i}}{s_{i+1}}},\ 1<\frac{s_{i}}{s_{i+1}}<2\end{array}\right. \tag{6}\]  
where \(\beta\) is the decisive factor for speed-based link quality, which is considered 0.5 in the network environment, and the speed of vehicle is represented as \(s_{i}\) and \(s_{i+1}\). The overall score \(S_{o}\) can be calculated as \(S_{o}\ =\ S_{d}+S_{s}\) for each candidate HN during selection. The node with the higher score is finally selected as the HN for the considered road segment. Here, the weighting factor for selecting the HN must be less than or equal to 1. When there is only a single node presented in the central position, it is elected as the HN using Equation (5), and if there is tie between nodes, then Equation (6) is executed for selecting the HN with the final score.