An Optimal and Energy Efficient Methods in Wireless Sensor Network