Wireless Sensor Networks (WSNs) are an active research field which attracted many researches. WSNs are an advanced technology applied in a various fields. The minimization of the node energy consumption represents a very serious problem. Long communication distances between nodes in a Wireless Sensor network can greatly drain the energy of nodes and reduce the lifetime of a network. The use of a GA allows us to greatly minimize the total communication distance, thus saving the network energy consumption. In this work, we propose a new approach based on a genetic algorithm (GA) and an agent cluster head to solve a WSN optimization problem. Our new method is aimed at finding the optimum number and location of cluster heads (CHs) and using an agent cluster head to manage the distance between the CH and the BS.