## 3 Proposed UGAVs-MDVR Protocol
### Level-Based Cluster-Head Election (LBCHE)
```
1.TO complete V\({}_{w}\)\(\Phi\)(n) Implement//all UGVs
2.IF multicast(advertisement receive time)\(>\) 10 then//missing of advertisement show the partitioning of the network
3.Repeat (election CL_Head, V\({}_{2}\)) //repeat CH election Function
4.Function send_advertis_time (V\({}_{Z}\)) //advertisements dissemination after five seconds periodically
5.modify_clust_info(CR) //modify the CR
6.Function cluster_maintenance(V\({}_{Z}\)) //modify the CR for a newly formed cluster
7.Function maint(current_cluster, new cluster) //maintain newly formed cluster
8.ELSE
9.Function send_advertis (periodic_time_space)
10.Function keep_CL_HD(V\({}_{Z}\))
11.Function CLMN(existing_V\({}_{Z}\))
12.modify_cluster(CR) //modify the CR
13.ENDIF
```
**Algorithm 5** Repeat CH election for handling partitioning within clusters

### Cluster Maintenance (CMN)

The CMN join and leave the clusters continuously because of variations in speed, dynamic trajectories, and hilly areas. Thus, the CMN scheme is defined to keep the record of all CMN and updates in CR, as shown in Algorithm 6. The computation of the vehicle's speed and direction is illustrated in Algorithm 7. The CMN scheme specifies the procedure to add the new CMN or drop the missing vehicles, as depicted in Algorithm 8. Similarly, the procedure of cluster merging is also defined in this scheme, as shown in Algorithm 9. ```
1:TO complete V\({}_{w}\) in \(\Phi\)(n) Implement//all UGVs
2:Function send_advertis_UGVs(V\({}_{Z}\)) //Dissemination of advertisement to adjacent vehicles
3:Function calculate_spd_direct, UGVs(V\({}_{Z}\)) //UGVs speed and direction computation
4:IF INCOMING(UGVs) = YES &dev = SINGLE THEN//for new vehicles
5:Function add (UGVs) //CR Update
6: modify(CR)
7:ENDIF
8:IF nearby(CLUSTER V\({}_{Z}\)) = CR(modify_incomplete_miss_data) THEN
9:Function left (vehicle, CR)
10: modify_record(cluster, CR)
11:ENDIF
```
**Algorithm 6** Maintenance of cluster record (CR)
```
1:TO complete V\({}_{w}\) in \(\Phi\)(n) Implement//all UGVs
2:IF send_advertis_time(t) >= 5 THEN
3:Function calculate_spd_direct, UGVs(V\({}_{Z}\)) //UGVs speed and direction computation
4:Function share(UGVs, spd_direct, V\({}_{Z}\)) //UGVs speed and direction are shared
5:IF UGVs, direct = dissimilar THEN
6:Function left_(CR,V\({}_{Z}\)) //drop the vehicle from CR
7: modify_CR(V\({}_{Z}\), spd, direct) //modification of cluster record
8:ENDIF
9:ELSE
10:Function CR_maintenance(VC_CMs,V\({}_{Z}\)) //the CR maintenance
11:ENDIF
```
**Algorithm 7** UGVs speed and direction computation

The cluster member joining function is elaborated as follows and shown in Algorithm 8:
```
1:Computation of speed and direction for incoming cluster members,
2:Transmission of request by CH to incoming CMN upon similar speed and direction,
3:Transmission CMN acknowledgement,
4:CMs joining delay computation. The cluster merging function for the merger of a similar incoming cluster is given as follows and in Algorithm 9 below:  
```
1.TO complete V\({}_{\text{w}}\) in \(\Phi(n)\) Implement //all UGVs
2.IF sp(INVC_UGVs) && dir(INVC_UGVs) == UGVs(Vehicles\({}_{\text{Ahead}}\)) //if IVs speed matches vehicles ahead
3.CH_send_joining_request(C_cluster_head_ID,T_1) //transmit join request by CH to IV-CM vehicles with its CH_ID at T\({}_{1}\)
4.joining_ack_CM(C_Cluster_member_ID,T_2) //Transmission of CM ack for joining with its CM_ID at T\({}_{2}\)
5.CM_joining_delay(T\({}_{2}\)-T\({}_{1}\)) //Cluster member joining delay calculation
6.END IF
```  
**Algorithm 8** Cluster joining function upon new CM  
The cluster merging function for the merger of a similar incoming cluster is given as follows and in Algorithm 9 below:  
```
1.Advertisement reception,
2.Speed and direction computation,
3.Incoming CH joining as CM,
4.Incoming CMs joining. ```  
**Algorithm 9** Cluster merging function upon incoming cluster  
The implementation of the proposed protocol has been elaborated concerning the creation of clusters and the cluster-head election process.