The communication between the master and the slave can be made through the wireless sensor network WSN. The WSN can be used in various resources for the data communication. Maximum numbers of protocols are communicating between the receiver and transmitter with the help of the WSN. For the communication the main sources is the energy consumption is act as the major part. Genetic algorithm can be implemented for the optimization which can increases the efficiency. Various applications are available for the optimization technique. The algorithm are selected based on the manner such as the less energy dissipation, uses the less number of nodes. The grouping of the routing system which can lead some disadvantages such as the node replacement, network failure. The increase the lifetime of grouping the router which can able to communicate to the other end in the specific distance. The target can be covered over less period of time. The optimization can achieve the large target medium and the use of less number of nodes. The simulation can be made using the optimization method which can result the proper communication between the two targets. Comparison has been made between the genetic algorithm and Radom deployment.