# Deep Learning-Based Dynamic Stable Cluster Head Selection in VANET

Authors: Muhammad Asim Saleem; Zhou Shijie; Muhammad Umer Sarwar; Tanveer Ahmad; Amarah Maqbool; Casper Shikali Shivachi; Maham Tariq
Journal: Journal of Advanced Transportation
 (2021)

---

## Abstract

VANET is the spontaneous evolving creation of a wireless network, and clustering in these networks is a challenging task due to rapidly changing topology and frequent disconnection in networks. The cluster head (CH) stability plays a prominent role in robustness and scalability in the network. The stable CH ensures minimum intra- and intercluster communication, thereby reducing the overhead. These challenges lead the authors to search for a CH selection method based on a weighted amalgamation of four metrics: befit factor, community neighborhood, eccentricity, and trust. The stability of CH depends on the vehicle’s speed, distance, velocity, and change in acceleration. These all are included in the befit factor. Also, the accurate location of the vehicle in changing the model is very vital. Thus, the predicted location with the Kalman filter’s help is used to evaluate CH stability. The results have shown better performance than the existing state of the art for the befit factor. The change in dynamics and frequent disconnection in communication links due to the vehicle’s high speed are inevitable. To comprehend this problem, a graphing approach is used to evaluate the eccentricity and the community neighborhood. The link reliability is calculated using the eigengap heuristic. The last metric is trust; this is one of the concepts that has not been included in the weighted approach to date as per the literature. An adaptive spectrum sensing is designed for evaluating the trust values specifically for the primary users. A deep recurrent learning network, commonly known as long short-term memory (LSTM), is trained for the probability of detection with various signals and noise conditions. The false rate has drastically reduced with the usage of LSTM. The proposed scheme is tested on the real map of Chengdu, southwestern China’s Sichuan province, with different vehicular mobilities. The comparative study with the individual and weighted metric has shown significant improvement in the cluster head stability during high vehicular density. Also, there is a considerable increase in network performance in energy, packet delay, packet delay ratio, and throughput.


---

## Body

## 1. Introduction

A vehicular ad hoc network, popularly known as VANET, is a particular type of Mobile Ad Hoc Network (MANET), where mobile nodes are considered vehicles moving on the road [1]. The advent of developments in VANET has paved a way for the growth of Intelligent Transportation System (ITS) applications. These are broadly classified into safety-oriented applications that intended to increase safety and reduce fatal road accidents. The other is nonsafety that aims to provide additional services to passengers like traffic management, information sharing, and so on [2–4]. The vehicles communicate through the On-Board Units (OBUs), known as Vehicle to Vehicle (V2V). This becomes essential for most ITS application owing to low cost and availability [5]. Also, the vehicles can communicate with the auxiliary facilities (or installed infrastructure) like Road-Side Units (RSUs), using Vehicle-to-Infrastructure (V2I) communications. The complete model design for VANET communication is shown in Figure 1.Figure 1
The complete system model.Typically, in the V2V communication protocol, two approaches are used: flooding and relaying for data dissemination through the network. In flooding, each node broadcasts the received data packet to its neighbor received from the source. This process is repeated with the motive to reach the data packet to the source. In a flat, dense network, this approach leads to a storm problem [6]. In the relaying approach, the message broadcast from the source is forwarded to all the neighboring vehicles, and then a few are selected to forward it. The probability of success for data delivery is increased in the relaying approach but with high overhead and delay. To tackle such a problem, clustering in VANET is one of the prominent solutions. Some notations are listed in Table 1, which will be used for further gradation.Table 1
List of symbols with the nomenclature.
SymbolNomenclatureAAffinity matrixBFBefit factorCClusterCNCommunity neighborsDDistanceDigDiagonal matrixdijDiagonal elementsΔDthrThreshold distancebμ,bf,boThe bias of each gate in LSTMNHDNeighborhoodψvehiRelative velocityIDVehicular IDLLength of the laneEccEccentricityGM,E,rlGraph tupleEEnergyMTotal number of vehiclesNTotal number of clustersNCCNeighbor connection centralityhChannelℋ0HypothesisPdProbability of detectiontpDelay inpth pathPfProbability of false alarmϱWavelengthrlLink reliabilityRSUtranL−IDRSUℚ⋅Complementary distribution functionSthrSpeed thresholdTleaveTime to leaveTRFTransmission range factorTTotal simulation timeTRTransmission rangeχ2Chi-square probability distribution functiontAn instant of timetanhActivation functionVvehiVelocity of the vehicleΔVthrVelocity thresholdVavgAverage velocitywA random number0,1σx2Standard deviationγSNRx^Predicted coordinatesx,yCoordinates of vehicle∅Angle of the vehicleno_laneTotal number of lanesδPenaltyλEigenvaluesσf,σu,σ0Gates in LSTMApChannel gainPrProbability of receivingGAntenna gain⊙Hamdard functionTYTest statisticsThrough clustering in VANETs, there is information gathering, aggregation, and dissemination. Clustering is used to partition the network into smaller groups of moving vehicles. Typically, the dynamic clustering is done, which groups the vehicles on the fly as there is no physical connection among them, and they all are moving. There are several benefits like efficient bandwidth, proper distribution of resources, and scalability that the clustering approach offers [7]. There are many methods employed for clustering in VANETs [8, 9]. The urban roads are complicated as vehicle positions change frequently; they have unevenly distributed; thus, their routing and the forwarding capabilities change with their position. These issues result in an unstable network and a need for a cluster model that offers high stability in the dynamic VANET scenario. The methods especially designed for the stability of the cluster are compared in Table 2.Table 2
Comparison of various state-of-the-art schemes designed for CH stability.
Parameters for CH selectionClustering schemeYearSpeedIDSignal strengthRelative speedNeighbor countLink lifetimePositionIndividualWeightedNetwork and utility scenarios2011 [10]YesYesYes————Yes—Multihop with random walk mobility2012 [11]———Yes———PDR—Multihop with manhattan mobility scenario2013 [12]———Yes———Least mobility—Multihop with two lanes2015 [13]———YesYes——Neighbor count—Multihop with a dynamic scenario2018 [14]Yes———YesYesYesPriority—Multihop with two lanes2018 [15]Yes————YesYesThe conditional probability of link reliability—Singel-hop with an urban scenario2019 [16]Yes—YesYes—Yes——YesSingel-hop with an urban scenario and highway2019 [17]Yes—————Yes—YesSingel-hop with highway2019 [18]Yes——Yes——Yes—YesSingel-hop with highwayThrough this analysis, we can find that most of the schemes conceived for stability are formulated on the effect of a stability parameter. The weighted scheme has also considered the parameters like speed, distance, acceleration, or link time. These schemes involve no information about the type of vehicle present in the traffic scenario. The connectivity with the neighbor is also not explored. These have been designed for highway where the vehicle’s speed is too high, so the static cluster formation concerning speed and position will change dynamic, which will affect the stability of the cluster head. With all these literature analyses, the authors have designed a weighted cluster head selection based on multimetric. The befit factor, community neighborhood, eccentricity, and trust value are introduced. Also, the concept of trust has not to be utilized to date. The following are the contributions made by the authors in this paper:(i)
The befit factor designed by tuthorshe authors in [19] is based on Tleave, the time required by the vehicle to complete the remaining segment of the lane. This is calculated based on the speed of the vehicle. The speed of any vehicle is a variable quantity; in such a scenario, obtaining the accurate speed is essential for cluster head stability. This issue has been addressed in this paper; the authors have predicted each vehicle’s current location, and this position has been used to calculate the befit factor. The authors showcase the validation through the comparative results.(ii)
The authors also intended to improve the VANET performance using an auxiliary facility, Road-Side Units (RSUs), improving the network’s performance. However, the trade-off between the number of RSUs for better coverage and the high installation and maintenance costs is resolved in this paper by considering the angle suspended by the lanes. The effect of crossroads is also included to avoid ambiguity in the direction of the lane.(iii)
The authors have presented spectrum sensing as a classification problem and proposed the sensing method based on the recurrent neural network by employing the LSTM. The signal’s power spectrum is given as input to the LSTM and uses various signal noise data types to train the network. The decision is made according to the confidence of the noise class. As the designed method is based on deep learning, the network automatically learns the parameters and can adapt well to different noise levels. This concept has been further extended to segregate the vehicles into two categories: the primary (PU) and secondary users. The primary includes vehicles like ambulance, a civic service that needs immediate assistance. The PU are given access to the network bandwidth and improve the stability of the VANET.(iv)
VANET has a dynamic topology where the vehicles travel at high speed and have frequent arrival with an irregular interval between them. To have a stable cluster, they have to be evolving in nature. The authors have designed the cluster-based evolving graph model that calculates the metrics that could select a stable cluster head to address this use.The authors designed a new multimetric weighted CH selection scheme that considers different selection metrics that increase the cluster stability and efficiency. The designed scheme is well tested on the real data map, taken for the region Chengdu, southwestern China’s Sichuan province. The clustering efficiency is tested for various vehicle densities, and also the network performance is evaluated using the parameters. The rest of the paper is organized as follows: In Section2, the network model and the position prediction using the Kalman filter and the RSU placement are presented. In Section 3, the multimetric weighted CH selection scheme is discussed with all its metrics. Section 5 presents the simulation work and compares the proposed scheme with the existing state of the art. In the last section, the authors conclude the work with the prospects of the work.


## 2. Network Model with Prediction and RSU Deployment

The proposed scheme is mainly concentrated on the highway environment. Here, the model is specially designed for vehicles that are well equipped with a positioning system (e.g., a GPS), which acquires information about the current location and an IEEE 802.11p-compliant radio transceiver that enables the communication between the other vehicles and the RSU (Road-Side Unit). The cars typically share different geographical proximity information, which can be harnessed for effective traffic management and organization. The designed weighted, dynamic, adaptive, and fuzzy clustering algorithm is manifested on the same ideology [20–22]. Here, the vehicles are grouped in small clusters based on their proximity concerning the RSU deployed near the lanes. A cluster head (CH) is selected based on the amalgamation of four components befit, trust, community neighborhood, and eccentricity. The rest are cluster members (CM). There is an exchange of information among the members using Vehicle-to-Vehicle (V2V) communication. The complete knowledge is like the parameter speed, acceleration, distance travelled, location, and so on, which are maintained in each CM. The CH plays its role in broadcasting important information to the in-range RSU and the CM.In this section, a detailed discussion of the designed model is done. Each parameter for the CH selection is examined and modeled without increasing the network’s complexity and overhead delay.


### 2.1. Network Model

The network model considered is shown in Figure2(a) that shows the nodes in the VANET in an unclustered fashion. In Figure 2(b), the nodes are now under each cluster head in continuous communication with the RSU. The network model’s consideration is as follows: (1) The real-time road map is taken for the study. (2) The vehicle mobility is considered for a fixed time interval for study. (3) Each vehicle is considered as a node that is variable with time, and each car possesses a unique ID. (4) RSUs are effectively placed in each lane with proper analysis of the road with an identical communication range. (5) Each vehicle and the RSU are equipped with buffer memory and a GPS device for real-time data collection and synchronization. (6) The communication among the CM and CH-CM is enabled through V2V. (7) Each vehicle’s position is estimated through the Kalman filter that intimates the RSU about the range of vehicles and ensures noninterruptible communication with smooth transitions among the RSU. (8) The network over time evolves into several dynamic clusters; the maximum hops between the cluster head and its CM are maxing hop. (9) Packet data of size 64 bits is taken.Figure 2
The proposed analogy for VANET clustering: (a) flat structure and (b) cluster concept with CH and RSU.
(a)(b)


### 2.2. RSU Deployment

To overcome the shortcomings of overhead delay and fewer storage facilities, the vehicles need an auxiliary facility like Road-Side Units (RSUs) to improve network performance. There is always a trade-off between the areas’ total coverage with a sufficient number of RSUs with minimum installation and maintenance cost. This leads to the search for optimal locations where the RSU can maintain an efficient communication channel at a low price. The location affects communication as any void area will cause a drop of packets transferred among the vehicle and RSU. In this deployment, the lane coordinates are obtained from the SUMO simulation. Each RSU is assumed with a fixed circular transmission rangeRSUtranL−ID. There are placed on either of the roadsides. This ensures no interference in the coverage range of RSU and each lane as sufficient coverage without any void area [23]. The deployment coordinates are calculated using the particular direction of the lane through the geometric methodology. At the beginning of any lane, an RSU is placed to get the next location lane curvature cos∅ which is used. Let the location of any point on the lane be expressed as x,y. The next location is calculated as(1)xnext=xold+RSUtranL−ID∗cos∅,ynext=yold+RSUtranL−ID∗sin∅.That takes into consideration the RSU transmission range. With the introduction of the angle factor, the cross-lane will not suffice to formulate such conditions. There are few checkpoints designed that could ensure that cross-lane will be utilized to place the RSU continuously. The deployment of the RSU is shown in Figure3.Figure 3
The deployment of RSU on the lane for the circular transmission range.


### 2.3. Location Prediction

After optimally placing the RSU on the desired area map, the next task is to reduce the drop rate in the communication between the RSU and CH. This will ensure better overall network performance and increase the reliability of the VANET. To make this possible, the RSU must be aware of the vehicle’s next stamp position beforehand. In this work, the authors have utilized the work proposed by Kalman [24, 25] that predicts the vehicle’s location with geographical routing. The prediction of the vehicle’s location depends on the direction and the velocity. Also, it has been observed that the vehicle’s angle plays a crucial role in predicting the position as it varies over time. The prediction is made using the Kalman filter. Each vehicle runs a Kalman filter prediction, which predicts the vehicles’ position, velocity, and direction. The position vector at the moment t is xt=xt,yt,Vvehit,ϕt^T and the predicted values for each parameter at the next instant are(2)xˇt=x^t,y^t,Vvehi^t,ϕ^t^T,x^t+1=x^t+Vvehi^t×cos∅^t×ΔT,y^t+1=y^t+Vvehi^t×sin∅^t×ΔT.The individual RSU scans for vehicles in its range; then using the following judgment equation, new predicted positions are derived. The difference between the past and the predicted position is used to get the new update value with the information on the angle suspended by the lane.


## 2.1. Network Model

The network model considered is shown in Figure2(a) that shows the nodes in the VANET in an unclustered fashion. In Figure 2(b), the nodes are now under each cluster head in continuous communication with the RSU. The network model’s consideration is as follows: (1) The real-time road map is taken for the study. (2) The vehicle mobility is considered for a fixed time interval for study. (3) Each vehicle is considered as a node that is variable with time, and each car possesses a unique ID. (4) RSUs are effectively placed in each lane with proper analysis of the road with an identical communication range. (5) Each vehicle and the RSU are equipped with buffer memory and a GPS device for real-time data collection and synchronization. (6) The communication among the CM and CH-CM is enabled through V2V. (7) Each vehicle’s position is estimated through the Kalman filter that intimates the RSU about the range of vehicles and ensures noninterruptible communication with smooth transitions among the RSU. (8) The network over time evolves into several dynamic clusters; the maximum hops between the cluster head and its CM are maxing hop. (9) Packet data of size 64 bits is taken.Figure 2
The proposed analogy for VANET clustering: (a) flat structure and (b) cluster concept with CH and RSU.
(a)(b)


## 2.2. RSU Deployment

To overcome the shortcomings of overhead delay and fewer storage facilities, the vehicles need an auxiliary facility like Road-Side Units (RSUs) to improve network performance. There is always a trade-off between the areas’ total coverage with a sufficient number of RSUs with minimum installation and maintenance cost. This leads to the search for optimal locations where the RSU can maintain an efficient communication channel at a low price. The location affects communication as any void area will cause a drop of packets transferred among the vehicle and RSU. In this deployment, the lane coordinates are obtained from the SUMO simulation. Each RSU is assumed with a fixed circular transmission rangeRSUtranL−ID. There are placed on either of the roadsides. This ensures no interference in the coverage range of RSU and each lane as sufficient coverage without any void area [23]. The deployment coordinates are calculated using the particular direction of the lane through the geometric methodology. At the beginning of any lane, an RSU is placed to get the next location lane curvature cos∅ which is used. Let the location of any point on the lane be expressed as x,y. The next location is calculated as(1)xnext=xold+RSUtranL−ID∗cos∅,ynext=yold+RSUtranL−ID∗sin∅.That takes into consideration the RSU transmission range. With the introduction of the angle factor, the cross-lane will not suffice to formulate such conditions. There are few checkpoints designed that could ensure that cross-lane will be utilized to place the RSU continuously. The deployment of the RSU is shown in Figure3.Figure 3
The deployment of RSU on the lane for the circular transmission range.


## 2.3. Location Prediction

After optimally placing the RSU on the desired area map, the next task is to reduce the drop rate in the communication between the RSU and CH. This will ensure better overall network performance and increase the reliability of the VANET. To make this possible, the RSU must be aware of the vehicle’s next stamp position beforehand. In this work, the authors have utilized the work proposed by Kalman [24, 25] that predicts the vehicle’s location with geographical routing. The prediction of the vehicle’s location depends on the direction and the velocity. Also, it has been observed that the vehicle’s angle plays a crucial role in predicting the position as it varies over time. The prediction is made using the Kalman filter. Each vehicle runs a Kalman filter prediction, which predicts the vehicles’ position, velocity, and direction. The position vector at the moment t is xt=xt,yt,Vvehit,ϕt^T and the predicted values for each parameter at the next instant are(2)xˇt=x^t,y^t,Vvehi^t,ϕ^t^T,x^t+1=x^t+Vvehi^t×cos∅^t×ΔT,y^t+1=y^t+Vvehi^t×sin∅^t×ΔT.The individual RSU scans for vehicles in its range; then using the following judgment equation, new predicted positions are derived. The difference between the past and the predicted position is used to get the new update value with the information on the angle suspended by the lane.


## 3. Dynamic Weighted Cluster Head Stability Algorithm

The designed clustering model has been broadly classified into two parts: (1) cluster formation and (2) CH selection. In the cluster formation, the vehicles are segregated into small groups and then based on a weighted approach, a weighted formulation of four metric befit factorBF, community neighborhood CN, eccentricity Ecc, and trust T is designed to select the cluster head, and also these parameters ensure the stability of the cluster head over the time. All of these metrics are normalized to avoid the overriding effect.


### 3.1. Cluster Formation

The RSU guides the cluster formation. Algorithm1 encapsulates the cluster formation where each vehicle enters the lane for the first timestamp broadcast and communicates with all the RSU in its communication range. To form a stable cluster, two conditions are observed for that timestamp, the distance D and relative change in the vehicle’s speed Vvehi in that timestamp. A distance between the RSU and that car is calculated. If this distance is less than a threshold ΔDthr, the vehicle is attached to that RSU temporarily. This process is carried out for all the vehicles present in the vicinity and moving in the same direction. In the real-time scenario, each vehicle’s speed level may be different, and this variation can seriously affect the cluster formation. For stable cluster formation, the change in relative speed is also observed if it is less than a threshold ΔVthr and then that vehicle gets permission to get permanently attached to that RSU. Now, the RSU stores the ID of that vehicle and becomes a cluster member (CM).Algorithm 1:Cluster formation.
Input: VelocityVvehi and location x,y; the number of the lanes in a map no_lane; time_spanOutput: Cluster (C),N no of clustersFort = 1:time_spanFori=1:no_laneIf any vehicle detected inRSUtranL−IDD: RSU locationxRSU,yRSU and vehicles location xvehi,yvehiVvehi: Speed of the vehicleIfD<ΔDthr‖Vvehi<ΔVthrRSU⟵IDEndifC⟵RSU,∀IDEndifEndEndN⟵∀C;C≠Null.


### 3.2. Cluster Head Selection

The next step is selecting the cluster head, and it is a node in VANET that coordinates or heads the cluster. It takes the responsibility of broadcasting, discovery, and maintenance of the routing path. It remains in the contact of the RSU to sustainably maintain the intra- and intercommunication channels. The main motive of designing any clustering algorithm is the stability of the cluster head in VANET. The vehicles’ high dynamic mobility can lead to frequent reclustering and eventually decreases the cluster stability. The methodology designed in this paper for the cluster head selection is a weighted combination of four factors, as mentioned above. All these parameters direct towards the search for a stable CH. All these and their amalgamation for selecting a suitable CH are discussed in the following.


#### 3.2.1. Befit FactorBF

This parameter is defined to maximize the stability of the cluster structure. To ensure this, the elected CH is expected to stay connected with all the cluster members for a longer duration. Thus, theBF is derived from the three metrics as designed in [19](3)BF=w1×Tleave+w2×ψvehi+w3×NHD,where w1,w2, and w3 are the corresponding weights that vary in the range 0,1 satisfying the condition that w1+w2+w3=1 and can be reformulated by the local authority based on the road conditions and the cluster member behavior. The first metric is Tleave, which is time to leave; this is the time required for a vehicle to complete the lane’s remaining segment. This factor ensures selecting a CH with enough time left to complete the lane that makes it head for a longer time. It is calculated using L, the length of the lane, and D, the distance covered by a vehicle on the road segment, and t, the time consumed by the vehicle to drive that D section of the lane.(4)Tleave=L−Dt.The second metric isψvehi defined as relative average speed; this parameter determines how close a vehicle’s velocity is to its neighbors. A reward function is conceived that takes into account the velocity of vehicles over the long term. Speed of each vehicle Vvehi is evaluated. Accordingly, their speed is either rewarded or penalized with an absolute value δ; correspondingly, the relative average speed is incremented or decremented, as shown in(5)ψvehit+1=ψvehit+δ;Vvehi−Vavg≤Sthr,ψvehit+1=ψvehit−δ;Vvehi−Vavg>Sthr,where Sthr is the parameter that ensures that the vehicle moving with the velocity Vvehi is almost travelling at the same speed as that of the neighbors. The initial value of ψvehi is calculated using the TraCI parameters, and δ is taken as 0.01. The last metric is neighborhood degree NHD, and it is defined as the number of the neighbors whose speed difference with the vehicle is less than a threshold Sthr.


#### 3.2.2. EccentricityEcc

The next parameter is eccentricity; in real time, communication links break more frequently due to the vehicles’ high speed. To maintain the link, there is a requirement for an evolving cluster model. Usually, reclsutering will become inevitable once the CH resigns or loses its suitability to continue as a CH. To ensure stability, the concept of eccentricity is introduced. Here, an evolving graph-based model is designed by using spectral clustering. A vehicular graph topology is intended to beGM,E,rl, where M is the number of vehicles present in the timestamp t, E is the ordered pair of the links among the vehicles, and rl is the link reliability. The affinity matrix is constructed to represent the graph topology for dimensions M×M.(6)A=rij,ifDi,Dj∈E,0,ifi=j,∞,otherwise,A=r11…r1M⋮r22⋮rM1…rMM.The tool employed for the spectral clustering is the Laplacian graph. The Laplacian graph is calculated for the affinity matrix:(7)GL=Dig−A,where Dig is the diagonal matrix with elements. Also,(8)dij=∑Aij.In spectral clustering, eigenvectors of a similarity/affinity matrix are derived from the original dataset. The eigendecomposition of the graph will be serving as the model for dimensionality reduction of mobile vehicles. The optimal number of clusters is calculated by using the eigenvalue of the Laplacian graph. Based on the eigenmap heuristic [26], the eigenvalues λi;i=1,2,…,M get sorted in the ascending order out of whichk is picked that serves as the clusters in that timestamp.(9)k=argmaxλi+1−λi.After the number of the clusters is obtained, thenk eigenvectors are extracted in a matrix with dimensionality M×k. In the last, K-means is applied to get the optimal number of clusters. Ecc is the mean/average eigenscore of each group that is calculated as in [27](10)Ecci=1Ni∑λiεNiλi.The maximum value ofEcc ensures a stable cluster head selection designed based on the evolving graph.


#### 3.2.3. Community NeighborhoodCN

The evolving Laplacian graph also provides information about neighbors. The importance of neighbor ensures the CH’s stability as the cluster member will not change for a given timestamp that will establish a reliable link among them. There is designing of theCN using the transmission factor TRF; it represents the reliability of the connection between two vehicles that satisfy the following condition:(11)TRFrij=0,ifrij<TR,TR2−rijTR2,if0<rij≤1,where TRF is the maximum transmission range of the vehicle and rij is the distance between those two vehicles at the timestamp t. There is a negative correlation between the distance and transmission range. This enables that if two vehicles are closer, then a more reliable connection is bound. The neighbor nodes are defined as those vehicles that satisfy the condition TRFrij>0. Then, the next step is to count neighbor connection centrality that is defined as follows:(12)NCC=∑rij∈NETRFrij.The last step is to getCN, the weighted average of NCC over the timestamp t [28].(13)CN=wi×NCC,where wi is the weighted associated at each timestamp.


#### 3.2.4. TrustT

The type of vehicle also plays an essential role in cluster stability; this is an efficient technique for dealing with malicious and compromised nodes [29]. To address this problem, the authors have included the notion of spectrum sensing. Here, concepts are addressed that could remarkably enhance the cluster head’s stability in the network. The first is the spectrum sensing technique that helps to utilize the spectrum efficiently. Here, the spectrum sensing is taken as a classification problem using the long short-term memory (LSTM). The network is trained using various types of signal and noise data. Data can be handled by using the latest technology called big data handling [30, 31], though this decision is made on the confidence of the noise class. Since the method includes a recurrent neural network, it automatically learns the energy features and adapts to any untrained noise or signal in a real and dynamic environment. This enables the detection of the primary users’ (PU), like medical vans, police vans, or any other type of civil service, to use the spectrum as a priority if there is an emergency. The rest is considered the secondary users (SU). In the following section, the formulation to address the above-stated issues is discussed.LSTM Model Design. The internal structure of LSTM is shown in Figure 4. Here, Yt is the input to the cell structure, and output is denoted by at. The previous cell input is taken as at−1, current and previous cell states are represented by ctandct−1. σf, σu, and σ0 show the value of three gates forget gate, update gate, and output gate, respectively. The Hadamard function is denoted by ⊙, and tanh shows the activation function with elementwise addition ⊕.Figure 4
Internal structure LSTM network.Any LSTM cell constitutes three main gates: update gate, forget gate, and output gate. The function of each gate is stated as follows:(i)
Update gateσu: decide when to update the current cell state(ii)
Forget gateσf: discard function of the current cell(iii)
Output gateσ0: provided to the output through the output gateThe updated vector for each state is obtained through(14)c˜t=tanhwcat−1,Yt+bc,where bc is the bias term and tanh is the activation function. All the three gates get updated using the individual bias and the sigmoid function.(15)Γμ=σwμat−1,Yt+bμ,Γf=σwfat−1,Yt+bf,Γ0=σw0at−1,Yt+b0,σm=11+e−m,where wμ,wf,andw0 are the weight matrices. The bias terms are denoted by bμ,bf, and bo. An elementwise product is taken among the previous cell state ct−1 and forget gate Γf and among the update gate and candidate vector updating c˜t. The elementwise product among the output gate Γ0 and hyperbolic tangent vector ct is as follows:(16)ct=Γμ⊙c˜t+Γf⊙ct−1,at=Γ0⊙tanhct.The architecture designed in this study has two-bit layer with every 100 nodes and a fully connected layer followed by a SoftMax layer as the decision is no binary bases. The network is trained for 500 epochs, having a learning rate of 0.01, and the batch size of the data chunk at a time is 500.Data Modeling. The data is captured through the ideal probability of the primary user. We consider that each vehicle takes part in the Cognitive Radio (CR) networking to transfer the information. The bandwidth allotted to the network is limited, so limited spectrum uses CR. The free spectrum of the PU can be utilized by secondary users, reducing the overhead problem. In PU’s presence, the spectrum will be released for that vehicle if it receives a signal with an energy higher than the threshold signal energy. The factor trust T is increased if it a primary user and belongs to that neighborhood; else, the trust value is decremented. The behavior of the PU is mapped through the quantized energy vector called the sensing report. The actual status of the PU is estimated through the acknowledgment signal along with the fusion of reliable local decision of CR. The clean PU signal is acquired, and its power is measured as σx2. The Gaussian noise is added to the computed power signal of PU to achieve signal-to-noise ratio (SNR) γ and evaluate by using the relation σw2=σx2/γ.Adaptive sensing at the individual vehicle level is as follows:(17)ℋ0:Yt=wt,ℋ1:Yt=htXt+wt,where Yt is the signal envelop received at the t-th time instant by the sensing vehicle, the PSU signal is distorted using wt an Additive White Gaussian noise with zero mean and variance σ2, Xt is the SNR signal transmitted from the PU transmitter, and ht is the channel gain [32]. This hypothesis can be viewed as a classification problem where there is a signal from the primary user or the presence of noise. The signal received at any instant is represented in general form with the previous sensing event of sample size M being fed to the current sensing event:(18)Y=Y1Y2,…,YMYM+1YM+2,…,Y2MT,where M is the sample size taking into consideration these number of vehicles at timestamp t and the transpose of a vector is denoted by .T. Here, the probability of detection and the probability of false alarm are used to detect the performance of the spectrum sensing algorithm, which are defined as(19)Pd=PrH1|H1,Pf=PrH1|H0.The presence of the PU signal is denoted byH1 while absence by H0 in that case, the only noise is detected. At a given M sensing sample, the energy test statistic is represented by the energy that calculates test statistics TY in the time domain to compare with, which follows the Neyman–Pearson criteria.(20)TY=12N∑i=1NYire+Yiim2.The test statisticTY is the random variable with a chi-square probability distribution function χ2 with kdegrees of freedom. It can also be represented as Q=∑i=1kzi2. Here, k=2N for the complex-valued case and k=N for absolute values. The threshold ε can be defined using the central limit theorem. The detection probability can be defined as [33](21)Pdε,t=ℚεσu2−γ−1tfs2γ+1,where ℚ. is the complementary distribution function and is Gaussian in nature; that is, (22)ℚx=12π∫x∞exp−t22dt.If we take the inverse of equation (21), then the threshold for probability detection can be calculated as(23)ℚ−1Pd=εσu2−γ−1tfs2γ+1.The false detectionPf is calculated as(24)ℚ−1Pf=εσu2−1tfs.In the Rayleigh transmission channel, the converted carrier band signal is passed:(25)ht=∑p=1NpApδt−tp,where Np are several paths, Ap is channel gain, and tp is the delay in pth path. The signal moves in the line of sight (LOS) considered by a free-space path loss propagation model and receives power calculated as follows:(26)Pr=Gl×ϱ24πd2×Pt.The received and transmitted power are notated asPr and Pt with wavelength ϱ. The LOS distance is denoted by d, and the factor dependent defines field radiation of PU and SU upon the antenna Gl. The square of the distance between PU and SU is inversely proportional to the received power. The noise variance is added to the received power and updates the actual power value. The noisy channel is modeled as the convolution of Rayleigh channel response and noise variance where nt is noise variance.(27)gt=ht∗nt.This completes the design of the spectrum sensing structure.In the training of LSTM, the behavior of CR users to the changing activity of PU in the operating environment is learned. The sensing report is generated by the CR user and makes a local decision based on its energy. Based on the outcomes, the acknowledgment signal status, the report is assigned to a sensing class. The information of the primary user is forwarded to the data center that decides spectrum sensing. The bandwidth of the transmitted signal is divided intoNs subcarriers and transmitted in chunks. These subcarriers are frequency spaced by Δf=1/Td where Td is time to transmit a signal. The signals are multiplexed using inverse discrete Fourier transform (IDFT) as(28)ybt=∑k=1NsYkej2πkΔft.Every secondary node senses the energy of the transmitted signal by PU, and based on the comparison with a thresholdℚ−1 from equation (23), it decides whether it is from the primary user and to vacate the channel. This energy received enables the calculation of the trust value. Figure 4 portrays the complete model for the training using the concept of spectrum sensing and then obtaining the trust value. Pd and Pf are evaluated in the proposed scheme LSTM-based spectrum sensing detection. The signals collected are fed to the LSTM network one by one, and the corresponding values of the detection and false alarm probability are computed. The primary signal vector of each SNR value is processed to the LSTM network. The number of times it correctly classified the signal H1 divided by the total number of primary user signals fed to the network determines Pd. Similarly, the noise sequence is forwarded to the LSTM network and calculates the false alarm probability Pf. The hypothesis H0 is divided by the total number of noise sequences used in the prediction. The complete model designed for predicting the vehicle’s trust value using LSTM is shown in Figure 5.Figure 5
Adaptive spectrum sensing using LSTM.As discussed above, adaptive spectrum sensing is implemented for forming trust based on the energy detector’s threshold. The threshold is set to the target that is the desired constant probability of detection.The limits are as obtained from equation (23). The energy of the vehicle received is given to the trained LSTM network. The network decides whether the vehicle is a primary user or not, and in turn, the value of the trust is assigned if it successfully vacates the spectrum. This adaptive spectrum sensing is done using the trained data using the LSTM. In Figure 6, the training curve of LSTM is elucidated, where the loss function, along with the accuracy, is plotted for 3,500 epochs. The loss defines the difference between the actual and predicted values of the primary users’ signals in various data and noise signals.Figure 6
Training progress of designed LSTM for 3,500 iterations.The analysis of trained LSTM is depicted in terms of the confusion matrix, as shown in Figure7. Here, the adaptive spectrum sensing problem is formulated as a classification problem illustrated in equation (17). This prediction is made for a total of 4,000 vehicles. This binary classifier’s accuracy is 89% for the correct detection of the absence of any PU and 83.5% for any PU presence in the network. This designed LSTM model is efficient and can predict with sufficient accuracy, even in various noise conditions and mixed signals. A comparison between Pd generated from the theoretical analysis as designed in [34] and Pd for the trained LSTM is shown in Figure 8. Since Pd,max=1, the higher the probability, the better the trust score, and accordingly, the vehicle is considered trustworthy. This completes the design and evaluation of the trust metric. Now, the proposed weighted CH selection is discussed in the following in detail.Figure 7
Confusion matrix for performance analysis of the classifier designed using LSTM.Figure 8
Comparison between the probability of detection and probability of false alarm using the proposed spectrum sensing LSTM method.The complete algorithm for the CH selection is explained in Algorithm2. All the above parameters discussed are incorporated, and a weighted metric is formulated for selecting a stable cluster head for a maximum period [35]. The number of vehicles in a time instant is firstly clustered using the RSU as discussed in Algorithm 1. Then, for all the members (CM), the above four parameters are calculated, and then a weighted CHscore is calculated to select the cluster head as discussed in Algorithm 2.Algorithm 2:CH selection.
Input: Relative SpeedVvehi and Location x,y;Number of the lane in a mapno_lane;time_span; Cluster (C), N no of clusters.Output: CHFort = 1:time_spanFori=1:NForj = 1: CMObtain theBF using the equation (3)Calculate therij; affinity matrixFabricate the evolving graphG for each clusterFind the maximum eigenvaluesλ ; calculate Eccj using equation (10)Determine the neighbor and find theCNusing equation (12)From the LSTM trained network, calculate theTObtain theCH_score for each CMCHscore=w1×BF+w2×Ecc+w3×CN+w4×Tw1+w2+w3+w4=1EndCH=maxCHscore∀jEndEnd


### 3.3. Computational Complexity of the Designed Complete Algorithm

In this section, the computational complexity of the dynamic weighted algorithm is discussed. The clustering algorithm is divided into two parts, the cluster formation and cluster head selection. Thus, the total time complexity of the algorithm can be stated as(29)Otot=OCF+OCHS,where OCF is the time complexity of cluster formation and OCHS is the cluster head selection.In cluster formation, as already discussed in Section3.1, the authors find only the distance between the vehicles and the RSU. M is the maximum number of vehicles taken in the worst-case analysis. Thus, the worst-case time complexity for this is(30)OCF=OlogM2.In the cluster head selection, there are four parameters taken into consideration. The total time complexity for the cluster head selection is(31)OCHS=OBF+OEcc+OCN+OT.The complexity of BF is a linear equation, where three things have been calculated, the time to leave, relative average speed, and the neighborhood degree. The time to leave and the relative average speed are only the constant values fetched and calculated. In contrast, in the neighborhood degree, the distance between the vehicles in the vicinity is calculated through their coordinates. Thus,(32)OBF=O1+O1+OlogM2.The next is the eccentricity, calculated using the spectral clustering methods that involve the affinity matrix and the eigenvalue decomposition. The complete complexity of spectral clustering is(33)OEcc=OM2+OM3.In the community neighborhood, an affinity matrix is generated for the near adjacent vehicles. Thus, the complexity for this is given as(34)OCN=OlogM2.In the metric trust, the main role is played by the LSTM for spectrum sensing; the theoretical time complexity of LSTM is given as(35)OTH=4IH+4H2+3H+HK,where I is the number of inputs, K is the number of outputs, and H is the number of hidden layers. In this study, as the model is trained once and then for a given vehicles signal, the LSTM, through its spectrum sensing, senses the vehicle either being a primary or secondary user. Thus, the time complexity bottles down to(36)OT=O4H2.Thus, the complete time complexity is reduced to removing all the terms with less complexity than cubic and quadratic terms.(37)OCH=2OlogM2+OM3.Thus, the total time complexity is(38)Otot=3OlogM2+OM3.


## 3.1. Cluster Formation

The RSU guides the cluster formation. Algorithm1 encapsulates the cluster formation where each vehicle enters the lane for the first timestamp broadcast and communicates with all the RSU in its communication range. To form a stable cluster, two conditions are observed for that timestamp, the distance D and relative change in the vehicle’s speed Vvehi in that timestamp. A distance between the RSU and that car is calculated. If this distance is less than a threshold ΔDthr, the vehicle is attached to that RSU temporarily. This process is carried out for all the vehicles present in the vicinity and moving in the same direction. In the real-time scenario, each vehicle’s speed level may be different, and this variation can seriously affect the cluster formation. For stable cluster formation, the change in relative speed is also observed if it is less than a threshold ΔVthr and then that vehicle gets permission to get permanently attached to that RSU. Now, the RSU stores the ID of that vehicle and becomes a cluster member (CM).Algorithm 1:Cluster formation.
Input: VelocityVvehi and location x,y; the number of the lanes in a map no_lane; time_spanOutput: Cluster (C),N no of clustersFort = 1:time_spanFori=1:no_laneIf any vehicle detected inRSUtranL−IDD: RSU locationxRSU,yRSU and vehicles location xvehi,yvehiVvehi: Speed of the vehicleIfD<ΔDthr‖Vvehi<ΔVthrRSU⟵IDEndifC⟵RSU,∀IDEndifEndEndN⟵∀C;C≠Null.


## 3.2. Cluster Head Selection

The next step is selecting the cluster head, and it is a node in VANET that coordinates or heads the cluster. It takes the responsibility of broadcasting, discovery, and maintenance of the routing path. It remains in the contact of the RSU to sustainably maintain the intra- and intercommunication channels. The main motive of designing any clustering algorithm is the stability of the cluster head in VANET. The vehicles’ high dynamic mobility can lead to frequent reclustering and eventually decreases the cluster stability. The methodology designed in this paper for the cluster head selection is a weighted combination of four factors, as mentioned above. All these parameters direct towards the search for a stable CH. All these and their amalgamation for selecting a suitable CH are discussed in the following.


### 3.2.1. Befit FactorBF

This parameter is defined to maximize the stability of the cluster structure. To ensure this, the elected CH is expected to stay connected with all the cluster members for a longer duration. Thus, theBF is derived from the three metrics as designed in [19](3)BF=w1×Tleave+w2×ψvehi+w3×NHD,where w1,w2, and w3 are the corresponding weights that vary in the range 0,1 satisfying the condition that w1+w2+w3=1 and can be reformulated by the local authority based on the road conditions and the cluster member behavior. The first metric is Tleave, which is time to leave; this is the time required for a vehicle to complete the lane’s remaining segment. This factor ensures selecting a CH with enough time left to complete the lane that makes it head for a longer time. It is calculated using L, the length of the lane, and D, the distance covered by a vehicle on the road segment, and t, the time consumed by the vehicle to drive that D section of the lane.(4)Tleave=L−Dt.The second metric isψvehi defined as relative average speed; this parameter determines how close a vehicle’s velocity is to its neighbors. A reward function is conceived that takes into account the velocity of vehicles over the long term. Speed of each vehicle Vvehi is evaluated. Accordingly, their speed is either rewarded or penalized with an absolute value δ; correspondingly, the relative average speed is incremented or decremented, as shown in(5)ψvehit+1=ψvehit+δ;Vvehi−Vavg≤Sthr,ψvehit+1=ψvehit−δ;Vvehi−Vavg>Sthr,where Sthr is the parameter that ensures that the vehicle moving with the velocity Vvehi is almost travelling at the same speed as that of the neighbors. The initial value of ψvehi is calculated using the TraCI parameters, and δ is taken as 0.01. The last metric is neighborhood degree NHD, and it is defined as the number of the neighbors whose speed difference with the vehicle is less than a threshold Sthr.


### 3.2.2. EccentricityEcc

The next parameter is eccentricity; in real time, communication links break more frequently due to the vehicles’ high speed. To maintain the link, there is a requirement for an evolving cluster model. Usually, reclsutering will become inevitable once the CH resigns or loses its suitability to continue as a CH. To ensure stability, the concept of eccentricity is introduced. Here, an evolving graph-based model is designed by using spectral clustering. A vehicular graph topology is intended to beGM,E,rl, where M is the number of vehicles present in the timestamp t, E is the ordered pair of the links among the vehicles, and rl is the link reliability. The affinity matrix is constructed to represent the graph topology for dimensions M×M.(6)A=rij,ifDi,Dj∈E,0,ifi=j,∞,otherwise,A=r11…r1M⋮r22⋮rM1…rMM.The tool employed for the spectral clustering is the Laplacian graph. The Laplacian graph is calculated for the affinity matrix:(7)GL=Dig−A,where Dig is the diagonal matrix with elements. Also,(8)dij=∑Aij.In spectral clustering, eigenvectors of a similarity/affinity matrix are derived from the original dataset. The eigendecomposition of the graph will be serving as the model for dimensionality reduction of mobile vehicles. The optimal number of clusters is calculated by using the eigenvalue of the Laplacian graph. Based on the eigenmap heuristic [26], the eigenvalues λi;i=1,2,…,M get sorted in the ascending order out of whichk is picked that serves as the clusters in that timestamp.(9)k=argmaxλi+1−λi.After the number of the clusters is obtained, thenk eigenvectors are extracted in a matrix with dimensionality M×k. In the last, K-means is applied to get the optimal number of clusters. Ecc is the mean/average eigenscore of each group that is calculated as in [27](10)Ecci=1Ni∑λiεNiλi.The maximum value ofEcc ensures a stable cluster head selection designed based on the evolving graph.


### 3.2.3. Community NeighborhoodCN

The evolving Laplacian graph also provides information about neighbors. The importance of neighbor ensures the CH’s stability as the cluster member will not change for a given timestamp that will establish a reliable link among them. There is designing of theCN using the transmission factor TRF; it represents the reliability of the connection between two vehicles that satisfy the following condition:(11)TRFrij=0,ifrij<TR,TR2−rijTR2,if0<rij≤1,where TRF is the maximum transmission range of the vehicle and rij is the distance between those two vehicles at the timestamp t. There is a negative correlation between the distance and transmission range. This enables that if two vehicles are closer, then a more reliable connection is bound. The neighbor nodes are defined as those vehicles that satisfy the condition TRFrij>0. Then, the next step is to count neighbor connection centrality that is defined as follows:(12)NCC=∑rij∈NETRFrij.The last step is to getCN, the weighted average of NCC over the timestamp t [28].(13)CN=wi×NCC,where wi is the weighted associated at each timestamp.


### 3.2.4. TrustT

The type of vehicle also plays an essential role in cluster stability; this is an efficient technique for dealing with malicious and compromised nodes [29]. To address this problem, the authors have included the notion of spectrum sensing. Here, concepts are addressed that could remarkably enhance the cluster head’s stability in the network. The first is the spectrum sensing technique that helps to utilize the spectrum efficiently. Here, the spectrum sensing is taken as a classification problem using the long short-term memory (LSTM). The network is trained using various types of signal and noise data. Data can be handled by using the latest technology called big data handling [30, 31], though this decision is made on the confidence of the noise class. Since the method includes a recurrent neural network, it automatically learns the energy features and adapts to any untrained noise or signal in a real and dynamic environment. This enables the detection of the primary users’ (PU), like medical vans, police vans, or any other type of civil service, to use the spectrum as a priority if there is an emergency. The rest is considered the secondary users (SU). In the following section, the formulation to address the above-stated issues is discussed.LSTM Model Design. The internal structure of LSTM is shown in Figure 4. Here, Yt is the input to the cell structure, and output is denoted by at. The previous cell input is taken as at−1, current and previous cell states are represented by ctandct−1. σf, σu, and σ0 show the value of three gates forget gate, update gate, and output gate, respectively. The Hadamard function is denoted by ⊙, and tanh shows the activation function with elementwise addition ⊕.Figure 4
Internal structure LSTM network.Any LSTM cell constitutes three main gates: update gate, forget gate, and output gate. The function of each gate is stated as follows:(i)
Update gateσu: decide when to update the current cell state(ii)
Forget gateσf: discard function of the current cell(iii)
Output gateσ0: provided to the output through the output gateThe updated vector for each state is obtained through(14)c˜t=tanhwcat−1,Yt+bc,where bc is the bias term and tanh is the activation function. All the three gates get updated using the individual bias and the sigmoid function.(15)Γμ=σwμat−1,Yt+bμ,Γf=σwfat−1,Yt+bf,Γ0=σw0at−1,Yt+b0,σm=11+e−m,where wμ,wf,andw0 are the weight matrices. The bias terms are denoted by bμ,bf, and bo. An elementwise product is taken among the previous cell state ct−1 and forget gate Γf and among the update gate and candidate vector updating c˜t. The elementwise product among the output gate Γ0 and hyperbolic tangent vector ct is as follows:(16)ct=Γμ⊙c˜t+Γf⊙ct−1,at=Γ0⊙tanhct.The architecture designed in this study has two-bit layer with every 100 nodes and a fully connected layer followed by a SoftMax layer as the decision is no binary bases. The network is trained for 500 epochs, having a learning rate of 0.01, and the batch size of the data chunk at a time is 500.Data Modeling. The data is captured through the ideal probability of the primary user. We consider that each vehicle takes part in the Cognitive Radio (CR) networking to transfer the information. The bandwidth allotted to the network is limited, so limited spectrum uses CR. The free spectrum of the PU can be utilized by secondary users, reducing the overhead problem. In PU’s presence, the spectrum will be released for that vehicle if it receives a signal with an energy higher than the threshold signal energy. The factor trust T is increased if it a primary user and belongs to that neighborhood; else, the trust value is decremented. The behavior of the PU is mapped through the quantized energy vector called the sensing report. The actual status of the PU is estimated through the acknowledgment signal along with the fusion of reliable local decision of CR. The clean PU signal is acquired, and its power is measured as σx2. The Gaussian noise is added to the computed power signal of PU to achieve signal-to-noise ratio (SNR) γ and evaluate by using the relation σw2=σx2/γ.Adaptive sensing at the individual vehicle level is as follows:(17)ℋ0:Yt=wt,ℋ1:Yt=htXt+wt,where Yt is the signal envelop received at the t-th time instant by the sensing vehicle, the PSU signal is distorted using wt an Additive White Gaussian noise with zero mean and variance σ2, Xt is the SNR signal transmitted from the PU transmitter, and ht is the channel gain [32]. This hypothesis can be viewed as a classification problem where there is a signal from the primary user or the presence of noise. The signal received at any instant is represented in general form with the previous sensing event of sample size M being fed to the current sensing event:(18)Y=Y1Y2,…,YMYM+1YM+2,…,Y2MT,where M is the sample size taking into consideration these number of vehicles at timestamp t and the transpose of a vector is denoted by .T. Here, the probability of detection and the probability of false alarm are used to detect the performance of the spectrum sensing algorithm, which are defined as(19)Pd=PrH1|H1,Pf=PrH1|H0.The presence of the PU signal is denoted byH1 while absence by H0 in that case, the only noise is detected. At a given M sensing sample, the energy test statistic is represented by the energy that calculates test statistics TY in the time domain to compare with, which follows the Neyman–Pearson criteria.(20)TY=12N∑i=1NYire+Yiim2.The test statisticTY is the random variable with a chi-square probability distribution function χ2 with kdegrees of freedom. It can also be represented as Q=∑i=1kzi2. Here, k=2N for the complex-valued case and k=N for absolute values. The threshold ε can be defined using the central limit theorem. The detection probability can be defined as [33](21)Pdε,t=ℚεσu2−γ−1tfs2γ+1,where ℚ. is the complementary distribution function and is Gaussian in nature; that is, (22)ℚx=12π∫x∞exp−t22dt.If we take the inverse of equation (21), then the threshold for probability detection can be calculated as(23)ℚ−1Pd=εσu2−γ−1tfs2γ+1.The false detectionPf is calculated as(24)ℚ−1Pf=εσu2−1tfs.In the Rayleigh transmission channel, the converted carrier band signal is passed:(25)ht=∑p=1NpApδt−tp,where Np are several paths, Ap is channel gain, and tp is the delay in pth path. The signal moves in the line of sight (LOS) considered by a free-space path loss propagation model and receives power calculated as follows:(26)Pr=Gl×ϱ24πd2×Pt.The received and transmitted power are notated asPr and Pt with wavelength ϱ. The LOS distance is denoted by d, and the factor dependent defines field radiation of PU and SU upon the antenna Gl. The square of the distance between PU and SU is inversely proportional to the received power. The noise variance is added to the received power and updates the actual power value. The noisy channel is modeled as the convolution of Rayleigh channel response and noise variance where nt is noise variance.(27)gt=ht∗nt.This completes the design of the spectrum sensing structure.In the training of LSTM, the behavior of CR users to the changing activity of PU in the operating environment is learned. The sensing report is generated by the CR user and makes a local decision based on its energy. Based on the outcomes, the acknowledgment signal status, the report is assigned to a sensing class. The information of the primary user is forwarded to the data center that decides spectrum sensing. The bandwidth of the transmitted signal is divided intoNs subcarriers and transmitted in chunks. These subcarriers are frequency spaced by Δf=1/Td where Td is time to transmit a signal. The signals are multiplexed using inverse discrete Fourier transform (IDFT) as(28)ybt=∑k=1NsYkej2πkΔft.Every secondary node senses the energy of the transmitted signal by PU, and based on the comparison with a thresholdℚ−1 from equation (23), it decides whether it is from the primary user and to vacate the channel. This energy received enables the calculation of the trust value. Figure 4 portrays the complete model for the training using the concept of spectrum sensing and then obtaining the trust value. Pd and Pf are evaluated in the proposed scheme LSTM-based spectrum sensing detection. The signals collected are fed to the LSTM network one by one, and the corresponding values of the detection and false alarm probability are computed. The primary signal vector of each SNR value is processed to the LSTM network. The number of times it correctly classified the signal H1 divided by the total number of primary user signals fed to the network determines Pd. Similarly, the noise sequence is forwarded to the LSTM network and calculates the false alarm probability Pf. The hypothesis H0 is divided by the total number of noise sequences used in the prediction. The complete model designed for predicting the vehicle’s trust value using LSTM is shown in Figure 5.Figure 5
Adaptive spectrum sensing using LSTM.As discussed above, adaptive spectrum sensing is implemented for forming trust based on the energy detector’s threshold. The threshold is set to the target that is the desired constant probability of detection.The limits are as obtained from equation (23). The energy of the vehicle received is given to the trained LSTM network. The network decides whether the vehicle is a primary user or not, and in turn, the value of the trust is assigned if it successfully vacates the spectrum. This adaptive spectrum sensing is done using the trained data using the LSTM. In Figure 6, the training curve of LSTM is elucidated, where the loss function, along with the accuracy, is plotted for 3,500 epochs. The loss defines the difference between the actual and predicted values of the primary users’ signals in various data and noise signals.Figure 6
Training progress of designed LSTM for 3,500 iterations.The analysis of trained LSTM is depicted in terms of the confusion matrix, as shown in Figure7. Here, the adaptive spectrum sensing problem is formulated as a classification problem illustrated in equation (17). This prediction is made for a total of 4,000 vehicles. This binary classifier’s accuracy is 89% for the correct detection of the absence of any PU and 83.5% for any PU presence in the network. This designed LSTM model is efficient and can predict with sufficient accuracy, even in various noise conditions and mixed signals. A comparison between Pd generated from the theoretical analysis as designed in [34] and Pd for the trained LSTM is shown in Figure 8. Since Pd,max=1, the higher the probability, the better the trust score, and accordingly, the vehicle is considered trustworthy. This completes the design and evaluation of the trust metric. Now, the proposed weighted CH selection is discussed in the following in detail.Figure 7
Confusion matrix for performance analysis of the classifier designed using LSTM.Figure 8
Comparison between the probability of detection and probability of false alarm using the proposed spectrum sensing LSTM method.The complete algorithm for the CH selection is explained in Algorithm2. All the above parameters discussed are incorporated, and a weighted metric is formulated for selecting a stable cluster head for a maximum period [35]. The number of vehicles in a time instant is firstly clustered using the RSU as discussed in Algorithm 1. Then, for all the members (CM), the above four parameters are calculated, and then a weighted CHscore is calculated to select the cluster head as discussed in Algorithm 2.Algorithm 2:CH selection.
Input: Relative SpeedVvehi and Location x,y;Number of the lane in a mapno_lane;time_span; Cluster (C), N no of clusters.Output: CHFort = 1:time_spanFori=1:NForj = 1: CMObtain theBF using the equation (3)Calculate therij; affinity matrixFabricate the evolving graphG for each clusterFind the maximum eigenvaluesλ ; calculate Eccj using equation (10)Determine the neighbor and find theCNusing equation (12)From the LSTM trained network, calculate theTObtain theCH_score for each CMCHscore=w1×BF+w2×Ecc+w3×CN+w4×Tw1+w2+w3+w4=1EndCH=maxCHscore∀jEndEnd


## 3.2.1. Befit FactorBF

This parameter is defined to maximize the stability of the cluster structure. To ensure this, the elected CH is expected to stay connected with all the cluster members for a longer duration. Thus, theBF is derived from the three metrics as designed in [19](3)BF=w1×Tleave+w2×ψvehi+w3×NHD,where w1,w2, and w3 are the corresponding weights that vary in the range 0,1 satisfying the condition that w1+w2+w3=1 and can be reformulated by the local authority based on the road conditions and the cluster member behavior. The first metric is Tleave, which is time to leave; this is the time required for a vehicle to complete the lane’s remaining segment. This factor ensures selecting a CH with enough time left to complete the lane that makes it head for a longer time. It is calculated using L, the length of the lane, and D, the distance covered by a vehicle on the road segment, and t, the time consumed by the vehicle to drive that D section of the lane.(4)Tleave=L−Dt.The second metric isψvehi defined as relative average speed; this parameter determines how close a vehicle’s velocity is to its neighbors. A reward function is conceived that takes into account the velocity of vehicles over the long term. Speed of each vehicle Vvehi is evaluated. Accordingly, their speed is either rewarded or penalized with an absolute value δ; correspondingly, the relative average speed is incremented or decremented, as shown in(5)ψvehit+1=ψvehit+δ;Vvehi−Vavg≤Sthr,ψvehit+1=ψvehit−δ;Vvehi−Vavg>Sthr,where Sthr is the parameter that ensures that the vehicle moving with the velocity Vvehi is almost travelling at the same speed as that of the neighbors. The initial value of ψvehi is calculated using the TraCI parameters, and δ is taken as 0.01. The last metric is neighborhood degree NHD, and it is defined as the number of the neighbors whose speed difference with the vehicle is less than a threshold Sthr.


## 3.2.2. EccentricityEcc

The next parameter is eccentricity; in real time, communication links break more frequently due to the vehicles’ high speed. To maintain the link, there is a requirement for an evolving cluster model. Usually, reclsutering will become inevitable once the CH resigns or loses its suitability to continue as a CH. To ensure stability, the concept of eccentricity is introduced. Here, an evolving graph-based model is designed by using spectral clustering. A vehicular graph topology is intended to beGM,E,rl, where M is the number of vehicles present in the timestamp t, E is the ordered pair of the links among the vehicles, and rl is the link reliability. The affinity matrix is constructed to represent the graph topology for dimensions M×M.(6)A=rij,ifDi,Dj∈E,0,ifi=j,∞,otherwise,A=r11…r1M⋮r22⋮rM1…rMM.The tool employed for the spectral clustering is the Laplacian graph. The Laplacian graph is calculated for the affinity matrix:(7)GL=Dig−A,where Dig is the diagonal matrix with elements. Also,(8)dij=∑Aij.In spectral clustering, eigenvectors of a similarity/affinity matrix are derived from the original dataset. The eigendecomposition of the graph will be serving as the model for dimensionality reduction of mobile vehicles. The optimal number of clusters is calculated by using the eigenvalue of the Laplacian graph. Based on the eigenmap heuristic [26], the eigenvalues λi;i=1,2,…,M get sorted in the ascending order out of whichk is picked that serves as the clusters in that timestamp.(9)k=argmaxλi+1−λi.After the number of the clusters is obtained, thenk eigenvectors are extracted in a matrix with dimensionality M×k. In the last, K-means is applied to get the optimal number of clusters. Ecc is the mean/average eigenscore of each group that is calculated as in [27](10)Ecci=1Ni∑λiεNiλi.The maximum value ofEcc ensures a stable cluster head selection designed based on the evolving graph.


## 3.2.3. Community NeighborhoodCN

The evolving Laplacian graph also provides information about neighbors. The importance of neighbor ensures the CH’s stability as the cluster member will not change for a given timestamp that will establish a reliable link among them. There is designing of theCN using the transmission factor TRF; it represents the reliability of the connection between two vehicles that satisfy the following condition:(11)TRFrij=0,ifrij<TR,TR2−rijTR2,if0<rij≤1,where TRF is the maximum transmission range of the vehicle and rij is the distance between those two vehicles at the timestamp t. There is a negative correlation between the distance and transmission range. This enables that if two vehicles are closer, then a more reliable connection is bound. The neighbor nodes are defined as those vehicles that satisfy the condition TRFrij>0. Then, the next step is to count neighbor connection centrality that is defined as follows:(12)NCC=∑rij∈NETRFrij.The last step is to getCN, the weighted average of NCC over the timestamp t [28].(13)CN=wi×NCC,where wi is the weighted associated at each timestamp.


## 3.2.4. TrustT

The type of vehicle also plays an essential role in cluster stability; this is an efficient technique for dealing with malicious and compromised nodes [29]. To address this problem, the authors have included the notion of spectrum sensing. Here, concepts are addressed that could remarkably enhance the cluster head’s stability in the network. The first is the spectrum sensing technique that helps to utilize the spectrum efficiently. Here, the spectrum sensing is taken as a classification problem using the long short-term memory (LSTM). The network is trained using various types of signal and noise data. Data can be handled by using the latest technology called big data handling [30, 31], though this decision is made on the confidence of the noise class. Since the method includes a recurrent neural network, it automatically learns the energy features and adapts to any untrained noise or signal in a real and dynamic environment. This enables the detection of the primary users’ (PU), like medical vans, police vans, or any other type of civil service, to use the spectrum as a priority if there is an emergency. The rest is considered the secondary users (SU). In the following section, the formulation to address the above-stated issues is discussed.LSTM Model Design. The internal structure of LSTM is shown in Figure 4. Here, Yt is the input to the cell structure, and output is denoted by at. The previous cell input is taken as at−1, current and previous cell states are represented by ctandct−1. σf, σu, and σ0 show the value of three gates forget gate, update gate, and output gate, respectively. The Hadamard function is denoted by ⊙, and tanh shows the activation function with elementwise addition ⊕.Figure 4
Internal structure LSTM network.Any LSTM cell constitutes three main gates: update gate, forget gate, and output gate. The function of each gate is stated as follows:(i)
Update gateσu: decide when to update the current cell state(ii)
Forget gateσf: discard function of the current cell(iii)
Output gateσ0: provided to the output through the output gateThe updated vector for each state is obtained through(14)c˜t=tanhwcat−1,Yt+bc,where bc is the bias term and tanh is the activation function. All the three gates get updated using the individual bias and the sigmoid function.(15)Γμ=σwμat−1,Yt+bμ,Γf=σwfat−1,Yt+bf,Γ0=σw0at−1,Yt+b0,σm=11+e−m,where wμ,wf,andw0 are the weight matrices. The bias terms are denoted by bμ,bf, and bo. An elementwise product is taken among the previous cell state ct−1 and forget gate Γf and among the update gate and candidate vector updating c˜t. The elementwise product among the output gate Γ0 and hyperbolic tangent vector ct is as follows:(16)ct=Γμ⊙c˜t+Γf⊙ct−1,at=Γ0⊙tanhct.The architecture designed in this study has two-bit layer with every 100 nodes and a fully connected layer followed by a SoftMax layer as the decision is no binary bases. The network is trained for 500 epochs, having a learning rate of 0.01, and the batch size of the data chunk at a time is 500.Data Modeling. The data is captured through the ideal probability of the primary user. We consider that each vehicle takes part in the Cognitive Radio (CR) networking to transfer the information. The bandwidth allotted to the network is limited, so limited spectrum uses CR. The free spectrum of the PU can be utilized by secondary users, reducing the overhead problem. In PU’s presence, the spectrum will be released for that vehicle if it receives a signal with an energy higher than the threshold signal energy. The factor trust T is increased if it a primary user and belongs to that neighborhood; else, the trust value is decremented. The behavior of the PU is mapped through the quantized energy vector called the sensing report. The actual status of the PU is estimated through the acknowledgment signal along with the fusion of reliable local decision of CR. The clean PU signal is acquired, and its power is measured as σx2. The Gaussian noise is added to the computed power signal of PU to achieve signal-to-noise ratio (SNR) γ and evaluate by using the relation σw2=σx2/γ.Adaptive sensing at the individual vehicle level is as follows:(17)ℋ0:Yt=wt,ℋ1:Yt=htXt+wt,where Yt is the signal envelop received at the t-th time instant by the sensing vehicle, the PSU signal is distorted using wt an Additive White Gaussian noise with zero mean and variance σ2, Xt is the SNR signal transmitted from the PU transmitter, and ht is the channel gain [32]. This hypothesis can be viewed as a classification problem where there is a signal from the primary user or the presence of noise. The signal received at any instant is represented in general form with the previous sensing event of sample size M being fed to the current sensing event:(18)Y=Y1Y2,…,YMYM+1YM+2,…,Y2MT,where M is the sample size taking into consideration these number of vehicles at timestamp t and the transpose of a vector is denoted by .T. Here, the probability of detection and the probability of false alarm are used to detect the performance of the spectrum sensing algorithm, which are defined as(19)Pd=PrH1|H1,Pf=PrH1|H0.The presence of the PU signal is denoted byH1 while absence by H0 in that case, the only noise is detected. At a given M sensing sample, the energy test statistic is represented by the energy that calculates test statistics TY in the time domain to compare with, which follows the Neyman–Pearson criteria.(20)TY=12N∑i=1NYire+Yiim2.The test statisticTY is the random variable with a chi-square probability distribution function χ2 with kdegrees of freedom. It can also be represented as Q=∑i=1kzi2. Here, k=2N for the complex-valued case and k=N for absolute values. The threshold ε can be defined using the central limit theorem. The detection probability can be defined as [33](21)Pdε,t=ℚεσu2−γ−1tfs2γ+1,where ℚ. is the complementary distribution function and is Gaussian in nature; that is, (22)ℚx=12π∫x∞exp−t22dt.If we take the inverse of equation (21), then the threshold for probability detection can be calculated as(23)ℚ−1Pd=εσu2−γ−1tfs2γ+1.The false detectionPf is calculated as(24)ℚ−1Pf=εσu2−1tfs.In the Rayleigh transmission channel, the converted carrier band signal is passed:(25)ht=∑p=1NpApδt−tp,where Np are several paths, Ap is channel gain, and tp is the delay in pth path. The signal moves in the line of sight (LOS) considered by a free-space path loss propagation model and receives power calculated as follows:(26)Pr=Gl×ϱ24πd2×Pt.The received and transmitted power are notated asPr and Pt with wavelength ϱ. The LOS distance is denoted by d, and the factor dependent defines field radiation of PU and SU upon the antenna Gl. The square of the distance between PU and SU is inversely proportional to the received power. The noise variance is added to the received power and updates the actual power value. The noisy channel is modeled as the convolution of Rayleigh channel response and noise variance where nt is noise variance.(27)gt=ht∗nt.This completes the design of the spectrum sensing structure.In the training of LSTM, the behavior of CR users to the changing activity of PU in the operating environment is learned. The sensing report is generated by the CR user and makes a local decision based on its energy. Based on the outcomes, the acknowledgment signal status, the report is assigned to a sensing class. The information of the primary user is forwarded to the data center that decides spectrum sensing. The bandwidth of the transmitted signal is divided intoNs subcarriers and transmitted in chunks. These subcarriers are frequency spaced by Δf=1/Td where Td is time to transmit a signal. The signals are multiplexed using inverse discrete Fourier transform (IDFT) as(28)ybt=∑k=1NsYkej2πkΔft.Every secondary node senses the energy of the transmitted signal by PU, and based on the comparison with a thresholdℚ−1 from equation (23), it decides whether it is from the primary user and to vacate the channel. This energy received enables the calculation of the trust value. Figure 4 portrays the complete model for the training using the concept of spectrum sensing and then obtaining the trust value. Pd and Pf are evaluated in the proposed scheme LSTM-based spectrum sensing detection. The signals collected are fed to the LSTM network one by one, and the corresponding values of the detection and false alarm probability are computed. The primary signal vector of each SNR value is processed to the LSTM network. The number of times it correctly classified the signal H1 divided by the total number of primary user signals fed to the network determines Pd. Similarly, the noise sequence is forwarded to the LSTM network and calculates the false alarm probability Pf. The hypothesis H0 is divided by the total number of noise sequences used in the prediction. The complete model designed for predicting the vehicle’s trust value using LSTM is shown in Figure 5.Figure 5
Adaptive spectrum sensing using LSTM.As discussed above, adaptive spectrum sensing is implemented for forming trust based on the energy detector’s threshold. The threshold is set to the target that is the desired constant probability of detection.The limits are as obtained from equation (23). The energy of the vehicle received is given to the trained LSTM network. The network decides whether the vehicle is a primary user or not, and in turn, the value of the trust is assigned if it successfully vacates the spectrum. This adaptive spectrum sensing is done using the trained data using the LSTM. In Figure 6, the training curve of LSTM is elucidated, where the loss function, along with the accuracy, is plotted for 3,500 epochs. The loss defines the difference between the actual and predicted values of the primary users’ signals in various data and noise signals.Figure 6
Training progress of designed LSTM for 3,500 iterations.The analysis of trained LSTM is depicted in terms of the confusion matrix, as shown in Figure7. Here, the adaptive spectrum sensing problem is formulated as a classification problem illustrated in equation (17). This prediction is made for a total of 4,000 vehicles. This binary classifier’s accuracy is 89% for the correct detection of the absence of any PU and 83.5% for any PU presence in the network. This designed LSTM model is efficient and can predict with sufficient accuracy, even in various noise conditions and mixed signals. A comparison between Pd generated from the theoretical analysis as designed in [34] and Pd for the trained LSTM is shown in Figure 8. Since Pd,max=1, the higher the probability, the better the trust score, and accordingly, the vehicle is considered trustworthy. This completes the design and evaluation of the trust metric. Now, the proposed weighted CH selection is discussed in the following in detail.Figure 7
Confusion matrix for performance analysis of the classifier designed using LSTM.Figure 8
Comparison between the probability of detection and probability of false alarm using the proposed spectrum sensing LSTM method.The complete algorithm for the CH selection is explained in Algorithm2. All the above parameters discussed are incorporated, and a weighted metric is formulated for selecting a stable cluster head for a maximum period [35]. The number of vehicles in a time instant is firstly clustered using the RSU as discussed in Algorithm 1. Then, for all the members (CM), the above four parameters are calculated, and then a weighted CHscore is calculated to select the cluster head as discussed in Algorithm 2.Algorithm 2:CH selection.
Input: Relative SpeedVvehi and Location x,y;Number of the lane in a mapno_lane;time_span; Cluster (C), N no of clusters.Output: CHFort = 1:time_spanFori=1:NForj = 1: CMObtain theBF using the equation (3)Calculate therij; affinity matrixFabricate the evolving graphG for each clusterFind the maximum eigenvaluesλ ; calculate Eccj using equation (10)Determine the neighbor and find theCNusing equation (12)From the LSTM trained network, calculate theTObtain theCH_score for each CMCHscore=w1×BF+w2×Ecc+w3×CN+w4×Tw1+w2+w3+w4=1EndCH=maxCHscore∀jEndEnd


## 3.3. Computational Complexity of the Designed Complete Algorithm

In this section, the computational complexity of the dynamic weighted algorithm is discussed. The clustering algorithm is divided into two parts, the cluster formation and cluster head selection. Thus, the total time complexity of the algorithm can be stated as(29)Otot=OCF+OCHS,where OCF is the time complexity of cluster formation and OCHS is the cluster head selection.In cluster formation, as already discussed in Section3.1, the authors find only the distance between the vehicles and the RSU. M is the maximum number of vehicles taken in the worst-case analysis. Thus, the worst-case time complexity for this is(30)OCF=OlogM2.In the cluster head selection, there are four parameters taken into consideration. The total time complexity for the cluster head selection is(31)OCHS=OBF+OEcc+OCN+OT.The complexity of BF is a linear equation, where three things have been calculated, the time to leave, relative average speed, and the neighborhood degree. The time to leave and the relative average speed are only the constant values fetched and calculated. In contrast, in the neighborhood degree, the distance between the vehicles in the vicinity is calculated through their coordinates. Thus,(32)OBF=O1+O1+OlogM2.The next is the eccentricity, calculated using the spectral clustering methods that involve the affinity matrix and the eigenvalue decomposition. The complete complexity of spectral clustering is(33)OEcc=OM2+OM3.In the community neighborhood, an affinity matrix is generated for the near adjacent vehicles. Thus, the complexity for this is given as(34)OCN=OlogM2.In the metric trust, the main role is played by the LSTM for spectrum sensing; the theoretical time complexity of LSTM is given as(35)OTH=4IH+4H2+3H+HK,where I is the number of inputs, K is the number of outputs, and H is the number of hidden layers. In this study, as the model is trained once and then for a given vehicles signal, the LSTM, through its spectrum sensing, senses the vehicle either being a primary or secondary user. Thus, the time complexity bottles down to(36)OT=O4H2.Thus, the complete time complexity is reduced to removing all the terms with less complexity than cubic and quadratic terms.(37)OCH=2OlogM2+OM3.Thus, the total time complexity is(38)Otot=3OlogM2+OM3.


## 4. Simulation Results and Discussion

This section discusses the results achieved at different stages of the cluster head model designing. It is bifurcated into the following sections: (1) Simulation Environment and Tool; (2) Network Performance Evaluation; (3) Experimental Evaluation with the existing state of the art and similar other cases.


### 4.1. Simulation Environment and Tool

All the simulation experiments are performed using MATLAB (R2020a), with processor Intel® Core TM i3, 1.98 GHz, Simulation of Urban Mobility [36] (SUMO 0.25.0; SUMO 0.12.0), and the TraCI [37]. SUMO is an open-source microscopic road traffic simulator licensed under the General Public License (GPL). It was developed through a collaboration between the Center for Applied Informatics Cologne (ZAIK) and the Institute of Transportation Systems (ITS) at the German Aerospace Center (DLR). While TraCI stands for the Traffic Control Interface specifically designed to get access to the traffic running on the road simulated, the embedded feature of extracting simulated objects’ values. The network performance metrics like throughput, energy, packet delay, and packet delay ratio are evaluated through MATLAB. The simulation area is Chengdu, the capital of southwestern China’s Sichuan province. The area taken for the simulation has the latitude = 30.6598628°N and longitude = 104.0633717°E. The area is busiest as there is a tourist place Chairman Mao statue. The total traffic environment summary is provided in Table 3.Table 3
Simulation specification.
ParameterValueScenarioUrbanLanes302Average speed12.71 m/secSimulation time1500 secRSU placement500 mRSU transmission range350Vehicle transmission range200Vehicle length5 m and 10 mVehicle speed0–30 m/secThe simulated section of the original region is shown in Figure9; it is a vast area with a high urban and highway mobility model. The region also consists of the famous tourist spot that ensures dense vehicle movement around the peak working hours. The authors have deployed RSU, the additional facilities for network stability as per the proposed algorithm discussed in Algorithm 3, given in Section 2.2. The map after the deployment is shown in Figure 10. It is evident from the figure that the total area has been covered efficiently. Also, enough RSU are concentrated at the cross-lane to provide sufficient coverage without any overhead delay or congestion problem, which can eventually lead to less drop in the packets and affect the network’s stability.Figure 9
The simulated map area along with the original Chengdu, capital of southwestern China’s Sichuan province.Algorithm 3:RSU deployment in the presence of crossroad.
Input: Lane coordinatesx,y; angle ∅; number of the lanes in a map no_laneOutput: Change in angle as per CrossroadPlace the RSU in each lane.Fori=1:no_laneIfxold,yold<xnext,ynextLane is in [+, +]Elseifxold,yold>xnext,ynextLane is in [+, -]Elseifxold,yold>xnext,ynext‖∅Lane is in [-, +]Change the∅If∅<90°∅=∅+180°Elseif∅>90°‖∅<270°∅=∅+90°Elseif∅>270°‖∅<360°∅=∅+180°EndifElseLane is [-, -]EndifEndFigure 10
The deployment of RSU.


### 4.2. Network Performance Evaluation

The proposed scheme’s importance is tested using the four network performance metrics discussed in the following. The communication between vehicles is modeled through the Nakagmi channel, representing the obstacle medium to match real-life data transmission. Here a two-hop model is taken, where the packet transfer is initiated through any randomly selected vehicle that acts as a source to the CH and the CH sent the packet to the intended designation. The delay of this packet through the network enables the authors to calculate the desired network parameters. The size and data rate are as specified in the following table. The time taken for the packet transfer is measured using the MATLAB internal clock. Packet contains a random sequence of 1’s and 0’s. The communication network parameters are listed in Table4.Table 4
Integrated network parameters.
ParametersValueChannelWirelessPropagation modelPropagation/Nagakami (m = 3)MACMac/802_11ExtData rate4, 8, 10, 12, and 14 kbpsIEEE 802.11p transmission range350 mPacket sending interval0.2 secPacket size64 bytesThe evaluation parameters for the proposed VANET stability performance assessment are as follows:(1)
Energy (E): the amount of energy consumed at each node for communication is measured in Joules. The consumption of energy is directly proportional to the distance between the hops.(39)E=α1+α2×D+α3.(2)
Packet delivery ratio (PDR): PDR is the average ratio of successfully received packets at the destination vehicle over the total generated packets on the source vehicle. The delivery ratio decreases with increasing data rates.(40)PDR=∑i=1Npacket received×datarate×packet sizepacket generated at source×datarate×packet  size.(3)
Packet delay (PD): it refers to the time taken for a packet to be sent through the transmission media from the source to the destination vehicle. The delay in packet delivery depends on network congestion, noise, and hop travel distance.(41)PD=∑i=1Npacket transmitted×datarate×packet size−packet received×datarate×packet sizet.(4)
Throughput: it represents the amount of data successfully transferred from source vehicle to destination vehicle in a given period, typically measured in Kilobits per second (kbps). The higher throughput can be achieved with less hop count and network stability.(42)Throughput=∑i=1Npacket received×datarate×packet sizet.(5)
Cluster head stability: it represents the number of times the same vehicle is chosen as cluster head in the total solution’s time span.(43)CHS=mode∑i=1tID.


### 4.3. Experimental Evaluation

The proposed scheme is tested with the following simulation environment settings:(i)
Different vehicles’ densities(ii)
The vehicle position in a cluster is estimated by Kalman filter and calculated based on its current locationThe complete evaluation for different vehicular densities is tabulated in Table5. This study is done to evaluate the cluster stability in the different vehicular densities and the dynamic scenario. Vehicles are clustered on the ground of several RSUs. Each RSU covered area is considered as a cluster, and vehicles under that area are cluster members. The RSUs with empty clusters are omitted from the evaluation of the parameters. The dissipation of the energy has a similar pattern for vehicular density. This ensures the stability of the cluster head. Also, the clusters with more number of cluster members or denser clusters pose a challenge as cluster head stability frequently changes in these conditions. The throughput is analyzed, two two-hop models. The throughput will be more for denser clusters as compared to the sparsely populated cluster. The other two parameters, packet delay and packet delay ratio, solemnly depend on the density and the distance of the nodes selected.Table 5
Comparison of various network parameters for different vehicular densities.
Network parametersClusters1234567891011Vehicular density: 20012171519406510587Energy (J)3.593.59—3.592.623.593.593.594.463.593.59PDR23434345452PD (s)5.822.194.362.852.321.142.174.914.601.914.90Throughput (kbps)1.652.250.201.542.352.241.721.071.402.111.18Vehicular density: 40015181418050191271173312Energy (J)3.593.593.595.362.621.153.593.591.773.593.59PDR13252134232PD (s)1.511.364.892.313.093.761.826.641.241.361.69Throughput (kbps)2.021.938.264.812.782.951.321.511.111.551.32Vehicular density: 600211921308510029212451028Energy (J)3.593.593.598.782.621.753.593.591.773.593.59PDR4.045.292.181.302.273.502.041.672.666.352.29PD (s)24324332222Throughput (kbps)2.112.512.532.733.253.992.327.474.381.422.42Vehicular density: 8003513540305014545961106252Energy (J)3.593.593.594.902.626.163.593.596.823.593.59PDR31254313333PD (s)8.162.052.213.672.482.951.382.347.126.271.13Throughput (kbps)1.057.591.821.252.007.072.196.134.452.332.34Vehicular density: 1,00025454245152221701458917095Energy (J)14.371.394.307204.070.91140.7477.861.391.3979.950.65PDR10.311.410.701.261.041.330.660.910PD (s)0.871.862.701.330.051.964.123.063.351.882.54Throughput (kbps)0.131.251.351.352.050.572.272.571.932.451.93The authors have compared the evaluation of the befit factor in two ways. First, the authors have used the vehicles’ current location to calculate the befit factor as suggested in the [19] and in the other way predicted and corrected location of the vehicles using Kalman filter as discussed in Section 2.3 employed. Figure 11 showcases the current location and the vehicles’ corrected location for a single timestamp in the total simulation. We can analyze that, with dynamic evolving networks and frequent changing vehicle velocity, vehicles’ exact location is trivial to know for the stability of the VANET. Also, the estimation of the vehicle is dependent on the direction of movement and current velocity. It has been observed that the vehicle’s moving angle may vary instead of being constant at some points. These factors have significantly affected the befit factor analysis for selecting the cluster head and its stability. This assessment can be done from Figure 12, where 1,000 vehicle densities and 11 clusters are formed. The cluster head’s stability is counted as the count of continuous timestamps for which any vehicle ID is constantly served as cluster head. Here, more stability is provided by the predicted method as we can observe that the frequency of a single vehicle in becoming the cluster head is about 180 times for a single period evaluation.Figure 11
The corrected and the original location of the 1,000 vehicles for a single timestamp in the total simulation time.Figure 12
The comparison of the cluster stability for the befit factor using original and predicted 1,000 vehicles’ position.


### 4.4. Baseline Comparisons

The baseline algorithms are the algorithms designed in the literature for the individual metric. In this analysis, three baseline algorithms are included as mentioned and discussed in Section3. The analysis is carried out for the 100 vehicular density. The results are shown in Figure 13 at an instant of the total simulation time; in this, we can observe that CH selection is highest for the proposed scheme compared to the individual one as designed by the different arts state. All the simulation has been conducted on the same platform and done as described as in the literature for the comparison. As the model is urban, the vehicle’s speed and density eventually lead to dynamic network changes. The cumulative effect of all the three metrics is evident compared to the individual as just change in velocity, community neighborhood, or eccentricity standalone cannot reflect the changes that a weighted approach can do. Thus, there is a need for a weighted approach that can evaluate the evolving changes in the network from time to time and make the transition of CH less.Figure 13
Comparative analysis of the CH stability for 1,000 vehicular densities.The different network metrics are also tested on the 1,000 vehicular densities for the proposed scheme. The data packet is transmitted from a cluster member to the cluster head, and the CH transmits it to the destination cluster member. The average amount of energy consumed at each node in a cluster for various data rates is shown in Figure14. The consumption is observed to decrease or be constant for specific clusters for each data rate; this can be as the cluster topology has not changed, or the CH has not changed. The increase in energy is where the number of clusters is with fewer members and a larger distance, which requires more dissipation of the energy.Figure 14
The energy consumption for various data rates at 1,000 vehicular densities.The packet delay ratio and the packet delay are demonstrated in Figures15 and 16, respectively. The delay in a packet can be associated with the scant cluster formation; the distance among the chosen nodes is far apart, the network’s congestion due to the dense population. The throughput is also analyzed, as shown in Figure 17. The throughput is the metric for the efficiency of the designed network. The high value of throughput resembles better performance with better communication among the cluster members. The drop and loss of packets eventually affect the throughput of the network. The clusters with only one cluster member ought to drop the packet.Figure 15
The packet delay for various data rates at 1,000 vehicular densities.Figure 16
The packet delay ratio for various data rates at 1,000 vehicular densities.Figure 17
The throughput for various data rates at 1,000 vehicular densities.


## 4.1. Simulation Environment and Tool

All the simulation experiments are performed using MATLAB (R2020a), with processor Intel® Core TM i3, 1.98 GHz, Simulation of Urban Mobility [36] (SUMO 0.25.0; SUMO 0.12.0), and the TraCI [37]. SUMO is an open-source microscopic road traffic simulator licensed under the General Public License (GPL). It was developed through a collaboration between the Center for Applied Informatics Cologne (ZAIK) and the Institute of Transportation Systems (ITS) at the German Aerospace Center (DLR). While TraCI stands for the Traffic Control Interface specifically designed to get access to the traffic running on the road simulated, the embedded feature of extracting simulated objects’ values. The network performance metrics like throughput, energy, packet delay, and packet delay ratio are evaluated through MATLAB. The simulation area is Chengdu, the capital of southwestern China’s Sichuan province. The area taken for the simulation has the latitude = 30.6598628°N and longitude = 104.0633717°E. The area is busiest as there is a tourist place Chairman Mao statue. The total traffic environment summary is provided in Table 3.Table 3
Simulation specification.
ParameterValueScenarioUrbanLanes302Average speed12.71 m/secSimulation time1500 secRSU placement500 mRSU transmission range350Vehicle transmission range200Vehicle length5 m and 10 mVehicle speed0–30 m/secThe simulated section of the original region is shown in Figure9; it is a vast area with a high urban and highway mobility model. The region also consists of the famous tourist spot that ensures dense vehicle movement around the peak working hours. The authors have deployed RSU, the additional facilities for network stability as per the proposed algorithm discussed in Algorithm 3, given in Section 2.2. The map after the deployment is shown in Figure 10. It is evident from the figure that the total area has been covered efficiently. Also, enough RSU are concentrated at the cross-lane to provide sufficient coverage without any overhead delay or congestion problem, which can eventually lead to less drop in the packets and affect the network’s stability.Figure 9
The simulated map area along with the original Chengdu, capital of southwestern China’s Sichuan province.Algorithm 3:RSU deployment in the presence of crossroad.
Input: Lane coordinatesx,y; angle ∅; number of the lanes in a map no_laneOutput: Change in angle as per CrossroadPlace the RSU in each lane.Fori=1:no_laneIfxold,yold<xnext,ynextLane is in [+, +]Elseifxold,yold>xnext,ynextLane is in [+, -]Elseifxold,yold>xnext,ynext‖∅Lane is in [-, +]Change the∅If∅<90°∅=∅+180°Elseif∅>90°‖∅<270°∅=∅+90°Elseif∅>270°‖∅<360°∅=∅+180°EndifElseLane is [-, -]EndifEndFigure 10
The deployment of RSU.


## 4.2. Network Performance Evaluation

The proposed scheme’s importance is tested using the four network performance metrics discussed in the following. The communication between vehicles is modeled through the Nakagmi channel, representing the obstacle medium to match real-life data transmission. Here a two-hop model is taken, where the packet transfer is initiated through any randomly selected vehicle that acts as a source to the CH and the CH sent the packet to the intended designation. The delay of this packet through the network enables the authors to calculate the desired network parameters. The size and data rate are as specified in the following table. The time taken for the packet transfer is measured using the MATLAB internal clock. Packet contains a random sequence of 1’s and 0’s. The communication network parameters are listed in Table4.Table 4
Integrated network parameters.
ParametersValueChannelWirelessPropagation modelPropagation/Nagakami (m = 3)MACMac/802_11ExtData rate4, 8, 10, 12, and 14 kbpsIEEE 802.11p transmission range350 mPacket sending interval0.2 secPacket size64 bytesThe evaluation parameters for the proposed VANET stability performance assessment are as follows:(1)
Energy (E): the amount of energy consumed at each node for communication is measured in Joules. The consumption of energy is directly proportional to the distance between the hops.(39)E=α1+α2×D+α3.(2)
Packet delivery ratio (PDR): PDR is the average ratio of successfully received packets at the destination vehicle over the total generated packets on the source vehicle. The delivery ratio decreases with increasing data rates.(40)PDR=∑i=1Npacket received×datarate×packet sizepacket generated at source×datarate×packet  size.(3)
Packet delay (PD): it refers to the time taken for a packet to be sent through the transmission media from the source to the destination vehicle. The delay in packet delivery depends on network congestion, noise, and hop travel distance.(41)PD=∑i=1Npacket transmitted×datarate×packet size−packet received×datarate×packet sizet.(4)
Throughput: it represents the amount of data successfully transferred from source vehicle to destination vehicle in a given period, typically measured in Kilobits per second (kbps). The higher throughput can be achieved with less hop count and network stability.(42)Throughput=∑i=1Npacket received×datarate×packet sizet.(5)
Cluster head stability: it represents the number of times the same vehicle is chosen as cluster head in the total solution’s time span.(43)CHS=mode∑i=1tID.


## 4.3. Experimental Evaluation

The proposed scheme is tested with the following simulation environment settings:(i)
Different vehicles’ densities(ii)
The vehicle position in a cluster is estimated by Kalman filter and calculated based on its current locationThe complete evaluation for different vehicular densities is tabulated in Table5. This study is done to evaluate the cluster stability in the different vehicular densities and the dynamic scenario. Vehicles are clustered on the ground of several RSUs. Each RSU covered area is considered as a cluster, and vehicles under that area are cluster members. The RSUs with empty clusters are omitted from the evaluation of the parameters. The dissipation of the energy has a similar pattern for vehicular density. This ensures the stability of the cluster head. Also, the clusters with more number of cluster members or denser clusters pose a challenge as cluster head stability frequently changes in these conditions. The throughput is analyzed, two two-hop models. The throughput will be more for denser clusters as compared to the sparsely populated cluster. The other two parameters, packet delay and packet delay ratio, solemnly depend on the density and the distance of the nodes selected.Table 5
Comparison of various network parameters for different vehicular densities.
Network parametersClusters1234567891011Vehicular density: 20012171519406510587Energy (J)3.593.59—3.592.623.593.593.594.463.593.59PDR23434345452PD (s)5.822.194.362.852.321.142.174.914.601.914.90Throughput (kbps)1.652.250.201.542.352.241.721.071.402.111.18Vehicular density: 40015181418050191271173312Energy (J)3.593.593.595.362.621.153.593.591.773.593.59PDR13252134232PD (s)1.511.364.892.313.093.761.826.641.241.361.69Throughput (kbps)2.021.938.264.812.782.951.321.511.111.551.32Vehicular density: 600211921308510029212451028Energy (J)3.593.593.598.782.621.753.593.591.773.593.59PDR4.045.292.181.302.273.502.041.672.666.352.29PD (s)24324332222Throughput (kbps)2.112.512.532.733.253.992.327.474.381.422.42Vehicular density: 8003513540305014545961106252Energy (J)3.593.593.594.902.626.163.593.596.823.593.59PDR31254313333PD (s)8.162.052.213.672.482.951.382.347.126.271.13Throughput (kbps)1.057.591.821.252.007.072.196.134.452.332.34Vehicular density: 1,00025454245152221701458917095Energy (J)14.371.394.307204.070.91140.7477.861.391.3979.950.65PDR10.311.410.701.261.041.330.660.910PD (s)0.871.862.701.330.051.964.123.063.351.882.54Throughput (kbps)0.131.251.351.352.050.572.272.571.932.451.93The authors have compared the evaluation of the befit factor in two ways. First, the authors have used the vehicles’ current location to calculate the befit factor as suggested in the [19] and in the other way predicted and corrected location of the vehicles using Kalman filter as discussed in Section 2.3 employed. Figure 11 showcases the current location and the vehicles’ corrected location for a single timestamp in the total simulation. We can analyze that, with dynamic evolving networks and frequent changing vehicle velocity, vehicles’ exact location is trivial to know for the stability of the VANET. Also, the estimation of the vehicle is dependent on the direction of movement and current velocity. It has been observed that the vehicle’s moving angle may vary instead of being constant at some points. These factors have significantly affected the befit factor analysis for selecting the cluster head and its stability. This assessment can be done from Figure 12, where 1,000 vehicle densities and 11 clusters are formed. The cluster head’s stability is counted as the count of continuous timestamps for which any vehicle ID is constantly served as cluster head. Here, more stability is provided by the predicted method as we can observe that the frequency of a single vehicle in becoming the cluster head is about 180 times for a single period evaluation.Figure 11
The corrected and the original location of the 1,000 vehicles for a single timestamp in the total simulation time.Figure 12
The comparison of the cluster stability for the befit factor using original and predicted 1,000 vehicles’ position.


## 4.4. Baseline Comparisons

The baseline algorithms are the algorithms designed in the literature for the individual metric. In this analysis, three baseline algorithms are included as mentioned and discussed in Section3. The analysis is carried out for the 100 vehicular density. The results are shown in Figure 13 at an instant of the total simulation time; in this, we can observe that CH selection is highest for the proposed scheme compared to the individual one as designed by the different arts state. All the simulation has been conducted on the same platform and done as described as in the literature for the comparison. As the model is urban, the vehicle’s speed and density eventually lead to dynamic network changes. The cumulative effect of all the three metrics is evident compared to the individual as just change in velocity, community neighborhood, or eccentricity standalone cannot reflect the changes that a weighted approach can do. Thus, there is a need for a weighted approach that can evaluate the evolving changes in the network from time to time and make the transition of CH less.Figure 13
Comparative analysis of the CH stability for 1,000 vehicular densities.The different network metrics are also tested on the 1,000 vehicular densities for the proposed scheme. The data packet is transmitted from a cluster member to the cluster head, and the CH transmits it to the destination cluster member. The average amount of energy consumed at each node in a cluster for various data rates is shown in Figure14. The consumption is observed to decrease or be constant for specific clusters for each data rate; this can be as the cluster topology has not changed, or the CH has not changed. The increase in energy is where the number of clusters is with fewer members and a larger distance, which requires more dissipation of the energy.Figure 14
The energy consumption for various data rates at 1,000 vehicular densities.The packet delay ratio and the packet delay are demonstrated in Figures15 and 16, respectively. The delay in a packet can be associated with the scant cluster formation; the distance among the chosen nodes is far apart, the network’s congestion due to the dense population. The throughput is also analyzed, as shown in Figure 17. The throughput is the metric for the efficiency of the designed network. The high value of throughput resembles better performance with better communication among the cluster members. The drop and loss of packets eventually affect the throughput of the network. The clusters with only one cluster member ought to drop the packet.Figure 15
The packet delay for various data rates at 1,000 vehicular densities.Figure 16
The packet delay ratio for various data rates at 1,000 vehicular densities.Figure 17
The throughput for various data rates at 1,000 vehicular densities.


## 5. Conclusion

In this paper, the authors have designed a new scheme for selecting a stable cluster head using the weighted approach. This formulation is crafted by including the four different metrics included to address all the parameters needed to enhance the dynamic network’s stability. The authors have designed a practical methodology for the deployment of the RSU working as an additional facility to enhance the network based on the angle of the lane. The clusters are formed concerning RSU. These clusters are further improved to select a stable cluster head using metrics: befit factor, eccentricity, community neighborhood, and trust. The befit factor is dependent on the speed of the vehicle. VANET is a network with high-speed vehicles and dynamic topology. The precision in the exact location and speed in such networks is trivial to combat such a situation. The authors have employed the Kalman filter to predict the vehicle’s location at the next instant, which can improve the befit calculation and, in turn, suffice for the cluster head’s stability. The results have demonstrated superior results as compared to the original formulated befit factor. The next two metrics are designed on the evolving graph structure as they are scalable and eliminate the need for recalculating in case of a change in the network’s topology. The last is the trust value included for the primary users for multiple reasons; the primary users get hidden in the network. The detection of the primary users’ energy is resolved using an LSTM, deep learning trained for different signals and noises. The accuracy is around 80%, with a misclassification rate of around 14%. The cluster head’s stability is measured in terms of mode, where the number of times a vehicle is selected as cluster head is noted. The results show the weighted approach’s supremacy compared to the cluster head stability achieved through a single metric. The designed method is tested on the real map for the region of Chengdu, southwestern China’s Sichuan province, for the different vehicle mobility densities. Also, the scheme is tested for various integrated network parametric analyses with a two-hop structure. The results regarding throughput, packet delay, energy, and packet delay ratio have shown the proposed scheme’s domination for different data rates.



---

*Source: 9936299-2021-07-12.xml*