A sequence of online messages for connections is given, each message is important and thide failure of delivering a message is a critical event. The maximum lifetime problem maximizes the total number of messages that can be successfully sent over the network. Given ah ≥ 1 h≥ 1, this paper presents two new problems on ad hoc networks (called the min–max and min–sum cost online problems), which adjust the initial energies of nodes such that the network can send the first h messages