Currently, the technology advancements have led to significant growth in the application of wireless sensor networks
(WSNs) and its remarkable developments. WSNs are the most applicable and least-cost sub-category of existing computer
networks. However, WSNs still suffer from energy limitation challenges. Since the energy limitation challenges are
not appropriately resolved, prolonging the lifetime of nodes by reducing energy consumption has obtained more attention
in this literature. In this paper, while routing is being performed an online clustering approach has been developed for
updating the sensors’ clustering, if it is required. The proposed clustering is carried out based on three objectives including
reducing the distance between nodes within a cluster, reducing the distance between the cluster head (CH) candidate
nodes and the sink node, and online appropriate energy distribution of the nodes in each cluster for each routing round.
The improved fuzzy C-means (FCM) algorithm is applied to perform clustering. Additionally, the genetic algorithm
(GA) is used as the routing algorithm. In order to evaluate the performance of the proposed FCM-GA algorithm, the
DirectTransmission, SH-MEER, and MH-FEER algorithms are compared with FCM-GA. The results show that the proposed
FCM-GA algorithm outperforms other algorithms in terms of network lifetime and the number of sent packets