Energy-efficient algorithm design for wireless sensor networks