Objective:An improved fruit fly optimization algorithm based on an inertia weight cosine adaptive adjustment strategy is proposed for the area coverage and sensor node energy consumption problems of randomly deployed nodes in wireless sensor networks.Methods:The algorithm adjusts the search step of the algorithm online based on the fruit fly optimization algorithm by introducing a learning factor adjustment strategy for inertia weights.Results:The adaptivity of individual fruit fly and the global search ability are enhanced so as to achieve global optimality.Conclusions:Simulation experiments show that the proposed im-proved fruit fly optimization algorithm not only improves the convergence speed and global search capability,but also significantly improves the coverage of WSN.