OPTIMIZING ENERGY CONSUMPTION OF VEHICLE SENSOR NETWORKS BASED ON THE K-MEANS CLUSTERING METHOD AND ANT COLONY ALGORITHM

: With the world’s growing population, the number of vehicles has increased, but the capacity of roads and transportation systems has not. The increasing traffic and the pollution that it causes has therefore become a problem all over the world. Wireless Sensor Networks that detect traffic and prevent its pernicious effects have attracted the attention of many. Fast information transfers, easy installation, less repair and maintenance, compression and lower costs make WSNs more common than other network solutions (Nellore and Hancke 2016). Since more traffic congestion wastes time and energy, it is crucial to develop and present approaches to more accurately detect traffic patterns. Clustering is one of the best data analysis methods used for detecting traffic patterns. The approach proposed by this study assumes that all vehicles are equipped with GPS, and that sensors establish connections with each other through radio communication equipment. In this case, clustering is used to gather important traffic information and create intelligent urban transportation systems (ITS) to reduce sensor energy consumption in vehicular sensor networks. The K-means method and the ANT Colony optimization algorithm were used to cluster sensors and investigate their impact on reducing sensor energy consumption. The results show that the K-means algorithm and the ANT Colony algorithm reduce vehicular sensor energy consumption by 41.7 and 76.8 percent, respectively. The investigations showed that the ANT Colony algorithm outperformed the K-means algorithm by 84.2%.


INTRODUCTION
The modern society faces serious transportation related problems (Guerrero-Ibáñez, Zeadally et al. 2018).Improper traffic control in urban areas increases traffic congestion, wastes time and fuel, and increases costs.For example, in 2010, drivers in the United States spent 34 hours more on average in transportation and wasted 14 gallons of fuel in traffic.Comparing with statistics from 1982 (14 hours and 6 gallons) indicates a growing traffic that has created increasing problems for transportation systems.On the other hand, expansion of road networks as a solution to counter traffic congestion is not practical due to financial and environmental constraints (Knorr, Baselt et al. 2012, Guo, Li et al. 2019).Intelligent transportation systems are an effective approach for better managing traffic and related issues in smart cities (Mohan, Padmanabhan et al. 2008;Pahlavani et al., 2019;Moghadam et al., 2017).Moreover, geospatial information systems provides a powerful tools for importing, analyzing, and displaying urban data from a variety of sensors and sources (Delavar, 2004;Pahlavani et al., 2006;Pahlavani et al., 2017;Bahari et al., 2014).Automakers are developing vehicle sensors and their own applications in various fields.Government institutions are executing road infrastructures, like cameras and sensors, to collect information related to the environment and traffic conditions.Integrating sensors to vehicles and their ability to sense and communicate with each other makes it possible to achieve intelligent transportation systems (Guerrero-Ibáñez, Zeadally et al. 2018).
Existing vehicles can communicate with each other and with the traffic control center to determine road conditions and connect with vehicles.The resulting data can be used to approximate average speed and determine the optimal route for reaching the destination (Mahallati, Bezdek et al. 2018).Urban traffic control systems are a subset of intelligent transportation systems used for designing and executing traffic control systems, collecting, estimating, and publishing traffic information and specifically, collecting and exchanging this information in a cooperative traffic control system (Zhang and Riedel 2017).Wireless sensor networks include numerous sensors nodes that can monitor a specific area by processing and establishing wireless connections (Biswas, Das et al. 2018).Vehicles equipped with sensors and radio communication equipment can act as sensor nodes of wireless sensor networks.Since a majority of drivers use mobile phones that can establish wireless radio connections, the vehicles can be seen as equipped with a powerful wireless communication tool that can transmit its own traffic information, like position and instantaneous speeds to traffic information collection centers, as well as receive traffic related information.In fact, vehicle sensors work as communication bridges for sharing traffic data (Mohan, Padmanabhan et al. 2008, Dimitrakopoulos and Demestichas 2010, Wang, Wakikawa et al. 2010, Engelbrecht, Booysen et al. 2015).Wireless sensor networks suffer from numerous fundamental challenges, including sensor energy source constraints, network error filtering ability (result integrity and accuracy), data transfer routing and sensor coverage (Pour 2016, Selmic, Phoha et al. 2016).The most important challenge, however, is sensor node energy source constraints.Sensor clustering is one possible solution for this problem.Clustering improves network load balancing, filters error-laden data, and finds the best data transfer route and maximum sensor coverage.After clustering, cluster heads (CHs) collect and send cluster information to data collection centers ) Vodopivec, Bešter et al. 2012, Arkian, Atani et al. 2014, Bali, Kumar et al. 2014).This study's main purpose was to use location clustering to optimize traffic data transfer in vehicular sensor networks from a sensor energy consumption perspective.Clustering was performed and the results were then compared using the Kmeans and ANT Colony optimization methods.This study will assume that all vehicles are equipped with GPS and vehicular sensors communicating with each other through radio communications, and the existence of a single sync (roadside data collection center).
Optimizing the transfer of traffic data in vehicle sensor networks in terms of energy consumption of sensors using spatial clustering is the main purpose of this research.
Clustering is accomplished by two methods of K-means and Genetics and then results are compared with each other.Moreover, three basic assumptions are considered in the implementation of this research:  The number of sinks is considered as a constant (same) number. All vehicles are equipped with the Global Positioning System (GPS). The communication between vehicle sensors will be via radio communication equipment.
Section 2 provides a review of previous research.The theoretical foundation of research is described in Section 3.
In Section 4, cost function of the clustering algorithm and structure of transmitting packets and in Section 5, dataset and studied area are explained and then algorithms are implemented and their achieved results are presented.Finally, conclusion and future suggestions (work) are discussed in Section 6.

RELATED WORKS
Recently, research has been conducted in the field of optimizing sensor networks by clustering.In this section, some of the most important ones will be mentioned.
A study by Thomas et al. (2018) introduced an effective method for increasing cluster and sensor longevity in wireless sensor networks.The simulation results showed that this method increases the longevity of the network, as well as a single node ) Yousif, Badlishah et al. 2018).Khalid et al. (2018) proposed a new cluster head selection algorithm that was a modification of the CEED algorithm, or MOD-CEED.MOD-CEED uses load distribution to balance the energy consumed by all sensor nodes.They specifically calculated the optimal number of network cluster heads according to the LEACH energy waste algorithm.They also introduced an efficient cluster selection method based on remaining sensor node energy and the distance between the sensor node and the base station )Darabkh and Zomot 2018).2013) proposed an efficient method for selecting cluster heads using the K-means algorithm based on minimizing total distance between cluster heads and member nodes.
Researchers showed that the proposed method outperforms existing protocols, such as LEACH and HEED )Park, Kim et al.

Vehicle Sensor Clustering
Clustering is classifying a data series to a number of groups (based on similarity) without training data.Each node includes members that are the most similar and closest to each other, and one cluster's members are noticeably different from another ) Das, Abraham et al. 2008).In each cluster, the cluster representative (cluster head) collects and organizes the cluster member node information to the sync to prevent simultaneously transferring the information of all nodes.This prevents quick node energy discharge and greatly helps maintain network longevity )Alarifi and Tolba 2019).Changing the cluster head position changes total node energy consumption in that cluster.Therefore, selecting a suitable cluster is one of the main challenges regarding this issue.This study used clustering to reduce the energy consumption of vehicular sensors.Sensors that are closer to each other require less energy for transferring information.As a result, the total energy consumed by a network's sensors depends on the costs of optimization ) Bali, Kumar et al. 2014).

K-means Clustering Algorithm
K-means is an algorithm for clustering a set of data based on the proximity to the cluster-head.This criterion is often considered to be Euclidean distance from the cluster-head which is minimized.In this research, cost function is the Eqs( 6) and ( 8

ANT Colony Algorithm
The ANT Colony algorithm is an evolutionary one.The main idea behind ANT Colony optimization is modeling the problem to search for the route with the lowest cost.ACO gains its characteristics from a certain type of ant's ability to find the shortest path between two points.In other words, ants lay pheromone paths to communicate with each other indirectly.
Ants choose their paths randomly, but the probability of choosing a path depends on the pheromones laid on the ground.At any time, each ant determines a destination according to a choice.Initially, all ants are considered to be in one node.The transfer mode probability is calculated using Eq(2):  the value of the heuristic information's reliability and relative importance, which directs ants in the search process.Pheromone information is updated using Eq(3): Pheromones are evaporated to prevent accumulation.e r the pheromone evaporation factor and its value is between 0 and 1, and The amount of pheromone left by the k ant in the path between the ( , ) ij nodes is calculated using Eq(4). () In which Q is a constant and k L is the distance travelled by the k ant.The amount of pheromone left by ants is updated using Eq(5) )Mokhtari and Rekioua 2018).
The cost function and equations 1 and 3 are also considered to be the result of modeling sensor energy consumption in this algorithm.

Cost function of the clustering algorithms
Energy in sensor networks is utilized for calculations or data transmission.Sending information and transmitting data consume much more energy compared with processing and calculations.During sending data, the energy consumption of each sensor is the function of the size of transmission packets and the transmission range.In the selected energy model of this article, the distance between each sensor and the destination (cluster-head or sink) is specified and depending on this, the transmission range changes.It is clear that in this situation less energy is used for sending to closer destinations.According to recent statements, the energy consumption for sending bits of data at d distance is calculated as Eq(6) ) Zhou, Wang et al. 2018 andSharma andBhondekar 2018).

Structure of transmitting packets
Since the energy consumption of sending data depends on the size of the transmission packets, obtaining the length of transmission packets requires a general structure for data packets.In this case, the first assumption is that ordinary nodes merely send sensed data from the environment to their own cluster-head in the form of a packet.Then, the data received from the members of each cluster is sent to the sink (data collection center) by the cluster-head.The simplest method is to consider a constant and same value for the length of data packets.The major problem of this approach is that the packet sent form a cluster-head is on average larger than packets sent from normal nodes.In addition, by increasing the number of a cluster members, the packet sent from that cluster-head is become larger.Hence, to support variable packet lengths, a straightforward model is employed in this paper ) Ebrahimi, Pahlavani et al. 2017).
In the selected model of this study, each packet has a header and a body.Packets sent from ordinary nodes have a data in addition to the header.Also, the packets sent from each cluster-head include all the data sent from the members of that cluster in addition to the header.To summarize, when the length of transmission packets is variable, both of the header size and each data sensed by a sensor are considered to be 24 bytes )Le Borgne, Santini et al. 2007).The aggregation of data in cluster-head is the summation of all data of subset sensors and header ) Ebrahimi, Pahlavani et al. 2017).

IMPLEMENTATION
The theoretical foundations of this research have been implemented in the MATLAB software version R2016b and on a 16GB memory computer with Intel (R) Core (TM) i7-7700HQ / 2.81 GHz processor.

Study area and Dataset
Our studied are is an interstate highway of 80 in Emeryville, California.The data related to the line of the passing vehicle in the east of this highway was collected by seven cameras during three time periods of 15 minutes in 13 April 2005.This dataset contains x and y coordinates of each vehicle.It records and represents the length and width of the vehicle, speed and of the vehicle, temporal and spatial distance with the front car, etc. for each car in every tenth of a second.This paper examines the location of vehicles in the same frame between 16:00 and 16:15 including 181 cars.Cameras are installed on a 30-story building adjacent to the studied area.
(The location of sink is also considered on this building).The data of car lines is extracted from video data using peculiar software which automatically detects the vast majority of vehicles and tracks their paths.The location of cars (sensors) and sink is demonstrated in Figure 1.

Defining Simulation Parameters
Table 1 represents the simulation parameters and Required optimal parameters in the Genetic algorithm respectively ) derived from the modeling of the energy consumption of the sensors.If our goal is to grouping a set of vehicles into n number of P-dimensional vectors xk (k=1,…,n) inside c clusters or groups total cost function of data transmission energy from vehicle sensors and receives it in the sensors of the cluster-head or sink.i v is the cluster-head of and is the total cost of consuming for the vehicles in the i th cluster.Indeed, first, the total energy consumption of sensors in all clusters ( ) i J is calculated, then the obtained values are summed up to get the value of the cost function for the corresponding clustering (J) )Hammouda and Karray 2000).
heuristic factor which shows the visibility between nodes i and j, k i N is the node i neighbor that ant k has not visited yet, a is the importance scale of the pheromone effect to the problem which allows the ant to choose the previous path, b represents between sender and receiver as well as the acceptable bit error value.The value of distance threshold of amplifier for sending signal to different destinations is bit error of energy consumption by amplifier for sending to near (less than 0 d ) and distant (more than 0 d ) destinations is depicted by fs e and mp e , respectively.In this model, the amount of energy consumption for receiving l bits of data is computed by Eq(8).dependent on the hardware characteristics of the sensor.This energy consumption model is exactly in line with the model applied by LEACH and CTRWSN methods ) Chen and Ye 2012, Sharma and Bhondekar 2018).

Figure 1 .
Figure 1.The location of vehicle sensors and sink

Figure 3 :
Figure 3: Clustering obtained by the implementation of the ANT Colony algorithms in 100 iterations

Figure 5 :
Figure 5: Reducing total energy consumption of the network over 100 iterations using the ANT Colony algorithm Kasson et al. (2018)proposed a new clustering protocol and a new approach for increasing wireless sensor network longevity.According to increased network longevity and the number of data packets received by the base station (BS), the simulation results and performance showed that the proposed method was better(Kassan, Lorenz et al. 2018).A study byLee et al. (2017)proposed an energy consumption optimization algorithm for wireless sensor networks based on the colony algorithm.The proposed algorithm allows each wireless sensor network node to save the neighbor node's distance and remaining energy.From a node selection and pheromone updating perspective, this algorithm compares node distance and energy to focus on updating the next node, which guarantees that lower energy nodes are selected as the next step.The proposed algorithm therefore improves energy load balancing, wireless sensor network stability and finally, wireless sensor network longevity )Zhang, Liu et al. 2017).
Sarkar et al. (2019)proposed the FCR method for selecting WSN cluster heads.They attempted to solve the main problems of WSNs by transferring data with maximum energy savings and the lowest latency )Sarkar and Murugan 2019).Park et al. (

Table 1 :
Parameters used in energy consumption modelling and ANT Colony Algorithm Performing the K-means and ANT Colony algorithms on the existing data showed their notable effect on reducing the energy consumption of sensors.They decreased the total energy consumption of the network by 41.7% and 76.8%, respectively.The studies have shown that the ANT Colony algorithm can save time approximately 61.9% and in terms of the energy consumption of sensors, represents 84.2% more effectiveness.

Table 2 :
Results of the performance of the K-means and ANT Colony algorithms in reducing the energy consumption of sensor

Table 3 :
Comparison of the performance of the Kmeans and ANT Colony algorithms in reducing the energy consumption of sensors in equal number of iterations Figure 2: Clustering obtained by the implementation of the Kmeans algorithms in 100 iterations

Table 4 :
Comparison of the run time of the K-means and ANT Colony algorithms in equal number of iterations