# An Optimal Online Resource Allocation Algorithm for Energy Harvesting Body Area Networks
## 2 Related Works  
In [26], the authors design two algorithms to optimize the network utility. The first algorithm computes the data sampling rate and routes. To avoid missing opportunities for energy harvesting, the second algorithm is designed to adapt the sampling rate with the objective of maintaining the battery at a target level. The authors of [27] design a data gathering optimization algorithm to optimize data gathering in terms of network utility by jointly considering data gathering and data transmission. A novel method has been considered to improve the performance of on-body communication by harvesting energy from ambient sources in and around the human body in [28]. In [19], a selective gateway method based on the residual energy of the sensors has been proposed, to further increase the lifetime of the BANs, a thermal energy harvesting system has been proposed to harvest heat energy from human warmth. In [29], [PERSON] et al. develop a distributed sampling date control (DSRC) algorithm to decide the sampling rate for each rechargeable sensor node with a limited battery capacity while maximizing the network performance. Literatures [26; 27; 29] are assumed to have a good prior knowledge of energy harvesting. Practically, this is not true because energy harvesting is a dynamic and random process. We cannot predict it. In [30], [PERSON] et al. design an online energy-limited scheduling algorithm(ESA), which jointly manages the energy and makes power allocation decisions for packet transmission, and does not require any knowledge of the harvestable energy process. In [31], the authors propose an intelligent solar energy-harvesting system for supplying a long term and stable power. In [32], the authors propose two new and insightful performance criteria to evaluate the new class of hybrid networks that comprise both energy harvesting and conventional nodes. In [33], the authors propose a mathematical model that focuses on the maximization of the lifetime of the path of nodes involved in a data flow. In [34], the authors propose a global routing protocol based on [PERSON]'s algorithm with a novel link cost function specialized for balancing energy consumption. In [35], the authors propose an integer linear programming model that optimizes the number and location of relays while minimizing the energy consumption. In [36], the authors maximize network lifetime based on joint resource allocation scheme for BANs. The authors show that the problem of optimizing network lifetime is equivalent to maximizing the residual energy of sensor nodes. The proposed scheme is capable of extending the lifetime of network as well as guaranteeing user quality of service (QoS) requirements. In [37], the authors propose a formulation to reduce the energy consumption of BANs through monitoring and eliminating the spatial correlated contention in the BANs sensors while avoiding multiple nodes sending the same data to prolong the sensor and network lifetime. In [38], the authors propose an energy-efficient fuzzy formulation based on adaptive routing protocol to prolong the network lifetime. This protocol is based on clustering protocol that makes use of direct transmission technique depending upon the criticality and the location of the sensor. The authors in [39] present an adaptive interference mitigation scheme for multiple coexisting BANs based on social interaction to reduce energy consumption. The energy consumption is reduced by optimizing the transmission time by synchronous and parallel transmission. However, literatures [34; 35; 36; 37; 38; 39] just consider how to save energy or balance energy consumption, without considering harvesting energy from outside. It is not enough to prolong the lifetime of BANs. Lyapunov optimization theory [40] is a framework to combine stability and optimization techniques. It takes account of both the stability of the system and user utility maximization objectives [41]. Firstly, the above-mentioned works assume having good a priori knowledge of energy harvesting.