In this section, we first formulate the problem and then provide a detailed solution by dynamic programming.
3.1. Problem formulation
In traditional routing algorithms, most efforts have been taken to alleviate the impact of the path loss [19, 20]. The problem to be addressed in this paper can be summed up as how far away the next-hop node should be. However, as energy and QoS aware packet forwarding are concerned, decisions should take into account both transmission distance and FER, i.e., the QoS issue. Meanwhile, both the power allocation and the route plan can be done jointly in the frame work of dynamic programming, hop by hop in the packet forwarding process. The introduced forwarding protocol can be performed in a distributed fashion, because a distributed protocol is scalable and easily implementable in practice, and every sensor has to make forwarding decisions based on its limited localized knowledge without the usage of end-to-end feedback. Hence, by prediction technique, such as dynamic programming, to estimate energy consumption is straightforward. Here, we assume that every node has its position information, which can be easily obtained by small-sized, low power, low cost GPS receivers and position estimation techniques based on signal strength measurements. In addition, we assume that sensor nodes are deployed uniformly in the plane region. The data center (i.e., the destination node in the network) is fully aware of both the node density and the region size.
3.2. Solution
A WSN can be modeled using an undirected graph G(W, L), where W and L represent the set of all nodes and the set of all directed links, respectively. ∀w
i
, w
j
∈ L if and only if v
j
∈ A(w
i
), which represents neighboring region of w
i
that are directly reachable by w
i
with a transmitting power level within its dynamic range. For a U-hops path {w0, ..., w
k
, ..., wU- 1}, where w0 and wU-1denote the source and destination nodes, respectively. The final SER can be expressed as , where p
k
represents the transmission power allocated to the k-th node and l
k
= |(w
k
, wk+1)| denotes the distance of the link (w
k
, wk+1). Note that the total power constraint is p
k
+ c. We now cast the packet forwarding problem into the framework of dynamic programming [17], which contains the following five ingredients [12].
3.2.1. Stage
The process of packet forwarding can be naturally divided into a set of stages by hops on the path. Stages are indexed by positive integers (i = 1, 2, ...).
3.2.2. State
At every stage i, the state s
i
= (w
i
, e
i
) consists of two components: the position of current node w
i
, and the remaining power e
i
. Thus, the state space is a multi-dimensional continuous space S = A × [emin, emax], where A represents the region that nodes are deployed, and emin and emax represent the minimum and maximum end-to-end power consumption thresholds, respectively. An alternative forms of state can be expressed by s
i
= (d
i
, e
i
), where d
i
denotes the distance from w
i
to the destination. Correspondingly, the state space is a two-dimensional continuous space represented by S = [0, D]×[emin, emax], where D denote the farthest distance from the sensor node to the data center.
3.2.3. Decision
As we have mentioned earlier, a decision should sort out two problems: how far away the next-hop node, and how much power should be allocated in order to forward the packet. Hence, we can define the decision at stage i as , where represents the target position of wi+1(there may be no sensor at this position). Note that and ei+1provide answers to the questions we give forward. The decision space is a multi-dimensional continuous space G = A × [emin, emax], while its subset at state s
i
= (w
i
, e
i
) is G(s
i
) = A(w
i
) × [emin,e
i
]. Since the target position always appears on the line connecting w
i
and the destination, a single variable l
i
= |(w
i
, wi+ 1)| denoting the target advancement at state s
i
is enough to represent the position of wi+1. Thus, a decision could be alternatively described in term g
i
= (l
i
, e
i
). With this definition, the decision space is a two-dimensional continuous space G = [0, Dmax]×[emin, emax], where Dmax is the maximum transmission radius of nodes. Both terms of decisions will be used in the later discussion.
It is notable that the decision we define above might not reflect the exact position of the relay node wi+1. It just describes the ideal position . Therefore, one additional procedure called relay-selecting algorithm should be carried out to find out the exact relay node. This procedure works in this way: Given an optimal position , the node within the region of A(w
i
) and being the nearest to will be selected as wi+1. Node w
i
will be chosen to forward the packet to wi+ 1within consumed power e
i
.
3.2.4. Policy
A policy g : S → G represents a mapping method from state space to decision space. The decision according to state s
i
can then be written as g
i
= g
i
(s
i
), where g
i
is the policy at state s
i
. A policy is said to be stationary, if the mapping does not change with stages, i.e., ∀i, g
i
= g. That is, once the input state is given, the output decision would be determined whatever stage it is at. Here, we consider only stationary policies as candidates and the feasible stationary policy space is represented by .
3.2.5. Value function
Value function (or cost-to-go function) plays an important role in the framework of dynamic programming based algorithm. Usually, a value function J : S → ℝ is a mapping from the state space to the set of real values. The value function J
g
(s) we define here can be interpreted as the average end to end SER with respect to the initial state s
x
and the stationary policy g, which is given by
(13)
where is the SER from state s
i
to sk+1and ϵ
k
represents the derivation between the actual position w
k
and the ideal position . Given g(s
k
) and ϵ
k
, the state sk+1can be determined. Hence, we may use SER'(s
x
, s
y
) to represent the SER from state s
x
to state s
y
in the later discussions.
An iteration form of (13) is [12]
(14)
where f
g
(·, ·) is the state transition probability density function (PDF) with policy g, and φ
g
(s
x
) = ∫
G
SER'(s
x
, s
y
)f
g
(s
x
, s
y
)ds
y
is the average one-hop SER with policy g given the current state s
x
.
Actually, (14) is the standard result in dynamic programming problems. The objective is to find out the optimal policy. A policy g*. is called optimal if for every other policy g. We use J*(·) to denote the value function under the optimal policy. In principle, the optimal policy can be obtained by solving the Bellman's equation [17]
(15)
Once the optimal value function J* are available, the optimal forwarding policy is given by
(16)
We notice that the optimal policy consists of a series of optimal decisions which are made at each state s
x
to maximize the right-hand side of (16).