Wireless Sensor Networks (WSN) have been widely adopted for years, but their role is growing significantly currently with the increase of the importance of the Internet of Things paradigm. Moreover, since the computational capability of small-sized devices is also increasing, WSN are now capable of performing relevant operations. An optimal scheduling of these in-network processes can affect both the total computational time and the energy requirements. Evolutionary optimization techniques can address this problem successfully due to their capability to manage non-linear problems with many design variables. In this paper, an evolutionary algorithm recently developed, named Social Network Optimization (SNO), has been applied to the problem of task allocation in a WSN. The optimization results on two test cases have been analyzed: in the first one, no energy constraints have been added to the optimization, while in the second one, a minimum number of life cycles is imposed.Wireless Sensor Networks (WSN) are relevant system architectures that can be applied in a wide range of applications [1], from monitoring to tracking, visual surveillance, ranging also in many fields from industrial automation to agricultural systems, and target localization, both in military and civil sectors [2].Currently, WSN are becoming much more important because the senors' computational capabilities are growing, and thus, many in-network tasks can be performed. It has been noticed that processing the information inside the network is faster and safer than sending raw data to the final user [3]. Such in-network processing can drastically reduce the total computational time required after sensing tasks with a direct impact on power consumption [4].The network complex dynamics created by these in-network operations can be suitably managed by means of evolutionary optimization techniques [5]. For instance, the problem of sensor lifetime maximization has been successfully approached in [6] by means of genetic algorithms and in [7] with genetical swarm optimization. The problem of coverage in WSN has been solved in [8] with both the genetic algorithm and ant colony optimization. Another important problem of WSN, routing, has been widely approached by several authors: in [9], a specific energy protocol has been designed to improve the network lifetime, while in [10], it has been solved with genetical swarm optimization and in [11] with particle swarm optimization.The problem of task and resource allocation is a crucial problem in many frameworks. It is aimed at finding the optimal distribution of the tasks inside the network itself with reference to a specific goal. In the case of the deployment of multiple sensor devices with batteries, a fundamental goal is to