Lifetime Maximization in Wireless Sensor Networks