A Weight Based Clustering Algorithm for Internet of Vehicles