## 3 Proposed Method  
Clustering within an OppNet entails organizing vehicles according to factors like proximity and geographic positioning. This arrangement fosters adaptable groups with basic data exchange and effective communication among vehicle nodes, prompting the development of various clustering algorithms. An important aspect in clustering is the selection of CHs, which can be accomplished via either a centralized approach utilizing network infrastructure such as RSU, or a decentralized method where CHs are chosen based on decisions made by vehicles within each cluster. In this study, we propose an Adaptive Clustering-based Routing Protocol (ACRP) that utilizes dynamic clustering, resulting in improved packet delivery and a dynamic clustering approach that groups nodes based on distance and location. The protocol is divided into four phases:  
* Phase 1: calculating the Euclidean distance between vehicles. Phase 2: selecting a node as a CH. * Phase 3: network addressing architecture. * Phase 4: dynamic clustering adaptively. In the first phase of the proposed ACRP, we consider an area where each vehicle (\(V_{i}\)) is randomly positioned. We assume that GPS data are globally available for all nodes that contribute to the calculation of distances between nodes. This is based on the individual capability of each node (e.g., vehicle) to independently access GPS signals from satellites directly, rather than relying on the transmission of GPS data between nodes. Accordingly, we calculate the Euclidean distance between two vehicles as follows \(d_{(V_{i},V_{j})}=\sqrt{(X_{V_{i}}-X_{V_{j}})^{2}+(Y_{V_{i}}-Y_{V_{j}})^{2}}\) where the selected vehicles are assumed to be \((V_{i})\) and \((V_{j})\) and the corresponding coordinates are \((X_{V_{i}},Y_{V_{i}})\) and \((X_{V_{j}},Y_{V_{j}})\). This distance makes the closest node to be placed in the cluster and also two nodes communicate with each other in a lesser time interval. In the second phase, we utilize two crucial criteria for choosing the cluster head: Encounter Rate (\(\phi\)) and Remaining Energy (\(\Psi\)). The cluster head (\(\chi_{i}\)) is chosen based on the encounter value of other neighbors within a specific range. In order to monitor the frequency of encounters for a note, the ACRP keeps track of two local variables: an encounter history (\(\phi_{i}\)) and a current window counter (\(CW\)). The \(\phi_{i}\) reflects the node's historical encounter rate, calculated as a weighted moving average. On the other hand, the \(CW\) provides information about the number of encounters within the current time interval. Periodically, the \(\phi_{i}\) is updated to incorporate the most recent \(CW\), ensuring that the latest rate of encounter information is taken into account. The calculations for updating the \(\phi_{i}\) are conducted in the following manner:  
\[\phi_{i(New)}=\gamma*CW+(1-\gamma)*\phi_{i(Current)} \tag{1}\]  
The exponentially weighted moving average gives greater importance to the most recent complete current window (\(CW\)), with the emphasis being proportional to the factor \(\gamma\). Updating the \(CW\) is a simple process: for each encounter, the \(CW\) is incremented. After the current window update is finished, the history of encounters is updated, and the \(CW\) is set back to zero. According to Equation (1), it represents a simple filter for updating the encounter rate such that the recent encounter rate receives a higher weight compared to the previous encounter rate. Through our experiments, we discovered that using a \(\gamma\) value of 0.85 and an update interval of approximately 30 s yielded good results. Based on this interval time, if the interval duration is long, the encounter rate becomes uneven, whereas with shorter intervals, nodes fail to encounter neighboring nodes (best in our test of 30 s). With this knowledge, the node with the highest \(\phi_{i}\) can be selected as a candidate cluster head.