## 1 Introduction  
Wireless Sensor Networks (WSNs) are composed of a large number of multifunctional low cost sensor nodes with restricted battery power supplies, which are randomly deployed inside the sensing field [1]. Since WSNs are usually deployed in a hostile environment without supervision, it is complicated to recharge or replace the batteries when out of energy. Therefore, energy efficiency and network lifetime become an emphasis in WSNs. Due to the fact most of the energy of sensor nodes is consumed by data transmission, an energy-efficient routing scheme should be utilized to effectively reduce the energy consumption. Clustering, as an essential part in any hierarchy protocol, can prolong the network lifetime, and is influenced by the number of clusters, cluster head selection and clustering scheme. Sensor nodes are grouped by clustering algorithms. Each cluster contains one cluster head (CH) and some normal cluster member (CM) nodes. CMs transmit the data to their own CH which has the responsibilities of receiving, aggregating and forwarding these data to a base station (BS). When a node is out of energy, it is defined to be dead. The round when all the nodes have died is the network lifetime. As the sensed data has to be forwarded to the BS for further necessary action, routing becomes important for transferring data from node to node or to the BS efficiently [2]. Therefore, it is indispensable to balance the energy consumption among sensor nodes to prolong the network lifetime for clustered WSNs. There have been lots of clustering algorithms and schemes applied to WSNs. KM-LEACH [3] uses the K-means clustering algorithm to form clusters. Reference [4] implemented both centralizedand distributed K-means clustering algorithms. LEACH-CKM [5] takes the remote nodes into account during the formation of groups by the K-means classification method and uses a Minimum Transmission Energy routing protocol to transmit information. In addition to the application of K-means, many factors are considered in other algorithms. Reference [6] proposed a new method called CAST-WSN based on the node distance from the gravity center of the cluster, the node distance from the energy center in each cluster and a Steiner tree structure, which brings significant improvements to the C-Means clustering algorithm. Besides residual energy, the distance from the nodes to the base station, neighbors and the number of neighbors are considered for cluster head selection [7]. Distributed unequal clustering using fuzzy logic (DUCF) takes residual energy, node degree and distance to the BS into account to ensure load balancing among the clusters by varying the cluster size [8]. Moreover, some other theories and algorithms are adopted in WSNs, such as game theory. Each sensor node is considered as a rational and selfish player which will play a clustering game with an equilibrium strategy. This approach is proved to have a good energy balancing performance and consequently the network lifetime is greatly enhanced [9]. In this paper, we implement a new clustering algorithm in WSN which is called clustering by fast search and finding of density peaks (CFSFDP) [10] published in _Science_ in 2014. It is an implementable and efficient algorithm with two variables: local density and distance. It divides clusters based on the idea that cluster centers are characterized by a higher density than their neighbors and a relatively large distance from points with higher densities. This algorithm has been applied in some other areas, for example, reference [11] applied terahertz time-domain spectroscopy (THz-TDS) combined with CFSFDP for pesticide detection. To solve the similar distance problem in THz spectra data, they proposed PCA-CFSFDP. Principal component analysis (PCA) was used to reduce the dimensions of THz spectrum data, and then the PCA result was used as the input of CFSFDP. The experimental results showed that PCA-CFSFDP approach can get a satisfactory detection result.