The limited energy of nodes in wireless sensor networks is prone to unbalanced energy load. To solve this problem, a routing algorithm for wireless sensor networks (WSN) is proposed based on the firefly algorithm to optimize fuzzy C-means (FCM). Both the clustering stage and the inter-cluster routing establishment stage in clustering routing algorithm are optimized in firefly algorithm to optimize fuzzy C-means (FFACM) algorithm. In the clustering stage, the firefly algorithm is used to calculate the initial clustering center, so as to avoid th...