 In wireless sensor networks, the clustering method can be used to reduce the imbalance in energy consumption between nodes. This method involves grouping together nodes with similar characteristics so that they can share resources and work together more efficiently. Additionally, a topology optimization technique based on the Koshy Mutation Crow Search Algorithm CMCSA was proposed to address the issues of rapid energy consumption, short life cycles, and unstable topology in wireless sensor networks. Furthermore, a clustering approach based on the enhanced Koshy Mutation Crow Search Algorithm ECMCSA was developed to improve the convergence speed and avoid getting stuck in local optima. The ECMCSA algorithm also improved the network's connectivity performance by 52.9%, 37.6%, and 23.5%. This article was authored by Yang Bai, Li Chao, Bin Chen, and others.