In this section, we focus on the minE problem with a given deadline. We will first investigate some basic properties of the optimal solution. Then, we will decompose the minE problem into two simplified models and figure out the relationship between the minE problem and the decomposed problems. Finally, we develop an optimal algorithm to compute the optimal rate schedule for the minE problem.
4.1. Basic Properties of Optimal Rate Schedule
Define the optimal rate scheduling policy for the minE problem to be ${r}^{opt}\left(t\right)$ if it exists, which is referred to as ${r}^{opt}$ for short. We start by introducing some optimality properties about ${r}^{opt}\left(t\right)$ in the following lemmas.
Before we start, we first introduce the concept of equalization that will be used in our proofs. Given two rates ${r}_{1},{r}_{2}$, if we can equalize the two rates to $\frac{{r}_{1}+{r}_{2}}{2}$, the power consumption would decrease due to the fact that $2G\left(\frac{{r}_{1}+{r}_{2}}{2}\right)<G\left({r}_{1}\right)+G\left({r}_{2}\right)$ for convex ratepower functions. This method is called equalization.
We present the following two basic lemmas which can be easily extended from prior works that do not consider data sharing [
16,
20] (the detailed proof is omitted here).
Lemma 1. ${r}^{opt}\left(t\right)$ changes only at event points.
Lemma 2. ${r}^{opt}\left(t\right)$ is nondecreasing.
These two lemmas show that ${r}^{opt}\left(t\right)$ is a step/staircase function. In the following discussion, when we refer to a step, we mean a unique and consecutive part of a step function with constant rate. Specifically, let ${r}_{i}$ be the transmission rate of step i in ${r}^{\mathit{opt}}$. Accordingly, the ordered sequence of all the steps of a step function will be called a step sequence.
Then, we derive two properties of the optimal rate scheduling policy under the data sharing setting.
Lemma 3. If ${r}^{opt}\left(t\right)$ increases at a harvesting point ${c}_{i}$ at which no task arrives, then the battery must be used up right before ${c}_{i}$. Viz., ${\sum}_{t=1}^{{c}_{i}1}G\left({r}^{opt}\left(t\right)\right)={\sum}_{k:{c}_{k}<{c}_{i}}{E}_{k}$.
Proof. We prove the lemma by contradiction. Suppose on the contrary, ${r}^{opt}\left(t\right)$ increases at a harvesting point ${c}_{i}$, but there remains some amount of energy at time slot ${c}_{i}1$. We focus on interval $[{c}_{i}1,{c}_{i}]$. Since there is no other task request arriving at ${c}_{i}$, it implies that if we moved a small amount of data from time slot ${c}_{i}$ to be transmitted at ${c}_{i}1$, it would save some energy and would not violate any delay constraint, leading to a contradiction. This completes the proof. ☐
It is worth noticing that the condition that no task arrive at ${c}_{i}$ is necessary. Because otherwise if a task with a large workload also arrives at ${c}_{i}$, say ${J}_{i}=({c}_{i},{w}_{i})$, then we cannot move some data from time slot ${c}_{i}$ to ${c}_{i}1$ since the delay constraint ${\sum}_{t={c}_{i}}^{T}r\left(t\right)\ge {w}_{i}$ of this task may not hold any more.
Lemma 4. If ${r}^{opt}\left(t\right)$ increases at an arrival point ${a}_{i}$ at which no energy harvesting occurs, then the total transmitted data from this point to the deadline T will be equal to the required data of task ${J}_{i}$. Viz., ${\sum}_{t={a}_{i}}^{T}{r}^{opt}\left(t\right)={w}_{i}$.
Proof. First of all, we have ${\sum}_{t={a}_{i}}^{T}{r}^{opt}\left(t\right)\ge {w}_{i}$, since the delay constraint of every task must be satisfied. Suppose ${\sum}_{t={a}_{i}}^{T}{r}^{opt}\left(t\right)$ is strictly greater than ${w}_{i}$. Note that, we have ${a}_{1}<{a}_{2}<\dots <{a}_{n}$. Moreover, ${r}^{opt}$ is nondecreasing according to Lemma 2. Hence, we can always find an epoch in $[{a}_{i},T]$ and equalize some small amount of data from that epoch to the epoch right before ${a}_{i}$ that has smaller rate than that one in $[{a}_{i},T]$, which would not violate the delay constraint of task ${J}_{i}$ since ${\sum}_{t={a}_{i}}^{T}{r}^{opt}\left(t\right)>{w}_{i}$. Moreover, since no energy arrives at ${a}_{i}$, moving a small amount of energy used at ${a}_{i}$ to the time before it would not violate the energy causality constraint. This adjustment would save some energy by the convexity of the ratepower function, resulting in a contradiction to the optimality of ${r}^{opt}$. Thus, under the optimal policy, the delay constraint at that point must be satisfied as an equality. ☐
Lemmas 1–4 together show that ${r}^{opt}\left(t\right)$ is a nondecreasing step function that changes its rate either at a harvesting point or at an arrival point.
According to Lemmas 3 and 4, we have a direct corollary for the case that both a task request and a harvesting event occur simultaneously,
Corollary 1. If ${r}^{opt}\left(t\right)$ increases at a point e at which both a task request ${J}_{i}=(e,{w}_{i})$ and a harvesting event ${H}_{i}=(e,{E}_{i})$ occur, then either the total transmitted data from e to T will be equal to ${w}_{i}$, or the battery is used up just right before time slot e.
4.2. Problem Decomposition
Although a deadline is given, the minE problem is still complex with dynamic arrivals of both energy and requests. These arrival densities together have an impact on the allocation of transmission rate. Intuitively, an efficient rate schedule in an energy harvesting communication system tends to properly use partial energy early to avoid causing high density of remained energy in late periods (which is energy inefficient by the convexity of ratepower function). However, the efficient data sharing scheduling tends to reduce the traffic transmitted in early periods and increase data transmission in late periods so as to allow more data sharing.
Observing the above dilemma in dealing with the energy harvesting and data sharing, in this work, we address the challenge/tradeoff by decomposing the problem into subproblems. We then combine their solutions to form the optimal solution for the original problem. According to the best of our knowledge, no similar method has ever been proposed in the literature.
Note that previous Lemmas 3 and 4 present properties of the optimal increasing point in terms of energy harvesting and task requesting, respectively. This implies that we may decompose the problem into two simpler models: one is the transmission only with energy harvesting, and the other is the transmission only with task requests and data sharing. Thus, before deriving the structure of the optimal solution for the minE problem, we will introduce these two simpler models.
We first introduce the DCRS problem that does not consider energy harvesting, as defined in Definition 4.
Definition 4. Given a deadline T, the delayconstrainedonly rate scheduling problem (DCRS problem) is to find a rate function such that the total energy consumption is minimized, subject to the delay constraints of all task requests described in Equation (1) under the data sharing setting. For DCRS problem, Wu et al. [
9,
26], propose an optimal algorithm called I
ntervalD
elete to search for the task with the largest average data density and then iteratively fix a part of the optimal rate function by deleting the corresponding time interval. We call the optimal rate function for DCRS problem the
ID rate schedule and use
${r}^{ID}\left(t\right)$ to represent it (or
${r}^{ID}$ for short if there is no ambiguity).
Next, we introduce the EHRS problem that does not consider data requests and data sharing, as described in Definition 5.
Definition 5. Given a deadline T, the energyharvestingonly rate scheduling problem (EHRS problem) is to determine a rate schedule, such that the total transmitted data is maximized before the deadline T, subject to the energy causality constraints of Equation (2). In contrast to DCRS problem, there is no concept of
data requests or
data sharing. It is assumed that there is enough data bits to be transmitted by the transmitter at the beginning of transmission, and the only objective is to send as much data bits as possible. For EHRS problem, an optimal algorithm that recursively fixes all parts of the optimal solution is provided in [
28]. We call the optimal rate function for EHRS problem the
MT rate schedule and use
${r}^{MT}\left(t\right)$ (or
${r}^{MT}$ for short) to represent it.
It has been proved in previous work that both ${r}^{ID}$ and ${r}^{MT}$ are nondecreasing step functions. Specifically, the increasing point of ${r}^{ID}$ must be a task arrival point and ${r}^{ID}$ follows a similar property as described in Lemma 4. Also, the increasing point of ${r}^{MT}$ must be corresponding to a harvesting event and it shares a property similar to Lemma 3.
For ease of presentation, we use ${r}_{i}^{ID}\left(t\right)$ or ${r}_{i}^{ID}$ for short (and correspondingly ${r}_{i}^{MT}\left(t\right)$ or ${r}_{i}^{MT})$ to denote the rate function of the ith step of the step function ${r}^{ID}$ (and ${r}^{MT}$). We denote the step sequences of a step function $r\left(t\right)$ as $\mathcal{S}=\left\{{S}_{1},{S}_{2},\dots \right\}$, where a triple ${S}_{i}=({r}_{i},{t}_{i},{l}_{i})$ is used to describe the ith step of $r\left(t\right)$, which means the ith step with transmission rate ${r}_{i}$ starts at time slot ${t}_{i}$ and lasts for ${l}_{i}$ time slots (including time slot ${t}_{i}$). Thus, the end point of the ith step is ${t}_{i}+{l}_{i}1$. Specifically, we use ${\mathcal{S}}^{ID}=\left\{{S}_{1}^{ID},{S}_{2}^{ID},\dots \right\}$ and ${\mathcal{S}}^{MT}=\left\{{S}_{1}^{MT},{S}_{2}^{MT},\dots \right\}$ to represent the step sequences of ${r}^{ID}$ and ${r}^{MT}$ respectively, where ${S}_{i}^{ID}=({r}_{i}^{ID},{t}_{i}^{ID},{l}_{i}^{ID})$ and ${S}_{i}^{MT}=({r}_{i}^{MT},{t}_{i}^{MT},{l}_{i}^{MT})$.
Lemma 5. If ${r}_{1}^{ID}>0$, then ${J}_{1}$ has the largest workload among all the tasks. That is, ${w}_{1}={max}_{i:{J}_{i}\in \mathcal{J}}\left\{{w}_{i}\right\}$.
Proof. It can be proved by contradiction easily. Suppose ${J}_{1}$ is not the request with the largest workload. We can pick the one with largest required data, say ${J}_{k}(k\ne 1)$, then it is obvious that ${J}_{1}$ can completely share the data of ${J}_{k}$, which means there is no need to allocate a rate larger than 0 with ${r}_{1}^{ID}>0$ until ${J}_{k}$ arrives. This leads to a contradiction and proves the lemma. ☐
Note that the same observation as the lemma above is also applicable to the optimal solution ${r}^{opt}$ of the minE problem.
4.3. The BottleneckSelect Algorithm
After introducing the basic properties of ${r}^{opt}$ and the two decomposed simple subproblems, we are ready to examine the key properties of the minE problem that would guide the design of our algorithm.
On one hand, if the energy is sufficient (or more precisely, if for all time slots $t\in [1,T]$, harvested energy is sufficient to support ${r}^{ID}$), then we have ${r}^{opt}={r}^{ID}$, since ${r}^{ID}$ is the optimal rate schedule that achieves the minimum energy consumption given a deadline T. On the other hand, if harvested energy is insufficient to support ${r}^{ID}$, the rate level must be decreased in order to avoid energy shortage. However, if the rate level is lowered down too much, then less data would be transmitted in the current epoch, which would lead to a situation that more data will be transmitted later with higher rate which is energy inefficient. Thus, we hope to reach a good tradeoff between the amount of transmitted data and energy consumption, and allocate proper transmission rate to overcome the energy shortage.
Our high level idea is to compare the rates of ${r}^{ID}$ and ${r}^{MT}$ to help figure out what rate the optimal solution ${r}^{opt}$ should choose.
Theorems 1 and 2 below together show the key properties that would help determine the rate.
Theorem 1. If ${r}_{1}^{ID}\ge {r}_{1}^{MT}$, then the optimal solution ${r}^{opt}$ for the minE problem exactly equals to ${S}_{1}^{MT}$ during interval $[1,{l}_{1}^{MT}]$.
Proof. We prove Theorem 1 by contradiction. If ${r}^{opt}$ is not equal to ${S}_{1}^{MT}$ under the condition that ${r}_{1}^{ID}\ge {r}_{1}^{MT}$ in interval $[1,{l}_{1}^{MT}]$, then we consider all the possible relationships between ${r}^{opt}$ and ${r}^{MT}$ during interval $[1,{l}_{1}^{MT}]$ one by one:
(1) ${r}^{opt}\left(t\right)>{r}_{1}^{MT}$ for all t in $[1,{l}_{1}^{MT}]$.
According to the properties of ${r}^{MT}\left(t\right)$, energy will be used up by time slot ${l}_{1}^{MT}$, thus ${r}^{opt}$ cannot be supported to have larger rate in the whole interval $[1,{l}_{1}^{MT}]$. Therefore such a case is impossible to occur.
(2) The curve of ${r}^{opt}\left(t\right)$ intersects with that of ${r}^{MT}$ in $[1,{l}_{1}^{MT}]$.
An examplary diagram corresponding to this case is shown in
Figure 2. By the nondecreasing property of
${r}^{opt}$ in Lemma 2, it is a fact that there is at most one intersection between
${r}^{opt}$ and
${r}^{MT}$ in interval
$[1,{l}_{1}^{MT}]$. Let the corresponding time slot of the intersection be
$\widehat{t}$. Then
${r}^{opt}\left(t\right)\le {r}_{1}^{MT}$ in
$[1,\widehat{t}1]$ and
${r}^{opt}\left(t\right)\ge {r}_{1}^{MT}$ in
$[\widehat{t},{l}_{1}^{MT}]$. We claim that
$\widehat{t}$ cannot be a harvesting point, because otherwise according to Lemma 3 energy is used up by time
$\widehat{t}$, which contradicts the feasibility of
${r}^{MT}$ that has a larger rate than
${r}^{opt}$ by time
$\widehat{t}$. Thus,
$\widehat{t}$ can only be an arrival point. Let the arrival task at
$\widehat{t}$ be
${J}_{i}=(\widehat{t},{w}_{i})$. Now that
$\widehat{t}$ is an arrival point that
${r}^{opt}$ increases, we have
${\sum}_{\tau =\widehat{t}}^{T}{r}^{opt}\left(\tau \right)={w}_{i}$ according to Lemma 4. Meanwhile, for
${r}^{ID}$, it must satisfy
${\sum}_{\tau =\widehat{t}}^{T}{r}^{ID}\left(\tau \right)\ge {w}_{i}$ to follow the delay constraint of task
${J}_{i}$. In addition, since
${r}_{1}^{ID}\ge {r}_{1}^{MT}>0$, which means that the first task
${J}_{1}=(1,{w}_{1})$ has the largest amount of data request among all tasks according to Lemma 5. So
${\sum}_{t=1}^{T}{r}^{ID}\left(t\right)={w}_{1}$ and at least
${\sum}_{t=1}^{T}{r}^{opt}\left(t\right)\ge {w}_{1}$. Then,
Combining Equations (
4) and (5), we have
${\sum}_{\tau =1}^{\widehat{t}1}{r}^{opt}\left(\tau \right)\ge {\sum}_{\tau =1}^{\widehat{t}1}{r}^{ID}\left(\tau \right)$. However, it is clear that
${\sum}_{\tau =1}^{\widehat{t}1}{r}^{opt}\left(\tau \right)<{\sum}_{\tau =1}^{\widehat{t}1}{r}^{ID}\left(\tau \right)$ according to the precondition that
${r}^{opt}\left(t\right)\le {r}_{1}^{ID}$ in interval
$[1,\widehat{t}1]$, which brings us a contradiction. Thus, such a case is also impossible to occur.
(3) ${r}^{opt}\left(t\right)<{r}_{1}^{MT}$ in $[1,{l}_{1}^{MT}]$.
We consider two subcases: one is that ${r}^{opt}\left(t\right)$ is not constant in $[1,{l}_{1}^{MT}]$, the other is the constant case. For the former, we can follow the discussion similar to the proof of case (2) above, except that the intersection point in the discussion becomes the first point at which ${r}^{opt}\left(t\right)$ increases, thus we omit the details. For the latter, we extend the interval $[1,{l}_{1}^{MT}]$ and can always find the first point at which ${r}^{opt}\left(t\right)$ increases (${r}^{opt}\left(t\right)$ cannot keep to be a constant rate during the whole transmission by time T, otherwise it will contradict the existence of ${r}^{ID}$, because the delay constraint will be violated). Let the first increasing point of ${r}^{opt}$ be a time $\widehat{t}$ with $\widehat{t}>{l}_{1}^{MT}$, then $\widehat{t}$ must be a task arrival point or an energy harvesting point. On one hand, if $\widehat{t}$ is an energy harvesting point, then energy is used up by $\widehat{t}$, which implies a contradiction since ${r}_{1}^{MT}$ with a larger rate than ${r}^{opt}$ cannot be supported in $[1,\widehat{t}]$. On the other hand, if $\widehat{t}$ is an arrival point, then following the same proof as that of case (2) can also deduce a contradiction. These together would remove the possibilities of the case.
In summary, ${r}^{opt}\left(t\right)$ must be equal to ${r}_{1}^{MT}$ in interval $[1,{l}_{1}^{MT}]$. ☐
Symmetrically, we have the following theorem, where the detailed proof is moved to
Appendix A.
Theorem 2. If ${r}_{1}^{ID}<{r}_{1}^{MT}$, then the optimal solution ${r}^{opt}\left(t\right)$ for minE problem exactly equals to ${S}_{1}^{ID}$ during interval $[1,{l}_{1}^{ID}]$.
Based on Theorems 1 and 2, we are able to fix the rate schedule ${r}^{opt}\left(t\right)$ in interval $[1,{l}_{1}^{MT}]$ or $[1,{l}_{1}^{ID}]$. Then, starting with the next new time slot, the same problem would repeat, if we could correctly update the sets of tasks and harvesting events, until all the tasks are finished.
First, we introduce the update module, whose function is to generate the same smallersize problem after a part of the rate schedule ${r}^{opt}$ is fixed. Let the rate and corresponding interval of the fixed part in ${r}^{opt}$ be r and $[1,l]$, respectively. Since a part of the optimal solution has been fixed, we shift the time axis by l time slots and properly update the tasks and harvestings that arrive within and after the time duration of the fixed part by treating them as new instances. The detailed implementation is presented in Algorithm 1.
Algorithm 1 Update($\mathcal{J},\mathcal{H},r,l$) 
 1:
update the deadline T to be $Tl$.  2:
for each task ${J}_{i}$ with ${a}_{i}\le l$, update its arrival time to be ${a}_{i}=1$ and the remaining workload to be $max\{{w}_{i}r\xb7(l{a}_{i}+1),0\}$.  3:
among all the tasks with ${a}_{i}=1$, reserve the task with largest workload and remove all the others.  4:
for each task ${J}_{i}$ with ${a}_{i}>l$, update its arrival time to be ${a}_{i}l$.  5:
let ${E}_{new}={\sum}_{{c}_{i}\le l}{E}_{i}G\left(r\right)\xb7l$, remove all the harvestings with ${c}_{i}\le l$.  6:
create a new harvesting, let its arrival time be 1 and amount of energy be ${E}_{new}$.  7:
for each harvesting ${H}_{i}$ with ${c}_{i}>l$, update its arrival time to be ${c}_{i}l$.

Then, we present the final algorithm for computing the optimal schedule ${r}^{opt}$ of the minE problem. The idea is to compare the first steps of rates ${r}^{ID}$ and ${r}^{MT}$ in the two decomposed problems to find the bottleneck. If ${r}_{1}^{ID}\ge {r}_{1}^{MT}$, we select ${S}_{1}^{MT}$ as the first part of ${r}^{opt}$, otherwise, we select ${S}_{1}^{ID}$. After fixing the first part, we recursively update the problem and compute the residual part of ${r}^{opt}$. The detailed implementation is presented in Algorithm BottleneckSelect.
It is worth noticing that the minE problem with a given deadline may have no feasible solutions. This happens if the harvested energy is insufficient, or the deadline is set to be too early so that some delay constraints in Equation (
1) are impossible to be met. To detect the infeasibility of the input case, we just need to check whether there exists some task that has not been finished at the end of the while loop, as implemented in Line 15 in Algorithm 2.
Finally, we conclude that Algorithm BottleneckSelect either returns the optimal solution or identifies the infeasibility for the minE problem.
Algorithm 2 BottleneckSelect ($\mathcal{J},\mathcal{H},T$) 
 1:
let $r\left(t\right)\leftarrow 0$ in $[1,T]$, $t\leftarrow 0$.  2:
while $t\le T$ do  3:
compute the first step of ID rate schedule ${S}_{1}^{ID}=({r}_{1}^{ID},{t}_{1}^{ID},{l}_{1}^{ID})$.  4:
compute the first step of MT rate schedule ${S}_{1}^{MT}=({r}_{1}^{MT},{t}_{1}^{MT},{l}_{1}^{MT})$.  5:
if ${r}_{1}^{ID}\ge {r}_{1}^{MT}$ then  6:
$r\left(t\right)\leftarrow {r}_{1}^{MT}$ in $[t+1,t+{l}_{1}^{MT}]$.  7:
Update($\mathcal{J},\mathcal{H},{r}_{1}^{MT},{l}_{1}^{MT}$).  8:
$t\leftarrow t+{l}_{1}^{MT}$.  9:
else  10:
$r\left(t\right)\leftarrow {r}_{1}^{ID}$ in $[t+1,t+{l}_{1}^{ID}]$.  11:
Update($\mathcal{J},\mathcal{H},{r}_{1}^{ID},{l}_{1}^{ID}$).  12:
$t\leftarrow t+{l}_{1}^{ID}$.  13:
end if  14:
end while  15:
if there exists some task that has not been finished then  16:
return infeasible  17:
end if  18:
return$r\left(t\right)$

Theorem 3. Algorithm BottleneckSelect computes the optimal rate schedule for the minE problem when a feasible schedule exists, and determines the infeasibility of the input otherwise, in $O\left((n+m)({n}^{2}+m)\right)$ time.
Proof. We prove the optimality for minimizing the energy consumption by induction on iterations. In the first iteration, Algorithm BottleneckSelect correctly computes and fixes the partial optimal schedule that minimizes the energy consumption by Theorems 1 and 2, which serves as the induction basis. Suppose Algorithm BottleneckSelect fixes the optimal rate allocation in interval $[1,{l}^{\left(k\right)}]$ after the first k iterations ($k\ge 1$), we need to prove that this property also holds after the $(k+1)$th iteration. At the beginning of the $(k+1)$th iteration, all tasks with ${a}_{i}\le {l}^{\left(k\right)}$ are updated by the Update operation in the kth iteration. Specifically, each task with ${a}_{i}\le {l}^{\left(k\right)}$ has $max\{{w}_{i}{\sum}_{t={a}_{i}}^{{l}^{\left(k\right)}}r\left(t\right),0\}$ workload to be finished in $[{l}^{\left(k\right)}+1,T]$, and among them only the task with the largest remaining workload is retained and regarded as a new task at slot ${l}^{\left(k\right)}+1$, according to the sharing nature of the data. This operation ensures that no extra workload is dealt with later. Then, in the $(k+1)$th iteration, it can be verified that transmitting with the computed rate ${r}_{1}^{MT}$ (or ${r}_{1}^{ID}$) is energyoptimal for the new task set and harvesting event set by similarly applying the proof of Theorems 1 and 2 to the updated instance. Finally, when the iteration terminates with $t>T$, according to the correctness of hypothesis and inductions above, Algorithm BottleneckSelect has fixed the optimal minenergy rate schedule in $[1,T]$.
Next, we analyze the computational complexity. The
while loop repeats at most
$(n+m)$ times, since there are totally
$(n+m)$ event points and at least one event point is reached in each loop. To compute
${S}_{1}^{MT}$, we only need to scan the set of harvesting events once in at most
$O\left(m\right)$ time. However, we must construct the whole rate schedule of
${r}^{ID}$ before we obtain
${S}_{1}^{ID}$, because Algorithm I
ntervalD
elete in [
26] partially fixes
${r}^{ID}$ in a backtofront manner, which takes at most
$O\left({n}^{2}\right)$ time. The U
pdate part works with
$O(n+m)$ time and is not time consuming. Therefore, the total time complexity is
$O((n+m)\xb7({n}^{2}+m))$. ☐