FOR CLUSTERING WIRELESS SENSOR NETWORK TO INCREASE LIFE OF THE NETWORK

Wireless sensor networks have attracted attention of researchers considering their abundant applications. One of the important issues in this network is limitation of energy consumption which is directly related to life of the network. One of the main works which have been done recently to confront with this problem is clustering. In this paper, an attempt has been made to present clustering method which performs clustering in two stages. In the first stage, it specifies candidate nodes for being head cluster with fuzzy method and in the next stage, the node of the head cluster is determined among the candidate nodes with cellular learning automata. Advantage of the clustering method is that clustering has been done based on three main parameters of the number of neighbors, energy level of nodes and distance between each node and sink node which results in selection of the best nodes as a candidate head of cluster nodes. Connectivity of network is also evaluated in the second part of head cluster determination. Therefore, more energy will be stored by determining suitable head clusters and creating balanced clusters in the network and consequently, life of the network increases.


INTRODUCTION
Wireless sensor networks which are used to collect information and study an environment multilaterally are composed of cheap sensors which have been dispersed in an environment and information collected with sensors should be transferred to a basic station.Since the sensor nodes have limited weight, size and cost which have direct effect on access to sources and considering that nodes have batteries, processing capability and limited communication and it is not proper to replace batteries in many applications, low power consumption is one of the essential needs in these networks and life of each sensor can be effectively increased by optimizing energy consumption.In this paper, an attempt has been made to present a combined strategy for clustering of dispersed sensors in the environment to lead to effective and efficient storage resulting in reduction of the consumed energy and increase the life of the network.In this paper, we present some performed works and the proposed method and results of simulation.

RELATED WORKS
Application of clusters for transmission of information to a base station increases advantages of short transmission to most nodes by requiring only limited number of nodes for remote transmission to base station.Clustering concerns dividing 2 the network into some independent clusters, each with one head cluster which collects all the information from nodes inside its cluster.This head cluster sends information to the base center after data compression and Single-hop Communication directly or in Multi-hop Communication with lower number of hob and only with head cluster nodes.Clustering can reduce communication cost of most nodes considerably because they should only send information to the nearest head cluster instead of sending it directly to the base center which may be very far [Fahmy 2004].In these methods, a query has been created in a sink node and broadcasted in the network.Each node processes query by receiving it and sends it to its neighbors.After complete query was processed, the result will be returned to the sink node.In this scenario, some nodes process only queries and others broadcast them and obtain partial results.They aggregate results and return them to sink node.
In some works by Bontempi et al.Lotfi Nejad et al., [2004] tried to study effect of relatively dependent data on efficiency of the clustering methods in aggregation of data.They showed that dependence of data had a considerable effect on efficiency of clustering.It means that lower dependency of data lowers efficiency of clustering.They also showed that energy spent in a node is highly dependent on location of that node in the network and the node which has longer distance from sink node consumes more energy and they also showed that life of the network had reverse relationship with energy consumption rate.
Other methods have been suggested for aggregation of data in the sensor network and Guestrin et al., tried to estimate data of a node in a time interval with a cubic function and send polynomial coefficients to sink node instead of sending data [Guestrin et al. 2004].

PROPOSED METHOD
As mentioned above, clustering is one of the considered methods for reduction of energy consumption in the wireless sensor networks.Therefore, in this paper, we decide to present a method for clustering of sensor network by combining two fuzzy method and cellular learning automata method to increase life of the network by reducing energy of the network.The proposed method has composed of several sections which are mentioned as follows.

Specifying candidate nodes for being head cluster
At the beginning of the proposed method, we will specify a candidate sensor nodes for being head cluster and for this purpose, we use fuzzy method.In this case, we use 3 factors effective on candidacy of a node for being head cluster in a network as input of fuzzy system.These factors include: 1) number of neighbor node (the nodes which are in communication range of each sensor), 2) remaining energy of sensor node, 3) distance between node and sink node.
Therefore, the used fuzzy system is composed of 3 inputs and 1 output and each of the inputs and also output of the system are divided into classes and we assign verbal words to each class and verbal words are classified and assigned to each input and output.
Two inputs of the number of neighboring node and distance to sink node were divided into 3 classes with low, medium and high verbal words.
The third input i.e. remaining energy of the sensor node was divided into 4 low, medium, high and very high classes.
Only output of the fuzzy system which specifies probability of candidacy of the sensor node for becoming head cluster was also divided into five very low, low, medium, high and very high classes.
In the above fuzzy system for AND and OR, Min and Max operators and Center of gravity defuzzifier.General scheme of fuzzy system, membership functions for input of energy level, output, fuzzy laws and a sample of test for determination of candidature of a sensor is shown and simulation of all of them has been done in the MATLAB software.Set of the fuzzy laws applied in the discussed fuzzy system is as follows: If (distance is low) and (density is low) and (energy is low) then (Probability_candidate is v_low) If (distance is low) and (density is low) and (energy is med) then (Probability_candidate is med) If (distance is low) and (density is low) and (energy is high) then (Probability_candidate is med) If (distance is low) and (density is low) and (energy is v_high) then (Probability_candidate is high) If (distance is low) and (density is med) and (energy is low) then (Probability_candidate is low) If (distance is low) and (density is med) and (energy is med) then (Probability_candidate is med) If (distance is low) and (density is med) and (energy is v_high) then (Probability_candidate is v_high) If (distance is low) and (density is med) and (energy is high) then (Probability_candidate is high) If (distance is low) and (density is high) and (energy is low) then (Probability_candidate is low) If (distance is low) and (density is high) and (energy is med) then (Probability_candidate is high) If (distance is low) and (density is high) and (energy is high) then (Probability_candidate is v_high) If (distance is low) and (density is high) and (energy is v_high) then (Probability_candidate is v_high) If (distance is med) and (density is low) and (energy is low) then (Probability_candidate is v_low) If (distance is med) and (density is low) and (energy is high) then (Probability_candidate is med) If (distance is med) and (density is low) and (energy is v_high) then (Probability_candidate is high) If (distance is med) and (density is med) and (energy is low) then (Probability_candidate is v_low) If (distance is med) and (density is med) and (energy is med) then (Probability_candidate is low) If (distance is med) and (density is med) and (energy is high) then (Probability_candidate is med) If (distance is med) and (density is med) and (energy is v_high) then (Probability_candidate is high) If (distance is med) and (density is low) and (energy is med) then (Probability_candidate is v_low) If (distance is med) and (density is high) and (energy is low) then (Probability_candidate is low) If (distance is med) and (density is high) and (energy is med) then (Probability_candidate is med) If (distance is med) and (density is high) and (energy is high) then (Probability_candidate is high) If (distance is med) and (density is high) and (energy is v_high) then (Probability_candidate is v_high) If (distance is high) and (density is low) and (energy is low) then (Probability_candidate is v_low) If (distance is high) and (density is low) and (energy is med) then (Probability_candidate is low) If (distance is high) and (density is low) and (energy is high) then (Probability_candidate is med) If (distance is high) and (density is low) and (energy is v_high) then (Probability_candidate is high) If (distance is high) and (density is med) and (energy is low) then (Probability_candidate is low) If (distance is high) and (density is med) and (energy is med) then (Probability_candidate is med) If (distance is high) and (density is med) and (energy is high) then (Probability_candidate is high) If (distance is high) and (density is med) and (energy is v_high) then (Probability_candidate is v_high) If (distance is high) and (density is high) and (energy is low) then (Probability_candidate is low) If (distance is high) and (density is high) and (energy is med) then (Probability_candidate is high) If (distance is high) and (density is high) and (energy is high) then (Probability_candidate is v_high) If (distance is high) and (density is high) and (energy is v_high) then (Probability_candidate is v_high) It is necessary to note that the nodes are introduced as candidate node when the calculated probability in output of the fuzzy system is higher than the average rate.

Selection of head clusters among the candidate nodes
In this stage, we use cellular learning automata for determination of the certain condition (becoming or not becoming head cluster) of the nodes which have introduced them as node of its candidate head cluster in the previous stage.Since each node of the sensor has two conditions, then each one of the candidate nodes can select one of two states of cluster head and common node.For this work, we consider a learning automata corresponding to each one of the candidate sensors and the corresponding automata can select one of two states of CH and CN based on their probability vector where CH indicates cluster head and CN indicates common node and probability of selecting each one of two actions is equal to 0.5.Probability of being cluster head based on different parameters decreases or increases based on different parameters with each selection.The parameters which we use for determination of cluster head among the candidate nodes include: • Energy rate.Since cluster head node should collect information and send it to the sink node, it consumes more energy than other nodes.Therefore, attempt is made to select a node which has more energy than its neighbors.For this purpose, we use a difference between node energy and mean energy of its neighbors.• Number of neighbor nodes.Since the energy consumption rate in cluster head node is high, an attempt should be made to select the lowest number of cluster head among the candidate nodes, therefore, the candidate nodes which should be selected for becoming a cluster head when the number of its neighbors is higher than the mean number of its neighbor nodes, otherwise, the selected candidate node is found for becoming cluster head.• Number of neighbor cluster head nodes.
One of the important criteria for clustering is connectivity.It means that each node should be able to send its information to sink node.Therefore, either each node should have a cluster head node or one of its neighbors should be cluster head.Hence, in case a candidate node is selected as common node so no cluster head node is its neighbor, it will be finally fined.
Another important point is that since the number of cluster heads of the network should not be high, in case the candidate node which is selected as cluster head had neighbor cluster head node should be fined.• Capacity of cluster.One of the connectivity criteria is maximum size of cluster.If the number of nodes of a cluster is high, the consumed energy of cluster head will be high for receiv-ing and sending data and information may be lost on the other hand.Therefore, considering the capacity of the cluster, more balanced clusters will be created.Then, in case one of the candidate nodes is selected as common node and ratio of the number of its common neighbors to the number of its cluster head neighbors is higher than the capacity of cluster, it will be fined and we consider the capacity of cluster equal to 1.13N, based on some performed works.
Considering the above-mentioned parameters, probability of performing that action will change by selecting each action with node automata.For rewarding and penalty, we use Relations ( 1) and (2), where a is a reward coefficient and b is a penalty coefficient.
In each round of node, reinforcement signal iᵦ is calculated after selecting an action based on Relations (3) and (7).If iᵦ is equal to 1, the selective action is fined with Relation (2) and if it is equal to 0, it will be rewarded in Relation (1).If the selective action is head clustering, value of iᵦ is obtained from Relation (3): (2) In each round of node , reinforcement signal iᵦ is calculated after selecting an action based on Relations (3) and (7).If iᵦ is equal to 1, the selective action is fined with Relation ( 2) and if it is equal to 0, it will be rewarded in Relation (1).If the selective action is head clustering, value of iᵦ is obtained from Relation (3): So that e(n) is the remaining energy in the n-th round and eµ(n) is mean energy of node.
Ni is the number of neighbor node and Nµ is the mean number of neighbors in the neighbor nodes.
α j(n) is the selective action of node j.

So that:
(2) In each round of node , reinforcement signal iᵦ is calculated after selecting an action based on Relations (3) and ( 7).If iᵦ is equal to 1, the selective action is fined with Relation ( 2) and if it is equal to 0, it will be rewarded in Relation (1).If the selective action is head clustering, value of iᵦ is obtained from Relation (3): So that e(n) is the remaining energy in the n-th round and eµ(n) is mean energy of node.
Ni is the number of neighbor node and Nµ is the mean number of neighbors in the neighbor nodes.
α j(n) is the selective action of node j.
Constant coefficient of we is the weight given parameters of energy in the clustering algorithm.Constant coefficient of wu is the weight given to parameters relating to quality of clustering infrastructure and these two coefficients are between 0 and 1 so that sum of coefficients becomes equal to 1: where: e(n) is the remaining energy in the n-th round and e µ (n) is mean energy of node. ( In each round of node , reinforcement signal iᵦ calculated after selecting an action based Relations ( 3) and ( 7).If iᵦ is equal to 1, the selective action is fined with Relation ( 2) and if it is equal to 0, it will be rewarded Relation (1).If the selective action is head clustering, value of iᵦ is obtained from Relation (3): So that e(n) is the remaining energy in the n-th round and eµ(n) is mean energy of node.
Ni is the number of neighbor node and Nµ is the mean number of neighbors in the neighbor nodes.
α j(n) is the selective action of node j.
Constant coefficient of we is the weight given parameters of energy in the clustering algorithm.Constant coefficient of wu is the weight given to parameters relating to quality of clustering infrastructure and these two coefficients are between 0 and 1 so that sum of coefficients becomes equal to 1: If the selective action is selection of node as common node, value of iᵦ will be obtained from Relation ( 6): (4) where: N i is the number of neighbor node and N µ is the mean number of neighbors in the neighbor nodes. ( In each round of node , reinforcement signal iᵦ is calculated after selecting an action based on Relations (3) and ( 7).If iᵦ is equal to 1, the selective action is fined with Relation ( 2) and if it is equal to 0, it will be rewarded in Relation (1).If the selective action is head clustering, value of iᵦ is obtained from Relation (3): So that e(n) is the remaining energy in the n-th round and eµ(n) is mean energy of node.
Ni is the number of neighbor node and Nµ is the mean number of neighbors in the neighbor nodes.
α j(n) is the selective action of node j.
Constant coefficient of we is the weight given parameters of energy in the clustering algorithm.Constant coefficient of wu is the weight given to parameters relating to quality of clustering infrastructure and these two coefficients are between 0 and 1 so that sum of coefficients becomes equal to 1: If the selective action is selection of node as common node, value of iᵦ will be obtained from Relation ( 6): ( 5) where: α j (n) is the selective action of node j.
Constant coefficient of w e is the weight given parameters of energy in the clustering algorithm.
Constant coefficient of w u is the weight given to parameters relating to quality of clustering infrastructure and these two coefficients are between 0 and 1 so that sum of coefficients becomes equal to 1.If the selective action is a selection of node as a common node, value of β i will be obtained from Relation (6): Constant coefficient of we is the weight given parameters of energy in the clus of wu is the weight given to parameters relating to quality of clustering infras between 0 and 1 so that sum of coefficients becomes equal to 1: If the selective action is selection of node as common node, value of iᵦ will be

So that:
This stage is performed in several rounds.In each round, each sensor n becoming cluster head based on its probability vector and broadcasts a m contains node selective action, remaining energy and the number of its received message of their neighbors, each node is rewarded or fined base and increases or decreases probability of becoming or not becoming cluste on new probability and repeat operations.
Each node of which probability of becoming head cluster reaches zero reaches stable condition.This algorithm continues until a clear percent o stable conditions.At this time, all nodes select their state and this stage en been determined while status of few candidate nodes may not be determ status has been determined as common node are not in neighborhood of nodes to the cluster head nodes due to coverage of such common node having abundant with the adjacent nodes

Formation of Cluster
After specifying status of the candidate nodes and determining cluster hea this stage, the cluster head nodes broadcast a message based on their common nodes select the nearest node as cluster head among cluster head a packet to its cluster head and identifies members of the cluster by collec them to all nodes of the cluster based on time schedule.Time for submissi

Data Transmission
In this stage, common nodes send their data to cluster head nodes alternat cluster head aggregates packets and sends it as a single packet to the sink cluster head.In this stage, each common node of which data was sent is a sending packet to the sink node.The cluster head node will not be active to receive data of member nodes.

Change of Cluster Head
It is evident that energy of cluster head nodes is consumed faster tha network is disrupted.Under such condition, we use change of cluster he nodes send some of their remaining energy to the cluster head node in e node sent the aggregated packet to the sink node, the cluster head node wo this energy rate is higher than the threshold limit, the node which has mor period, each node which sends data to it responds with message of chan (Saeedian , 2011).

Calculating Energy Consumption Rate
In this paper, to calculate energy consumption rate of the sensors, it has each round.To calculate energy consumption of each sensor in each rou Relation will be used and this Relation is mentioned as follows.
This stage is performed in several rounds.In each round, each sensor node selects one of the conditions of becoming or not becoming cluster head based on its probability vector and broadcasts a message to all of its neighbors and the message which contains node selective action, remaining energy and the number of its neighbors.After the specified time which all nodes received message of their neighbors, each node is rewarded or fined based on its selective action based on Relations (1) and ( 2) and increases or decreases probability of becoming or not becoming cluster head.In the next round, nodes select new state based on new probability and repeat operations.
Each node of which probability of becoming head cluster reaches zero or one selects a state based on probability vector and reaches stable condition.This algorithm continues until a clear percent of candidate nodes (95% in the performed tests) reach stable conditions.At this time, all nodes select their state and this stage ends.The status of the major part of the candidate nodes has been determined while status of few candidate nodes may not be determined.There are statuses where some nodes of which status has been determined as a common node are not in neighborhood of any cluster head node.Here, we add some candidate nodes to the cluster head nodes due to coverage of such common nodes and they are selected as cluster head node based on having abundant neighbors, compared with the adjacent nodes.

Formation of cluster
After specifying the status of the candidate nodes and determining cluster heads in the previous stages, it is time to create clusters.In this stage, the cluster head nodes broadcast a message (3) (6) (7) based on their geographical position to the adjacent nodes and then common nodes select the nearest node as cluster head among cluster head neighbors.To create cluster, each common node sends a packet to its cluster head and identifies members of the cluster by collecting these packets and form cluster and then broadcasts them to all nodes of the cluster based on time schedule.Time for submission of packet is specified by each one of the members.

Data transmission
In this stage, common nodes send their data to cluster head nodes alternatively and with specified time intervals and node of the cluster head aggregates packets and sends it as a single packet to the sink node after all nodes in a cluster have sent their data to cluster head.In this stage, each common node of which data was sent is activated based on time schedule and is inactivated after sending the packet to the sink node.The cluster head node will not be active in all time periods and is activated only when it wants to receive data of the member nodes.

Change of cluster head
It is evident that energy of cluster head nodes is consumed faster than other member nodes due to higher activity and the network is disrupted.Under such condition, we use change of cluster head node to prevent this problem such that the member nodes send some of their remaining energy to the cluster head node in each data submission period and after the cluster head node sent the aggregated packet to the sink node, the cluster head node would calculate mean energy of the member nodes and if this energy rate is higher than the threshold limit, the node which has more energy will become cluster head and in the new time period, each node which sends data to it responds with message of chang_clustering and introduces the new cluster head node [Saeedian at al. 2011].

Calculating energy consumption rate
In this paper, to calculate energy consumption rate of the sensors, it has been assumed that all sensors will send K bit data in each round.To calculate energy consumption of each sensor in each round, Relation (4) which was known as Hizelman's Relation will be used and this Relation is mentioned as follows: where: K -is the number of the transmitted bit in each round which is sent from each sensor node.K value is constant for all sensor nodes.d -is distance between common sensor node and cluster head node.For the cluster head node, there is a distance between cluster head node and sink node.
Parameters ؏ amp and ؏ elec are regarded as energy which internal circuit of each sensor consumes at time of data transmission and is equal to constant values.؏ amp is equal to 100 Pj/bit•m 2 which is equivalent to 100•10 -12 j and ؏ elec is equal to value of 50 nj/bit which is equivalent to value of 50•10 -9 j.
The point is that the cluster head nodes consume energy for receiving data and there are different methods to calculate energy of the cluster head at time of receiving data from member sensors.In the method which has been used in this paper, the cluster head node receives n-bit packets based on the number of member nodes and converts them into n-bit packet and sends them.The difference is that we consider the consumed energy for this conversion.This consumed energy is known as E DA and its value is considered as 5•10 -9 which is added to the consumed energy value for submission of data to sink node [Al-Obaidy et al. 2008].

SIMULATION
In this paper, we evaluate the proposed method with 2 different scenarios and compare the above method with Leach's algorithm to show efficiency.In this research, attempt has been made to continue evaluation until the network has real value.For this reason, the network continues working until the number of the live nodes in the network is such that they create acceptable cover in the environment [Heinzelman et al. 2000].
In this paper, MATLAB software which is a suitable environment for simulation has been used for simulation and the constant parameters used in simulation are mentioned as follows: • The sensor nodes are dispersed in the environment randomly and each node has range of sensor Rs and sensor environment of each node is a circle with radius of Rs. • Base station (sink) is located in the middle of the environment.
• All nodes have equal energy and power at the beginning.• Identification number of all nodes was recognized for sink node.• The initial energy of all nodes is first 0.1 joules.• In the performed tests, the network continues its activity until it has effective cover in the environment and when a node dies, its energy reaches below 0.05 joules.• To determine effective cover of the entire plate as set of points that is we produce points 0• 0 to L•L for a environment with dimensions of L•L. at the end of each round, we check data submission and some points are present in sensor range of the active nodes.
First scenario -studying death time of 10%, 20% and 30% of sensors.100 sensors have been broadcasted in the environment with dimensions of 500 • 500 and sensor range of each sensor is equal to 20 and the diagram of number of live node relative to the number of executive round for the proposed method compared with LEACH algorithm (Figure 6, Table 1).
Second scenario -studying the number of effective executive round of the network.In this test, 30 sensors have been broadcasted in an environment with dimensions of 100•100 and the number of the executive round of the network has been compared with Leach algorithm until it creates effective cover in the network (here, we considered effective cover equal to cover above 59%).

Fig. 1 .
Fig. 1.Single-hop Communication and Multi-hop Communication with clustering [2005], Virrankoski et al. [2005] and Soro et al. [2005], network is first clustered and then head clusters aggregate the data received from each cluster separately.

Fig. 2 .
Fig. 2. General scheme of the presented fuzzy system

Fig. 3 .
Fig. 3. Membership function relating to energy level

Fig. 5 .
Fig. 5.A sample of a performed test for determination of candidate probability of a sensor\

Fig. 6 .
Fig. 6.Diagram of the number of live node relative to the first scenario time

Fig. 7 .
Fig. 7. Diagram of the number of executive round

Table 1 .
Comparing results of two algorithms in the first scenario