# Combinatorial Optimization-Based Clustering Algorithm for Wireless Sensor Networks

Authors: Yuxiao Cao; Zhen Wang
Journal: Mathematical Problems in Engineering
 (2020)

---

## Abstract

As node energy of wireless sensor networks (WSN) is limited and cannot be supplemented after exhaustion, clustering algorithm is frequently taken as an effective method to prolong the lifetime of WSN. However, the existing clustering algorithms have some drawbacks, either consuming excessive energy as a result of exchanging too much controlling information between nodes, or lacking a comprehensive perspective in terms of the balance among several conflicting objectives. In order to overcome these shortcomings, a novel combinatorial optimization-based clustering algorithm (COCA) for WSN is proposed in this paper. Different from the above mentioned algorithms which take clustering as a continuous optimization problem, COCA solves the clustering problem from the perspective of combinatorial optimization. Firstly, the clustering of WSN is abstracted into a combinatorial optimization problem. Then, the binary particle coding scheme of cluster head is proposed, which is based on the corresponding relationship between nodes and particle position vectors, and the fitness function is designed according to the parameters used in the process of cluster formation. Finally, the binary particle swarm optimization algorithm is applied to implement the clustering. COCA is validated under different scenarios compared with three other clustering algorithms. The simulation results show that COCA has better performance than its comparable algorithms.


---

## Body

## 1. Introduction

As a key part of the Internet of Things (IOT) [1, 2], wireless sensor network (WSN) has been widely utilized in many fields such as industry, agriculture, military, environmental monitoring, transportation, smart home, and so on [3–8]. WSN is composed of a large number of sensor nodes which are deployed in the surveillance area. Each sensor node with limited computing, storage, and communication capabilities is usually powered by batteries. In most cases, it is difficult to replace the batteries after node deployment. Once the battery power is exhausted, the sensor node will die, and the network lifetime will be over after a large number of nodes died. To overcome the shortcomings, research on the schemes of saving node energy and prolonging network lifetime becomes a key issue in the field of WSN [9, 10].The clustering technology can reduce the energy consumption of nodes and prolong the lifetime of networks [11, 12]. A WSN network can be divided into several subsets which are called clusters by using the technology of clustering. The nodes in the same cluster are adjacent to each other geographically. In each cluster, one node is selected as the cluster head (CH), and other nodes act as the members of the cluster. Instead of communicating with the base station (BS) directly, the members send their sensed data to the CHs in which the data is aggregated and sent to the BS [13, 14]. The earliest proposed WSN clustering algorithm is low-energy adaptive clustering hierarchy (LEACH) [15]. Compared with the previous planar routing algorithms, LEACH can make the network lifetime longer [16, 17]. However, LEACH selects the CHs only according to the result of the comparison of a random number generated by the node and a predefined fixed threshold, which makes the number of clusters and the election of CHs very random. LEACH does not guarantee the best clustering scheme from the point of view of the energy balance of the whole network.Since the emergence of LEACH, a lot of WSN clustering algorithms have been proposed. There are several kinds of clustering algorithms based on different clustering criteria such as network structure, communication model, topology, and reliable routing. In this paper, we classify clustering algorithms into two categories, i.e., independent and cooperative, according to whether the BS participates in the process of clustering. Independent clustering algorithms run on network nodes without the BS’s participation, and control information is exchanged among nodes. Independent clustering algorithms include HEED [18], PEGASIS [19], EECS [20], EEMC [21], TEEN [22], ECO-LEACH [23], NR-LEACH [24], and ECCR [25], etc. In cooperative algorithms, the BS participates in the process of clustering, and all or part work of clustering is done by the BS. A small amount of control information is exchanged between the BS and network nodes. The cooperative algorithms include LEACH-C [26], PDOPR [27], UC-GA and KC-GA [28], PSO-ECHS [33], approaches in [34–36], etc. The above-mentioned two kinds of clustering algorithms both prolong the lifetime of the network to some extent, but there are still some shortcomings in terms of the working mechanism. Independent algorithms run on each node, and a large amount of control information needs to be exchanged among nodes, which leads to additional energy consumption. Although the cooperative algorithms reduce the energy consumption of control information exchange, they still cannot get the best clustering result from the perspective of the whole network because there are multiple parameters affecting the clustering and these parameters are mutually conflicting. In particular, with the development of evolved nature inspired algorithms, some clustering approaches employ them to improve clustering performance in recent years [33–36].To reduce the node energy consumption and prolong the network lifetime, we propose a combinatorial optimization-based clustering algorithm (COCA) which runs on the BS for WSN from the point view of combinatorial optimization in this paper. We abstract WSN clustering into a combinatorial optimization problem and employ binary particle swarm optimization (BPSO) algorithm to solve it. In [33–36], continuous particle swarm optimization (PSO) is employed for WSN clustering, the position component of the particle is a real number in a certain interval, and the corresponding relationship between particle position and CHs is established by using a transforming formula. In contrast, COCA applies binary PSO for clustering in which the position component of the particle is either 0 or 1 in binary space. Furthermore, COCA directly determined that whether the node is a CH based on the value of the particle position component: if the value is 1, the node corresponding to the component is elected as a CH; contrastively, if the component value is 0, the corresponding node is selected as a member of a cluster.The main contributions of this paper are as follows.(1)
Based on the objective and procedure, the clustering of WSN is abstracted into a combinatorial optimization problem(2)
A novel binary particle coding scheme is designed to present the selection of CHs(3)
After the CHs are elected, the constraints between parameters which affect clustering are considered comprehensively. Then the fitness function is designed, and the clustering process is implemented by using BPSOAs the main innovation and contribution, COCA establishes a direct correspondence relationship between the binary value of particle components and the role of whether nodes act as a CH. After determining how to use binary coding to represent whether a node is a CH, COCA can be implemented not only by using BPSO but also by applying other swarm intelligence algorithms discrete version. Because BPSO has the advantages of a few parameters, simple implementation, and fast convergence, we employ BPSO to solve the WSN clustering problem based on combinatorial optimization.The rest of this paper is organized as follows. In Section2, related works are discussed. In Section 3, the concept of combinatorial optimization and BPSO is presented firstly; then the network and energy consumption model of WSN are introduced. Section 4 describes the proposed algorithm COCA in detail. In Section 5, the simulation results are shown to demonstrate the effectiveness of COCA. Finally, conclusions are drawn in Section 6.


## 2. Related Work

In order to elaborate the principle of COCA clearly, the classical LEACH and other representative WSN clustering algorithms proposed in recent years are summarized briefly as follows.In LEACH [15], the lifespan of WSN is divided into a number of periods called rounds. Each round consists of two phases: cluster setup phase and stable phase. In the cluster setup phase, each node generates a random number r in the interval [0, 1] and compares r with a threshold Tn. The calculation of Tn is shown in the following equation:(1)Tn=p1−prmodp−1,n∈G,0,where p represents the percentage of CHs in the network, r stands for the number of the current round, n denotes a sensor node, and G is the set of nodes that never acted as CH in the last p−1 rounds.Ifr is less than Tn, the node will take the role of CH. Otherwise, it will be a member node. After being elected, each CH broadcasts its own packet information to the network. When other nodes receive the broadcast information from CHs, they decide to join a cluster according to the received signal strength. Subsequently, the member node sends the request packet to the CH to which they belong. If the request is agreed by the CH, the time division multiple address (TDMA) slice is allocated to the member node to prevent communication conflicts between nodes in the same cluster. After the clustering is completed, the stable phase begins. In the stable phase, the member node sends the sensed data to its CH, and the CH aggregates the received data and transmits them to the BS. The core idea of LEACH is to select different nodes as CHs in a random way so that the energy consumption can be spread over different nodes as much as possible to prolong the network lifetime. However, LEACH uses a random algorithm to select CH without considering the residual energy of nodes. In the process of clustering, LEACH only takes the distance between member nodes and CH into account and does not consider the size of clusters and the distance between CHs and the BS. Consequently, some CHs will die early because of overload, which reduces the network's lifetime.In [24], a node ranked-LEACH (NR-LEACH) for WSN was presented by Al-Baz and Sayed. In NR-LEACH, the clustering is divided into two stages: cluster setup and stable communication. Node rank (NR) algorithm is used to select the CHs in the setup stage. The NR algorithm calculates the rank of each node through a number of iterations based on the received signal strength, residual energy, and the number of connections with other nodes. After all, nodes calculated the rank, the node that has the highest rank is selected as the CH. NR-LEACH considers the influence of more than one factor on clustering when CHs are selected. However, when member nodes choose different clusters to join, NR-LEACH does not consider the influence of different attributes of member nodes on clustering.In [25], Hosen and Cho proposed an energy centric cluster-based routing protocol for WSN (ECCR). ECCR divides the whole network into several static grids, and all nodes in each grid constitute a cluster. Each node calculates its rank according to the residual energy and the average distance to other nodes in the cluster. In the first round, each node broadcasts its rank value and residual energy information to other nodes in the same cluster. The node which has the largest rank value is elected as the CH. If the rank of some nodes is equal to the rank of other nodes, the node with the largest residual energy is selected as the CH. From the second round, the CH of the current round selects the node with the largest rank as the CH of the next round. In the clustering procedure, the residual energy of nodes and the average distance to other nodes are taken into account, which makes the lifetime of the selected CHs longer. However, the nodes number and membership of clusters remains unchanged throughout the whole lifetime of the network, which will lead to the premature death of some clusters and affect the overall performance of the network.In [29], Hai et al. put forward a novel fuzzy clustering scheme for 3D WSN called FCM-3 WSN. In FCM-3 WSN, firstly, the authors established a mathematical model of clustering in 3D WSN which takes into account the network energy consumption, communication constraints, and the characteristics of the 3D network. Then the Lagrange multiplier method is utilized to calculate the cluster centers and the membership matrix of the model which is used to cluster the network.In [30], Shen et al. proposed a new energy efficient centroid-based routing protocol (EECRP) for WSN. In EECRP, the conception of “energy centroid” is introduced. At the beginning of clustering, all nodes send their location and energy information directly to the BS. The BS calculates the average energy and the maximum communication distance of the whole network. Then, according to the given proportion, some nodes are randomly selected as CHs, and CHs’ ID are sent back to the network. On the basis of information from the BS, all nodes know who is CH in the network. The remaining nodes join a cluster whose CH is the nearest to them. At the end of each round, the CH calculates the energy centroid of the cluster and selects the member node whose distance is the closest to the energy centroid and the remaining energy is above the average energy of the cluster as the CH of the next round. The EECRP utilizes the position changing of the energy centroid to balance the energy consumption of nodes in a cluster and prolongs the lifetime of the network. However, the nodes (including the CH and cluster members) of a cluster remain unchanged throughout the whole network lifetime. When the CH is rotated, some nodes will probably die prematurely, because the energy consumption of nodes in different clusters cannot be balanced while it is balanced in a single cluster.In [31], Zhang et al. presented an improved LEACH algorithm for WSN to optimize the election of CH. In the initialization stage, the BS broadcasts the initialization message to the whole network. After receiving the initialization message, all nodes estimate the distance from themselves to the BS according to the received signal strength and then save the information of adjacent nodes in a table. In the setup phase, the nodes located in the communication radius of the BS communicate with the BS directly, while others are clustered for effective data transmission. When the CH is being elected, the formula which is used to calculate the threshold in the original LEACH is modified to make the residual energy of nodes, the average energy of networks, the distance between nodes, and the BS play an important role in the calculation of the threshold. In the stable phase of clustering, single-hop and multi-hop communication are both utilized to transmit data from CHs to the BS. If the distance between a CH and the BS exceeds the communication radius, the CH chooses another CH, which is closer to the BS, as the relay node. Although the improved LEACH considers the energy and distance of the node, it still relies on a completely random mechanism to select the CH. It is not guaranteed to select the most suitable node as the CH from more than one node that meets the qualification.In [32], a new energy efficient multihop routing technique (MR) is put forward by Alnawafa and Marghescu. In MR, nodes are divided into three categories: CHs, member nodes, and independent nodes (IN). INs are the nodes that communicate directly with the BS without joining any cluster. The round of MR is composed of four phases: initial, announcement, tables preparation, and routing. In the initial phase, the clustering process is completed. In tables preparation phase, member nodes calculate their level based on the distance to corresponding CHs, and the CHs judge their level according to their distance to the BS. Each cluster member that is located at the second level, CHs and INs which are located at the second or more level, establish their own routing table, respectively. In the routing phase, member nodes in the second level communicate with CH, and CHs communicate with the BS according to their routing table, respectively. In MR, an accurate routing mechanism is proposed which greatly reduces the energy consumption of sensed data transmission. However, MR algorithm does not consider the size of the cluster area and the distance from the CHs to the BS, and MR sets the number of members the same in different clusters, so that the energy consumption of different clusters is unbalanced and some nodes are prone to die prematurely.In [33], Rao et al. proposed a PSO-based energy efficient cluster head selection algorithm for WSN (PSO-ECHS). In PSO-ECHS, the following parameters are taken into account: the distance from the nodes to the CH, the distance from the CHs to the sink and the influence of the residual energy on the clustering performance, and a linear combination of these parameters are used as the fitness function of particles. Furthermore, PSO-ECHS takes the coordinates of the candidate CH as the position vector of the particles. However, after updating the position of the particles, the position component cannot correspond to the coordinates of the nodes precisely. Therefore, PSO-ECHS selects the node which is the nearest to the position component of a particle which has the global optimal value as the CH. This approximate approach cannot enable the final clustering scheme to the optimal.In [34], Azharuddin and Jana presented a PSO-based approach for energy-efficient and energy-balanced routing and clustering in WSN. In the routing algorithm, the authors build a tradeoff between energy efficiency and energy balance. In the clustering algorithm, the energy consumption of CHs and cluster member nodes are both taken into account. When applying PSO to cluster the WSN, the coding scheme of particles is as follows: the dimension of particles is the same as the number of network nodes, and the position component of each dimension of particles is a random number r which obeys the uniform distribution in the interval (0, 1]. An integer k is obtained from r through a transformation formula, and k is taken as the ID of a CH to which the node corresponding to the particle position component belongs. In addition, a fitness function is designed to minimize the energy consumption of data transmission and balance the residual energy in the transmission path.In [35], Kuila and Jana put forward energy efficient clustering and routing algorithms for wireless sensor networks: particle swarm optimization approach. In this approach, the particle encoding scheme for clustering is the same as that of [34], but the objective of the fitness function is to make the CH have the longest life and the cluster members have the shortest average distance to the CH.In [36], Wang et al. suggested an improved routing scheme with special clustering using the PSO algorithm for heterogeneous WSN (EC-PSO). In the first stage of EC-PSO, CHs are elected according to geographical location. When the network is running for a period and the energy of nodes is not equal to each other, EC-PSO is applied to cluster the WSN again. EC-PSO employs PSO to find the energy center of the network, and the node near the energy center is selected as the CH. In addition, EC-PSO uses a protection mechanism to prevent low-energy nodes from becoming CHs. In EC-PSO, the encoding scheme of the particle is that the dimension of the particle is equal to the number of CHs, and the position component of particles is a 2-tuple which contains the coordinates of the energy center. During the iteration, the node that is the nearest to the energy center is elected as the CH. The particle position components in EC-PSO are also continuous real numbers.


## 3. Preliminaries and System Model

A lot of algorithms are proposed to solve combinatorial optimization problems [37], such as simulated annealing, tabu search, greedy randomized adaptive search procedure (GRASP), variable neighborhood search (VNS), and BPSO [39]. As BPSO has the characteristics of a few parameters, quick convergence, and easy to implement, we employ BPSO to cluster the WSN. In this section, a brief introduction to combinatorial optimization and BPSO is given firstly, and then the network model and energy consumption model of WSN are described.


### 3.1. Overview of Combinatorial Optimization

Many problems in engineering can be transformed into optimization problems. The so-called optimization problem is to select the best one among a plurality of sets of variables to meet a particular need. Combinatorial optimization is a branch of optimization algorithms which is devoted to discovering the optimal grouping, order, or arrangement of discrete events with mathematical methods.


### 3.2. Overview of Binary Particle Swarm Optimization

As BPSO is developed from continuous PSO; therefore a brief look at PSO and BPSO is taken, respectively, as follows. PSO [38] is a swarm intelligence algorithm that simulates the foraging behavior of birds. For PSO, a potential solution to an optimization problem is represented by a particle, and the number of particles is called population size. Each particle has a position vector Xik=Xi1k,Xi2,k,…,XiNk and a velocity vector Vik=Vi1k,Vi2k,…,ViNk in D-dimensional space. In the D-dimensional space, the particles fly to the individual extreme points they have experienced and the global extreme points that the whole population has experienced, and the optimal solution of the optimization problem is obtained in this way.When particles fly in aD-dimensional space, the d-th dimensional position and velocity vector of the i-th particle in the k-th iteration can be expressed by using the following equations, respectively:(2)Xidk=Xidk−1+Vidk,(3)Vidk=wVidk−1+c1r1PBid−Xidk−1+c2r2GBid−Xidk−1,where w is the inertia factor which is utilized to keep the balance between the optimal personal and optimal global function value, c1 and c2 indicate learning factors which are applied to represent the summary of the experience of individual particle and whole population, r1 and r2 are two random numbers between 0 and 1, and PB and GB are the optimal personal and optimal global fitness function value, respectively.Continuous PSO is usually used to solve continuous optimization problems. However, some problems are finally abstracted as a combinatorial optimization one. Hence, Kennedy and Eberhart proposed BPSO in 1997. For BPSO, the continuous vector of particle position in continuous PSO is replaced by a discrete vector whose component is either 0 or 1 in binary space. For BPSO, the particle velocity vector updating formula is the same as that of the continuous PSO as shown in equation (3). However, the position vector is updated as follows:(4)Xidk=1,r0,1<SVidk,0,otherwise,where S is calculated by using the following equation:(5)SVidk=11+e−Vidk.In equation (5), the S function is the commonly used fuzzy function in neural networks which is called Sigmoid.For BPSO, the probability that a particle is set to 0 or 1 is as follows:(6)PXidk=1=SVidk.


### 3.3. Network Model

We assume the network model of WSN used in this paper has the following properties.(1)
The nodes are randomly deployed in a square area ofL ∗ L. The initial energy of nodes is equal to each other, and the nodes cannot move after deployment(2)
The BS is located at the center of one edge of the WSN area with infinite energy. The BS knows the location and initial energy of nodes. COCA runs on the BS(3)
The BS can calculate the residual energy of the network node according to the number of the data packets sent by the node(4)
The member nodes of a cluster can adjust their transmission power according to their distance to the CH(5)
After a cluster is constructed, the CH uses TDMA to allocate time slots to member nodes for transmitting data(6)
Single-hop communication is utilized


### 3.4. Energy Consumption Model

To calculate the energy consumption of a single node as well as the whole network, we make use of the energy consumption model in [15]. The energy consumption of a node sending l bits is as follows:(7)ETxl,d=l∗EElec+l∗εfs∗d2d<d0,l∗EElec+l∗εmp∗d4d≥d0,where l is the number of bytes sent by a node (CH or member), d denotes the distance of data transmission, EElec indicates the energy consumed by the sensor circuit to process one-bit data, εfs represents the energy consumption coefficient of the wireless channel in free space transmission model, εmp stands for the energy consumption coefficient of the wireless channel in multipath attenuation transmission model, and d0 is a threshold which is expressed as follows:(8)d0=εfsεmp.The energy consumption of a node (CH or member) receivingl bits is expressed in the following equation:(9)ERxl=l∗EElec,where EElec is the energy consumed by the sensor circuit to process one-bit data.


## 3.1. Overview of Combinatorial Optimization

Many problems in engineering can be transformed into optimization problems. The so-called optimization problem is to select the best one among a plurality of sets of variables to meet a particular need. Combinatorial optimization is a branch of optimization algorithms which is devoted to discovering the optimal grouping, order, or arrangement of discrete events with mathematical methods.


## 3.2. Overview of Binary Particle Swarm Optimization

As BPSO is developed from continuous PSO; therefore a brief look at PSO and BPSO is taken, respectively, as follows. PSO [38] is a swarm intelligence algorithm that simulates the foraging behavior of birds. For PSO, a potential solution to an optimization problem is represented by a particle, and the number of particles is called population size. Each particle has a position vector Xik=Xi1k,Xi2,k,…,XiNk and a velocity vector Vik=Vi1k,Vi2k,…,ViNk in D-dimensional space. In the D-dimensional space, the particles fly to the individual extreme points they have experienced and the global extreme points that the whole population has experienced, and the optimal solution of the optimization problem is obtained in this way.When particles fly in aD-dimensional space, the d-th dimensional position and velocity vector of the i-th particle in the k-th iteration can be expressed by using the following equations, respectively:(2)Xidk=Xidk−1+Vidk,(3)Vidk=wVidk−1+c1r1PBid−Xidk−1+c2r2GBid−Xidk−1,where w is the inertia factor which is utilized to keep the balance between the optimal personal and optimal global function value, c1 and c2 indicate learning factors which are applied to represent the summary of the experience of individual particle and whole population, r1 and r2 are two random numbers between 0 and 1, and PB and GB are the optimal personal and optimal global fitness function value, respectively.Continuous PSO is usually used to solve continuous optimization problems. However, some problems are finally abstracted as a combinatorial optimization one. Hence, Kennedy and Eberhart proposed BPSO in 1997. For BPSO, the continuous vector of particle position in continuous PSO is replaced by a discrete vector whose component is either 0 or 1 in binary space. For BPSO, the particle velocity vector updating formula is the same as that of the continuous PSO as shown in equation (3). However, the position vector is updated as follows:(4)Xidk=1,r0,1<SVidk,0,otherwise,where S is calculated by using the following equation:(5)SVidk=11+e−Vidk.In equation (5), the S function is the commonly used fuzzy function in neural networks which is called Sigmoid.For BPSO, the probability that a particle is set to 0 or 1 is as follows:(6)PXidk=1=SVidk.


## 3.3. Network Model

We assume the network model of WSN used in this paper has the following properties.(1)
The nodes are randomly deployed in a square area ofL ∗ L. The initial energy of nodes is equal to each other, and the nodes cannot move after deployment(2)
The BS is located at the center of one edge of the WSN area with infinite energy. The BS knows the location and initial energy of nodes. COCA runs on the BS(3)
The BS can calculate the residual energy of the network node according to the number of the data packets sent by the node(4)
The member nodes of a cluster can adjust their transmission power according to their distance to the CH(5)
After a cluster is constructed, the CH uses TDMA to allocate time slots to member nodes for transmitting data(6)
Single-hop communication is utilized


## 3.4. Energy Consumption Model

To calculate the energy consumption of a single node as well as the whole network, we make use of the energy consumption model in [15]. The energy consumption of a node sending l bits is as follows:(7)ETxl,d=l∗EElec+l∗εfs∗d2d<d0,l∗EElec+l∗εmp∗d4d≥d0,where l is the number of bytes sent by a node (CH or member), d denotes the distance of data transmission, EElec indicates the energy consumed by the sensor circuit to process one-bit data, εfs represents the energy consumption coefficient of the wireless channel in free space transmission model, εmp stands for the energy consumption coefficient of the wireless channel in multipath attenuation transmission model, and d0 is a threshold which is expressed as follows:(8)d0=εfsεmp.The energy consumption of a node (CH or member) receivingl bits is expressed in the following equation:(9)ERxl=l∗EElec,where EElec is the energy consumed by the sensor circuit to process one-bit data.


## 4. Combinatorial Optimization-Based Clustering Algorithm

In this section, COCA is described in detail. Firstly, the mathematical model of clustering is established, and clustering is abstracted into a combinatorial optimization problem. Then, the binary coding scheme of particles is presented and the fitness function is designed. Finally, the implementation procedure of COCA is described in detail.


### 4.1. Mathematical Model of Clustering

The following issues need to be settled when a WSN is clustered: (1) selecting CHs from all nodes and (2) member nodes joining different clusters. The purpose of clustering WSN is to reduce the energy consumption of a single node and to balance the energy consumption of different nodes so as to prolong the lifetime of the whole network as much as possible. Here, we analyze the clustering problem from the perspective of combinatorial optimization.Let there beN nodes in a WSN that are divided into K clusters. There are Mi1≤i≤K members in the i-th cluster. The number of CHs and the number of members in each cluster should satisfy the following constraints:(10)1≤Mi≤N+2−2K1≤i≤K,∑i=1KMi+K=N.According to equation (10), the total number of all possible clustering schemes is as follows:(11)NUM=CNKCN−KM1CN−K−M1−1M2,…,CN−K−M1−M2−…−MK−1−K+1MK,where CNK denotes K combinations of N elements, and Mi1≤i≤K is the number of members of the i-th cluster and should satisfy the constraint in equation (10).Clustering WSN means that, under the constraint expressed by equation (10), one approximately optimal scheme S is selected from the NUM schemes expressed by equation (11). For the selected scheme S, the objective function expressed by the following equation should be minimized:(12)f=w1f1+w2f2+w3f3+w4f4.In equation (12), the subobjective function f1 represents the sum of the energy consumed by all member nodes in all clusters during the whole network lifetime, f2 denotes the sum of the standard deviations of energy consumed by all members of all clusters, f3 stands for the sum of the energy consumed by all CHs, f4 is the sum of the standard deviations of the energy consumed by all CHs, and w1, w2, w3, w4 are the weights of each sub-objective function and they should satisfy the following constraints:(13)w1+w2+w3+w4=1wi>0,1≤i≤4.At different stages of network operation, for different network topologies, the four weights could be dynamically changed based upon equation (13). In this paper, in order to quickly verify our approach, i.e., combinatorial optimization based clustering, the value of w1, w2, w3, w4 in different situations are all taken as 0.25 for simplicity.From the above analysis, it can be drawn that clustering WSN actually can be regarded as a combinatorial optimization problem.


### 4.2. Particle Coding

If PSO is applied to pursue the best solution, the first step is to encode the particles. When COCA is utilized to cluster the WSN, the nodes in the network are either CHs or member nodes, and there is no other possibility. For BPSO, a particle represents a possible solution to the optimization problem. The component value of each dimension of the particle is either 0 or 1, and no third value exists. Therefore, a correspondence between the particle component value of each dimension and the CH selection can be established. If the component of a dimension of the particle takes a value of 1, the node corresponding to the dimension is selected as a CH. Otherwise, if the value is 0, the corresponding node acts as a cluster member. The coding scheme of particles is as follows in detail.Let there be a total ofN nodes in the network which are divided into K clusters. The population size of particles is M. The dimension of each particle and the number of nodes in the network are both set to be N, and the position vector of the ith (1 ≤ i ≤ M) particle is Xi1,Xi2,…,XiN. If Xij=11≤j≤N, the jth1≤j≤N node in the network is selected as a CH; if Xij=01≤j≤N, the jth1≤j≤N node is treated as a member node. For example, for a WSN network with 10 nodes, if the position vector of a particle is (0, 0, 1, 0, 0, 0, 1, 0, 1, 0), it means that the third, seventh and ninth nodes are elected as CHs, and the remaining nodes are used as member nodes. For BPSO, the velocity vector of the i-th (1 ≤ i ≤ M) particle is Vi=Vi1,Vi2,…,ViN, and the updating formula of the velocity vector of the particle is the same as that of continuous PSO presented in equation (3).


### 4.3. Fitness Function Design

The second step of applying BPSO is to design a fitness function. The purpose of clustering is to reduce the node energy consumption and prolong the network lifetime. The goal of COCA is to (1) minimize and balance the energy consumption of nodes in a cluster and (2) minimize and balance the energy consumption of all CHs. To achieve the goal of clustering, we utilize the fitness function expressed in equation (12) in Section 4.1.The definition of functionf1 in equation (12) is given as follows:(14)f1=∑i=1K∑j=1MiεdiH−ija=∑i=1K∑j=1MiεfsdiH−ij2diH−ij<d0,∑i=1K∑j=1MiεmpdiH−ij4ddiH−ij≥d0,where diH−ij is the distance from the j-th member to the CH in the i-th cluster, Mi indicates the number of member nodes in the i-th cluster, and K is the number of clusters. The meaning and value of εfs and εmp are the same as that in equation (7), and if diH−ij is less than the threshold d0, the exponent a equals 2, otherwise 4. It can be seen from equations (7) and (14) that the value of f1 is proportional to and can be used to describe the energy consumption of all member nodes in all clusters. The smaller the value of f1, the smaller the member nodes energy consumption.The definition of functionf2 is as follows:(15)f2=∑i=1K1Mi∑j=1MidiH−ij−di¯2,where diH−ij is the distance from the j-th member node to the CH in the i-th cluster, Mi denotes the number of member nodes in the i-th cluster, and di¯ is the average distance from all member nodes to their CH in the i-th cluster and can be expressed as follows:(16)di¯=1Mi∑j=1Midj,where dj means the distance from the j-th member to the CH. The function f2 represents the sum of mean square error (MSE) of the distance from all members to their CH. The smaller the value of f2, the closer the distance from the members to the CH, so that the energy consumption of member nodes is balanced.The definition of the functionf3 is as follows:(17)f3=∑i=1KεdBS−iHa=∑i=1KεfsdBS−iH2dBS−iH<d0,∑i=1KεmpdBS−iH4dBS−iH≥d0,where dBS−iH denotes the distance from the i-th CH to the BS, the values of εfs and εmp are the same as those in equations (7) and (14). It can be seen from equation (17) that the value of f3 is proportional to the energy consumption of all CHs. The smaller is the value of f3, the less is the energy consumption of all CHs.The definition of the functionf4 is as follows:(18)f4=1KdBS−iH−d¯2,where K is the number of clusters, dBS−iH stands for the distance from the i-th CH to the BS, and d¯ is expressed as follows:(19)d¯=1K∑i=1Kdi,where di is the distance from the ith CH to the BS. The value of the function f4 is the sum of the MSE of the distance between all CHs and the BS. The smaller the value of f4 is, the closer the distance between different CHs and the BS is, so that the remaining energy of CHs is basically balanced in the process of network operation.It can be seen from the definitions of f,f1, f2, f3, and f4 that if f has the minimum value, it means that the CH and the member nodes in the network consume the least amount of energy, and the energy consumption is also balanced at the same time.


### 4.4. Procedure of COCA

Similar to most clustering algorithms, COCA is also divided into two phases: setup phase and stable phase. The process of the COCA setup phase is expressed as Algorithm1 and 2.Algorithm 1: COCA process.
CH Cluster headPB Personal best valueGB Global best valueFFV Fitness function valueInitialize WSN and BPSO parametersInitialize every particle’s position and velocity vectorSetPB and GB to infinityfor each (particle)Clusteringend forwhile iteration number < Max numberfor each (particle)Update position vectorUpdate velocity vectorClusteringend forend whileThe last result is the clustering scheme corresponding toGBAlgorithm 2: Clustering process.
CH Cluster headPB Personal best valueGB Global best valueFFV Fitness function valueUpdate velocity vectorif random number < value of Sigmoid functionNode is elected as CHelseNode acts as memberend ifUpdate position vectorfor each (member node)Calculate distance to every CHJoin the nearest CH’s clusterend forCalculate FFVif FFV < PB thenPB ⟵ FFVend ifif PB < GB thenGB ⟵ PBend ifGet best position vector according toGBAt the beginning of the clustering, the parameters of WSN and BPSO are initialized, respectively. The parameters of WSN include the size of the area where the network is located, the location of nodes and the BS, the initial energy of nodes, the proportion of CHs, etc. The parameters of BPSO include population size, individual learning factor, global learning factor, and inertia factor.After parameters initialization, the velocity vector of each particle is initialized by using equation (3), and the position vector of each particle is initialized by using equations (4) and (5). According to the particle encoding scheme proposed in Section 4.2, the node corresponding to each particle position component with value 1 acts as the CH. After the CH is elected, the BS calculates the distance between each member node and all CHs, and makes the node join the cluster in which the nearest CH is located.After the initial clustering, the individual optimal value of each particle is calculated with equations. (12)–(19), and the minimum individual optimal value of all particles is treated as the global optimal value of the whole population. Thus, the initialization of the particle swarm is completed.During the iteration process, the velocity and position vectors of all particles are updated according to equations (3)–(6). The individual optimum value of each particle and the global optimum value of the whole population are calculated after the velocity and position update is completed.When the number of iteration reaches the predetermined value, the CH selection scheme corresponding to the particle which has the global optimal value is selected as the final clustering scheme. After the completion of clustering, the ID of CHs, cluster members, and clusters is broadcasted to the whole network, so that each node knows its clustering information. After clustering, the CH assigns each member a TDMA slot and broadcasts it to the cluster.It can be seen from the clustering process that COCA has an advantage over other clustering algorithms in terms of the selection of CH. On the basis of the binary particle coding scheme, COCA keeps iterating to obtain the optimal clustering scheme by taking advantage of BPSO evolutionary optimization.


## 4.1. Mathematical Model of Clustering

The following issues need to be settled when a WSN is clustered: (1) selecting CHs from all nodes and (2) member nodes joining different clusters. The purpose of clustering WSN is to reduce the energy consumption of a single node and to balance the energy consumption of different nodes so as to prolong the lifetime of the whole network as much as possible. Here, we analyze the clustering problem from the perspective of combinatorial optimization.Let there beN nodes in a WSN that are divided into K clusters. There are Mi1≤i≤K members in the i-th cluster. The number of CHs and the number of members in each cluster should satisfy the following constraints:(10)1≤Mi≤N+2−2K1≤i≤K,∑i=1KMi+K=N.According to equation (10), the total number of all possible clustering schemes is as follows:(11)NUM=CNKCN−KM1CN−K−M1−1M2,…,CN−K−M1−M2−…−MK−1−K+1MK,where CNK denotes K combinations of N elements, and Mi1≤i≤K is the number of members of the i-th cluster and should satisfy the constraint in equation (10).Clustering WSN means that, under the constraint expressed by equation (10), one approximately optimal scheme S is selected from the NUM schemes expressed by equation (11). For the selected scheme S, the objective function expressed by the following equation should be minimized:(12)f=w1f1+w2f2+w3f3+w4f4.In equation (12), the subobjective function f1 represents the sum of the energy consumed by all member nodes in all clusters during the whole network lifetime, f2 denotes the sum of the standard deviations of energy consumed by all members of all clusters, f3 stands for the sum of the energy consumed by all CHs, f4 is the sum of the standard deviations of the energy consumed by all CHs, and w1, w2, w3, w4 are the weights of each sub-objective function and they should satisfy the following constraints:(13)w1+w2+w3+w4=1wi>0,1≤i≤4.At different stages of network operation, for different network topologies, the four weights could be dynamically changed based upon equation (13). In this paper, in order to quickly verify our approach, i.e., combinatorial optimization based clustering, the value of w1, w2, w3, w4 in different situations are all taken as 0.25 for simplicity.From the above analysis, it can be drawn that clustering WSN actually can be regarded as a combinatorial optimization problem.


## 4.2. Particle Coding

If PSO is applied to pursue the best solution, the first step is to encode the particles. When COCA is utilized to cluster the WSN, the nodes in the network are either CHs or member nodes, and there is no other possibility. For BPSO, a particle represents a possible solution to the optimization problem. The component value of each dimension of the particle is either 0 or 1, and no third value exists. Therefore, a correspondence between the particle component value of each dimension and the CH selection can be established. If the component of a dimension of the particle takes a value of 1, the node corresponding to the dimension is selected as a CH. Otherwise, if the value is 0, the corresponding node acts as a cluster member. The coding scheme of particles is as follows in detail.Let there be a total ofN nodes in the network which are divided into K clusters. The population size of particles is M. The dimension of each particle and the number of nodes in the network are both set to be N, and the position vector of the ith (1 ≤ i ≤ M) particle is Xi1,Xi2,…,XiN. If Xij=11≤j≤N, the jth1≤j≤N node in the network is selected as a CH; if Xij=01≤j≤N, the jth1≤j≤N node is treated as a member node. For example, for a WSN network with 10 nodes, if the position vector of a particle is (0, 0, 1, 0, 0, 0, 1, 0, 1, 0), it means that the third, seventh and ninth nodes are elected as CHs, and the remaining nodes are used as member nodes. For BPSO, the velocity vector of the i-th (1 ≤ i ≤ M) particle is Vi=Vi1,Vi2,…,ViN, and the updating formula of the velocity vector of the particle is the same as that of continuous PSO presented in equation (3).


## 4.3. Fitness Function Design

The second step of applying BPSO is to design a fitness function. The purpose of clustering is to reduce the node energy consumption and prolong the network lifetime. The goal of COCA is to (1) minimize and balance the energy consumption of nodes in a cluster and (2) minimize and balance the energy consumption of all CHs. To achieve the goal of clustering, we utilize the fitness function expressed in equation (12) in Section 4.1.The definition of functionf1 in equation (12) is given as follows:(14)f1=∑i=1K∑j=1MiεdiH−ija=∑i=1K∑j=1MiεfsdiH−ij2diH−ij<d0,∑i=1K∑j=1MiεmpdiH−ij4ddiH−ij≥d0,where diH−ij is the distance from the j-th member to the CH in the i-th cluster, Mi indicates the number of member nodes in the i-th cluster, and K is the number of clusters. The meaning and value of εfs and εmp are the same as that in equation (7), and if diH−ij is less than the threshold d0, the exponent a equals 2, otherwise 4. It can be seen from equations (7) and (14) that the value of f1 is proportional to and can be used to describe the energy consumption of all member nodes in all clusters. The smaller the value of f1, the smaller the member nodes energy consumption.The definition of functionf2 is as follows:(15)f2=∑i=1K1Mi∑j=1MidiH−ij−di¯2,where diH−ij is the distance from the j-th member node to the CH in the i-th cluster, Mi denotes the number of member nodes in the i-th cluster, and di¯ is the average distance from all member nodes to their CH in the i-th cluster and can be expressed as follows:(16)di¯=1Mi∑j=1Midj,where dj means the distance from the j-th member to the CH. The function f2 represents the sum of mean square error (MSE) of the distance from all members to their CH. The smaller the value of f2, the closer the distance from the members to the CH, so that the energy consumption of member nodes is balanced.The definition of the functionf3 is as follows:(17)f3=∑i=1KεdBS−iHa=∑i=1KεfsdBS−iH2dBS−iH<d0,∑i=1KεmpdBS−iH4dBS−iH≥d0,where dBS−iH denotes the distance from the i-th CH to the BS, the values of εfs and εmp are the same as those in equations (7) and (14). It can be seen from equation (17) that the value of f3 is proportional to the energy consumption of all CHs. The smaller is the value of f3, the less is the energy consumption of all CHs.The definition of the functionf4 is as follows:(18)f4=1KdBS−iH−d¯2,where K is the number of clusters, dBS−iH stands for the distance from the i-th CH to the BS, and d¯ is expressed as follows:(19)d¯=1K∑i=1Kdi,where di is the distance from the ith CH to the BS. The value of the function f4 is the sum of the MSE of the distance between all CHs and the BS. The smaller the value of f4 is, the closer the distance between different CHs and the BS is, so that the remaining energy of CHs is basically balanced in the process of network operation.It can be seen from the definitions of f,f1, f2, f3, and f4 that if f has the minimum value, it means that the CH and the member nodes in the network consume the least amount of energy, and the energy consumption is also balanced at the same time.


## 4.4. Procedure of COCA

Similar to most clustering algorithms, COCA is also divided into two phases: setup phase and stable phase. The process of the COCA setup phase is expressed as Algorithm1 and 2.Algorithm 1: COCA process.
CH Cluster headPB Personal best valueGB Global best valueFFV Fitness function valueInitialize WSN and BPSO parametersInitialize every particle’s position and velocity vectorSetPB and GB to infinityfor each (particle)Clusteringend forwhile iteration number < Max numberfor each (particle)Update position vectorUpdate velocity vectorClusteringend forend whileThe last result is the clustering scheme corresponding toGBAlgorithm 2: Clustering process.
CH Cluster headPB Personal best valueGB Global best valueFFV Fitness function valueUpdate velocity vectorif random number < value of Sigmoid functionNode is elected as CHelseNode acts as memberend ifUpdate position vectorfor each (member node)Calculate distance to every CHJoin the nearest CH’s clusterend forCalculate FFVif FFV < PB thenPB ⟵ FFVend ifif PB < GB thenGB ⟵ PBend ifGet best position vector according toGBAt the beginning of the clustering, the parameters of WSN and BPSO are initialized, respectively. The parameters of WSN include the size of the area where the network is located, the location of nodes and the BS, the initial energy of nodes, the proportion of CHs, etc. The parameters of BPSO include population size, individual learning factor, global learning factor, and inertia factor.After parameters initialization, the velocity vector of each particle is initialized by using equation (3), and the position vector of each particle is initialized by using equations (4) and (5). According to the particle encoding scheme proposed in Section 4.2, the node corresponding to each particle position component with value 1 acts as the CH. After the CH is elected, the BS calculates the distance between each member node and all CHs, and makes the node join the cluster in which the nearest CH is located.After the initial clustering, the individual optimal value of each particle is calculated with equations. (12)–(19), and the minimum individual optimal value of all particles is treated as the global optimal value of the whole population. Thus, the initialization of the particle swarm is completed.During the iteration process, the velocity and position vectors of all particles are updated according to equations (3)–(6). The individual optimum value of each particle and the global optimum value of the whole population are calculated after the velocity and position update is completed.When the number of iteration reaches the predetermined value, the CH selection scheme corresponding to the particle which has the global optimal value is selected as the final clustering scheme. After the completion of clustering, the ID of CHs, cluster members, and clusters is broadcasted to the whole network, so that each node knows its clustering information. After clustering, the CH assigns each member a TDMA slot and broadcasts it to the cluster.It can be seen from the clustering process that COCA has an advantage over other clustering algorithms in terms of the selection of CH. On the basis of the binary particle coding scheme, COCA keeps iterating to obtain the optimal clustering scheme by taking advantage of BPSO evolutionary optimization.


## 5. Algorithm Performance Evaluation

In order to verify the performance of COCA, we simulated COCA using Matlab 2016a and compared the simulation results with three other clustering algorithms, i.e., LEACH, ECCR, and PSO-ECHS. The simulation results showed that COCA has better performance than other algorithms in terms of network lifetime, average residual energy of nodes, and network throughput. The reason for choosing LEACH as the comparison algorithm is that LEACH, as the first hierarchical clustering algorithm, has been widely used as a benchmark to evaluate the performance of other algorithms. The other two algorithms are chosen for comparison because ECCR and PSO-ECHS are the representatives of independent and cooperative algorithms, respectively.


### 5.1. Simulation Parameters and Evaluation Metrics

In the simulation, the nodes are randomly distributed in a square area, and the nodes do not move after deployment. The BS is located in the center of the edge of the network area, and the percentage of CHs is 10%. A randomly generated network structure is shown in Figure1. In the simulation, the total number of nodes in the network varies from 100 to 300, and the initial energy of each node is equal to each other. The specific network parameters are listed in Table 1, and the BPSO parameters are listed in Table 2. For Table 1, the parameters network size, BS coordinates, control packet size, data packet size, and data packet number per round are defined by us, 10% as the percentage of CHs is the best value obtained through many experiments, and other parameters on energy are the same as parameters in [15, 24, 25, 29–36]. For Table 2, the number of the parameters of particles and the number of iterations are defined by us, and other parameters are the optimal values obtained through many experiments.Figure 1
Network nodes deployment.Table 1
Network parameters.
ParametersValuesNetwork size (m)200 ∗ 200BS coordinates(100, 200)Nodes number100–300The percentage of CHs10%Initial energy (J)0.5EElec50 nJ/bitεfs10 pJ/bit/m2εmp0.0013 pJ/bit/m4Control packet size (bits)200Data packet size (bits)6400Data packet number per round10Table 2
BPSO parameters.
ParametersValuesNumber of particles20Number of iterations200w0.8c12c22r1Random number in [0, 1]r2Random number in [0, 1]In order to evaluate the performance of different clustering algorithms, the metrics are as follows: the number of live nodes in the network, the total residual energy of the network, and the number of packets received by the BS.


### 5.2. Network Lifetime

Network lifetime is the most important metrics to measure the performance of clustering algorithms. In this paper, the network lifetime is defined as the number of rounds when all nodes are dead, i.e., all nodes exhausted their energy. Figure2 depicts the number of rounds of four algorithms when the last node died in three scenarios. Figures 3–5 shows the relationship between the number of living nodes and the number of rounds of COCA, LEACH, ECCR, and PSO-ECHS. It can be seen from Figure 2 that with increasing the number of rounds, nodes begin to die in four algorithms (when the remaining energy of one node is 0, the node is considered dead). However, the first dead node in COCA appears later than the other three algorithms, and COCA has the most alive nodes when the number of rounds is equal. In four algorithms, LEACH has the earliest dead node. However, COCA has the latest dead node. In the same network environment, LEACH has the shortest lifetime and COCA has the longest lifespan. The lifetime of the other two algorithms is between the lifetime of COCA and LEACH.Figure 2
The lifetime of four algorithms versus different node numbers.Figure 3
Alive nodes number versus the rounds number (total number of nodes is 100).Figure 4
Alive nodes number versus the rounds number (total number of nodes is 200).Figure 5
Alive nodes number versus the rounds number (total number of nodes is 300).Figures6–8 reveal the number of rounds when the first, half, and last node of the four clustering algorithms die in three scenarios. It can be seen from Figures 6–8 that the number of rounds of the first, half, and last nodes of COCA is later than that of the other three comparison algorithms, and the trend of node death of COCA is more gradual. The reason that COCA has a longer lifetime is that cluster members and CHs of COCA consume less energy than the other three algorithms during data transmission.Figure 6
The round number of the first node dead versus different node numbers.Figure 7
The round number of half nodes dead versus different node numbers.Figure 8
The round number of all nodes dead versus different node numbers.


### 5.3. Residual Energy

Nodes need to consume energy for sensing and transmitting data. The more is the residual energy of the whole network, the longer is the lifetime. Therefore, clustering algorithms should minimize the energy consumption of the entire network. Figures9–11 show the relationship between the total residual energy and the number of rounds of the four algorithms in three scenarios. From Figures 9–11, it can be seen that with the increase in the number of rounds, the total residual energy of the four algorithms is all decreasing. However, the residual energy of COCA is decreasing slower than the other three algorithms, and the trend of energy reduction of COCA is gentle than the compared algorithms. As can be seen from Figures 9–11, LEACH has the fastest energy consumption rate, COCA has the slowest rate, and the other two algorithms energy consumption rate is in the middle. The reason why COCA consumes the least energy is that when COCA selects the CHs and cluster members, it comprehensively considers the influence of several factors that restrict each other on the cluster formation.Figure 9
Total nodes residual energy versus the rounds number (total number of nodes is 100).Figure 10
Total nodes residual energy versus the rounds number (total number of nodes is 200).Figure 11
Total nodes residual energy versus the rounds number (total number of nodes is 300).


### 5.4. Network Throughput

Two metrics are considered to evaluate network throughput; i.e., the number of packets received by the BS and the number of packets received by all CHs. Obviously, the more data packets received by the BS, the better the performance of the clustering algorithm.Figure12 shows the total number of packets received by all CHs using four algorithms in three network scenarios. Figure 13 depicts the total number of packets received by the BS of the four algorithms in three network scenarios. Figure 14 displays the sum of data packets received by the BS and all CHs of four algorithms in three network scenarios. It can be seen from Figures 12–14 that in all scenarios COCA algorithm receives the most data packets in terms of whether the BS or CHs, which shows that COCA has the most network throughput.Figure 12
The number of data packets received by all CHs versus different node numbers (unit of the packet number is 1000).Figure 13
The number of data packets received by the BS versus different node numbers (unit of the packet number is 1000).Figure 14
The throughput versus different node numbers (unit of the packet number is 1000).From the above description, we can conclude that COCA has excellent performance than the other three algorithms in terms of network lifetime, residual energy, and throughput.


## 5.1. Simulation Parameters and Evaluation Metrics

In the simulation, the nodes are randomly distributed in a square area, and the nodes do not move after deployment. The BS is located in the center of the edge of the network area, and the percentage of CHs is 10%. A randomly generated network structure is shown in Figure1. In the simulation, the total number of nodes in the network varies from 100 to 300, and the initial energy of each node is equal to each other. The specific network parameters are listed in Table 1, and the BPSO parameters are listed in Table 2. For Table 1, the parameters network size, BS coordinates, control packet size, data packet size, and data packet number per round are defined by us, 10% as the percentage of CHs is the best value obtained through many experiments, and other parameters on energy are the same as parameters in [15, 24, 25, 29–36]. For Table 2, the number of the parameters of particles and the number of iterations are defined by us, and other parameters are the optimal values obtained through many experiments.Figure 1
Network nodes deployment.Table 1
Network parameters.
ParametersValuesNetwork size (m)200 ∗ 200BS coordinates(100, 200)Nodes number100–300The percentage of CHs10%Initial energy (J)0.5EElec50 nJ/bitεfs10 pJ/bit/m2εmp0.0013 pJ/bit/m4Control packet size (bits)200Data packet size (bits)6400Data packet number per round10Table 2
BPSO parameters.
ParametersValuesNumber of particles20Number of iterations200w0.8c12c22r1Random number in [0, 1]r2Random number in [0, 1]In order to evaluate the performance of different clustering algorithms, the metrics are as follows: the number of live nodes in the network, the total residual energy of the network, and the number of packets received by the BS.


## 5.2. Network Lifetime

Network lifetime is the most important metrics to measure the performance of clustering algorithms. In this paper, the network lifetime is defined as the number of rounds when all nodes are dead, i.e., all nodes exhausted their energy. Figure2 depicts the number of rounds of four algorithms when the last node died in three scenarios. Figures 3–5 shows the relationship between the number of living nodes and the number of rounds of COCA, LEACH, ECCR, and PSO-ECHS. It can be seen from Figure 2 that with increasing the number of rounds, nodes begin to die in four algorithms (when the remaining energy of one node is 0, the node is considered dead). However, the first dead node in COCA appears later than the other three algorithms, and COCA has the most alive nodes when the number of rounds is equal. In four algorithms, LEACH has the earliest dead node. However, COCA has the latest dead node. In the same network environment, LEACH has the shortest lifetime and COCA has the longest lifespan. The lifetime of the other two algorithms is between the lifetime of COCA and LEACH.Figure 2
The lifetime of four algorithms versus different node numbers.Figure 3
Alive nodes number versus the rounds number (total number of nodes is 100).Figure 4
Alive nodes number versus the rounds number (total number of nodes is 200).Figure 5
Alive nodes number versus the rounds number (total number of nodes is 300).Figures6–8 reveal the number of rounds when the first, half, and last node of the four clustering algorithms die in three scenarios. It can be seen from Figures 6–8 that the number of rounds of the first, half, and last nodes of COCA is later than that of the other three comparison algorithms, and the trend of node death of COCA is more gradual. The reason that COCA has a longer lifetime is that cluster members and CHs of COCA consume less energy than the other three algorithms during data transmission.Figure 6
The round number of the first node dead versus different node numbers.Figure 7
The round number of half nodes dead versus different node numbers.Figure 8
The round number of all nodes dead versus different node numbers.


## 5.3. Residual Energy

Nodes need to consume energy for sensing and transmitting data. The more is the residual energy of the whole network, the longer is the lifetime. Therefore, clustering algorithms should minimize the energy consumption of the entire network. Figures9–11 show the relationship between the total residual energy and the number of rounds of the four algorithms in three scenarios. From Figures 9–11, it can be seen that with the increase in the number of rounds, the total residual energy of the four algorithms is all decreasing. However, the residual energy of COCA is decreasing slower than the other three algorithms, and the trend of energy reduction of COCA is gentle than the compared algorithms. As can be seen from Figures 9–11, LEACH has the fastest energy consumption rate, COCA has the slowest rate, and the other two algorithms energy consumption rate is in the middle. The reason why COCA consumes the least energy is that when COCA selects the CHs and cluster members, it comprehensively considers the influence of several factors that restrict each other on the cluster formation.Figure 9
Total nodes residual energy versus the rounds number (total number of nodes is 100).Figure 10
Total nodes residual energy versus the rounds number (total number of nodes is 200).Figure 11
Total nodes residual energy versus the rounds number (total number of nodes is 300).


## 5.4. Network Throughput

Two metrics are considered to evaluate network throughput; i.e., the number of packets received by the BS and the number of packets received by all CHs. Obviously, the more data packets received by the BS, the better the performance of the clustering algorithm.Figure12 shows the total number of packets received by all CHs using four algorithms in three network scenarios. Figure 13 depicts the total number of packets received by the BS of the four algorithms in three network scenarios. Figure 14 displays the sum of data packets received by the BS and all CHs of four algorithms in three network scenarios. It can be seen from Figures 12–14 that in all scenarios COCA algorithm receives the most data packets in terms of whether the BS or CHs, which shows that COCA has the most network throughput.Figure 12
The number of data packets received by all CHs versus different node numbers (unit of the packet number is 1000).Figure 13
The number of data packets received by the BS versus different node numbers (unit of the packet number is 1000).Figure 14
The throughput versus different node numbers (unit of the packet number is 1000).From the above description, we can conclude that COCA has excellent performance than the other three algorithms in terms of network lifetime, residual energy, and throughput.


## 6. Conclusion

To save the nodes energy and prolong the network lifetime, a clustering algorithm based on combinatorial optimization for WSN, i.e., COCA, is proposed in this paper. From the point of view of combinatorial optimization, COCA abstracts the selection of CHs and the formation of clusters into a combinatorial optimization problem. Due to the large scale of feasible solutions of the combinatorial optimization problem, an approximation algorithm is generally adopted to solve such a problem. Therefore the BPSO, which has a few parameters and is easy to implement, is utilized to cluster the WSN. In order to apply BPSO to cluster the WSN, a novel particle binary coding scheme for selecting CHs is proposed. For the coding scheme, the dimension of particles is equal to the number of nodes in the network. If the position component of particles in a certain dimension is 1, the node corresponding to this dimension is selected as CH. If the position component of particles in a dimension is 0, the node corresponding to this dimension is regarded as a cluster member. After the CH is elected, the fitness function is designed according to the principle that the energy consumption of the whole network is minimum and balanced. After a number of iterations, the WSN clustering is implemented by BPSO. Because the fitness function takes into account the influence of different factors on clustering performance and the constraints between these factors, it ensures that the clustering result is optimal.Experiments showed that compared with existing clustering algorithms, COCA has the best performance in terms of network lifetime, residual energy of nodes, and the network throughput. COCA extended the lifetime of the network greatly and caused the death of the first node, half of the nodes, and all nodes to be significantly delayed. It can be seen from the experiments that COCA makes the BS receive more data from the member nodes.However, COCA still has some shortcomings to overcome. COCA uses single-hop communication rather than multi-hop communication. When the network size is large, the distance between the node and the CH, as well as the distance from the CHs to the BS, is far. Compared with multi-hop communication, single-hop communication consumes more energy, which leads to the premature exhaustion of energy and the death of CHs. In addition, the four coefficients of fitness function need to be adjusted according to the changes of the network. Therefore, in future research, we will try to change single-hop communication to multi-hop communication to reduce the energy consumption of data transmission. And we need to dynamically adjust the coefficients of fitness function according to the operation of the network to obtain a more accurate clustering result.



---

*Source: 6139704-2020-07-03.xml*