Wireless Sensor Networks are developed as a vital tool for monitoring diverse real time applications such as environmental monitoring factors, health care, wide area surveillance, and many more. Though the advantages of WSNs are plenty, the present challenge is to gain effective control over the depleting battery power and the network lifetime. Recent researches have proved that the energy consumption can be minimized if effective clustering mechanisms are incorporated. This paper proposes HOCK and HECK - novel energy efficient clustering algorithms to increase the network lifetime for homogeneous and heterogeneous environments, respectively. Both these algorithms are built using Krill herd and Cuckoo search. While the optimal cluster centroid positions are computed using the Krill herd algorithm, and the Cuckoo search is applied to select the optimal cluster heads. The performance of the HOCK algorithm is evaluated by varying base station locations and node density. To evaluate the HECK algorithm, two and three level heterogeneity are considered. The simulation results show that the proposed protocol is more effective in improving the network lifetime of WSNs compared to other existing methods such as GAECH, Hybrid HSAPSO, and ESO-LEACH. © 2021, Springer-Verlag GmbH Germany, part of Springer Nature.