Lifetime Extension and Traffic Optimization in Wireless Sensor Networks Through Advanced Routing Algorithms