## 4 The Proposed Routing Protocol: HPA-SR
### The Proposed Clustering Protocol (ASCs): The Underlying Structure
#### 4.2.2 The Proposed Clustering Protocol: ASCS
The selected cluster member (\(\text{CM}_{m^{\star}}\)) can be mathematically formulated as: \[m^{\star}= \operatorname*{arg\,max}_{m}\{\text{CoSim}(\text{i},\text{m})\},m \in\text{CH}_{\text{NB}_{i}},\] (7a) \[s.t. \sum_{m=1}^{M_{\text{NB}}}\text{CoDis}(\text{i},\text{m})<\hat{p},\] (7b) where \[\text{CH}_{\text{NB}_{i}}\] represents a set of cluster heads near \[n_{i}\], \[M_{\text{NB}}\] represents the number of CMs near node \[i\], i.e., \[\texttt{NB}_{i}^{*}=|\theta_{NB_{i}}|<\theta_{th_{i}},\]0. (7a) indicates the maximum cosine similarity between \[\texttt{NB}_{i}^{*}=|\theta_{NB_{i}}|<\theta_{th_{i}},\]1 and \[\texttt{NB}_{i}^{*}=|\theta_{NB_{i}}|<\theta_{th_{i}},\]2, while (7b) means the cosine distance constraint that must be less than the cosine distance threshold ( \[\texttt{NB}_{i}^{*}=|\theta_{NB_{i}}|<\theta_{th_{i}},\]3 ). In (7b), CoSim can be expressed as [39]. \[\texttt{NB}_{i}^{*}=|\theta_{NB_{i}}|<\theta_{th_{i}},\]4 (8) where \[\texttt{NB}_{i}^{*}=|\theta_{NB_{i}}|<\theta_{th_{i}},\]5 and \[\texttt{NB}_{i}^{*}=|\theta_{NB_{i}}|<\theta_{th_{i}},\]6 are the \[\texttt{NB}_{i}^{*}=|\theta_{NB_{i}}|<\theta_{th_{i}},\]7 -th and \[\texttt{NB}_{i}^{*}=|\theta_{NB_{i}}|<\theta_{th_{i}},\]8 -th node's vector information, respectively. Each node \[\texttt{NB}_{i}^{*}=|\theta_{NB_{i}}|<\theta_{th_{i}},\]9 is related with a mobility vector information metric value (i.e. speed, direction, and location) \[i^{\star}=\arg\min_{i\in\texttt{NB}_{i}^{*}\cup\{i\}}\{s_{i}\}.\]0, where \[i^{\star}=\arg\min_{i\in\texttt{NB}_{i}^{*}\cup\{i\}}\{s_{i}\}.\]1 constitutes the vector values which indicate link information between nodes. Cosine similarity can determine the similarity information from each adjacent node, while cosine distance is a method for determining the communication distance between adjacent node. By considering the maximum cosine similarity under the constrained communication distance, we can control the cluster member to make more stable cluster members in the viewpoint of mobility. Then, the cosine distance of the node used to find the distance between two nodes can be calculated by [40] \[i^{\star}=\arg\min_{i\in\texttt{NB}_{i}^{*}\cup\{i\}}\{s_{i}\}.\]2 (9) If \(n_{i}\) selects the \(\text{CH}_{m^{\star}}\), the node \(\text{CH}_{m^{\star}}\) can be as the best cluster head. Node \(n_{i}\) sends the joint-cluster (**JC**) packet to the \(\text{CH}_{m^{\star}}\). **JC** packet contains the following fields: \[i^{\star}=\arg\min_{i\in\texttt{NB}_{i}^{*}\cup\{i\}}\{s_{i}\}.\]3 where Type represents packet type, \(\text{S}_{\text{ID}}\) represents source node ID, \(\text{D}_{\text{ID}}\) represents destination node ID, S represents its node speed (\(s_{i}\)), Loc represents its node location (\(x_{i},y_{i}\)), Dir represents its node direction, and Status represents its node status (gateway node or else), respectively. Then, go to **step 7**. * Otherwise, \(n_{i}\) waits until it receives **AC** packet. It is noted that, according to the characteristic of vehicular networks, the nodes dynamically and randomly move. Thus, the members often switch from one cluster to another cluster. However, the member nodes (including the source node and gateway node) do not switch much through the proposed clustering algorithm. The possible reason is that the cluster has a similar mobility pattern via cosine similarity and cosine distance. Besides, since the cluster head is the slowest node, the cluster head does not switch much. Table 1 is summarized the list of packets for the proposed clustering protocol process.