Abstract
This work proposes a novel in-network distributed algorithm for real-time energy optimal routing in ad hoc and sensor networks for systems with linear cost functions and constant communication delays. The routing problem is described as a minimum-cost multicommodity network flow problem by linear programming and modified by network replication to a real-time aware form. Based on the convex programming theory we use dual decomposition to derive the distributed algorithm. Thanks to the exact mathematical derivation, the algorithm computes the energy optimal real-time routing. It uses only peer-to-peer communication between neighboring nodes and does not need any central node or knowledge about the whole network structure. Each node knows only the produced and collected data flow and the costs of its outgoing communication links. According to our knowledge, this work is the first, which solves the real-time routing problem with linear cost functions and constant communication delays, using the dual decomposition.
1. Introduction
Our work is focused on a distributed algorithm for data flow routing through multihop ad hoc and sensor networks, where all data has to be delivered to the destinations in time. An example of a target application is a network periodically sensing some consumption variables (like gas consumption, water consumption, etc.) in large objects. Each sensing device produces a data flow of a particular volume, which is supposed to be routed through the network. The objective is to optimize the energy consumption for the data transfer (minimal possible consumption in the whole network), while constrained by the communication capacities (maximum data volume which can be transferred by a device per time unit) and by maximum communication delay.
We assume a time division multiple access (TDMA) protocol (e.g., GTS allocation in IEEE 802.15.4 [1]) which ensures collision-free communication and causes constant communication delay. This approach is used quite often in industry and time-critical systems. Due to the TDMA mechanism assumed, the worst-case delay from the source node to the sink node is the sum of the particular delays for each of the hops, assumed to be an integer (derived from the parameters like TDMA period, worst-case execution time of the communication stack…). In a particular setting, we may assume a unit hop delay (e.g., the same TDMA period). In this paper we assume the unit hop delay (the deadlines are expressed as the number of communication hops between devices) which is very transparent for the reader.
There are many communication protocols designed to find the exact energy optimal data routing in wireless sensor networks. However, to comply with the communication capacities, they usually need a central computational point with the knowledge of the actual network structure and parameters (e.g., [2]). The existence of such a computational point decreases the robustness of the system against the network damage. Furthermore, the routing of information about the actual network structure and parameters has to be solved in the case of the centralized algorithm.
In this paper, we propose a distributed algorithm, which computes the energy optimal real-time data routing without the need of any central computational or data point. The algorithm supposes that each node knows only the cost (energy consumption per transmitted data unit) of its outgoing communication links and the data which is supposed to send and receive. The whole algorithm is mathematically derived using the convex programming theory. The main purpose of this paper is to present the principle of new distributed routing algorithms rather than to present an application-ready algorithm. We believe that the presented approach can lead to new, efficient, and highly adaptive routing algorithms for ad hoc and sensor networks. Moreover, the approach used in this work can be adapted for general distribution of convex optimization problems into the network.
2. Related Works
Traditionally, the routing problems for data networks are formulated as linear or convex multicommodity network flow routing problems, for example [2–4]. One of the advantages of this method is that several cost functions and constraints can be put together (e.g., different types of capacity and energy consumption constraints and real-time constraints). Using the same underlying model, we can easily combine the solution of different works focused on partial problems.
Several papers have been performed in the area of real-time routing in multihop wireless sensor networks. In [5], a well-known soft real-time communication protocol SPEED is presented. Several works use the relation between the message propagation speed and transmitting energy to balance the trade-off between the energy consumption and communication delay [6–8]. In [9] the authors deal with real-time communications over cluster-tree sensor networks, where they evaluate the end-to-end communication delay. However, none of these algorithms can ensure real-time and energy optimal data routing especially in high-loaded networks.
There are several works, which focus on the decomposition of network problems described by strictly convex optimization. A systematic presentation and classification of the decomposition techniques for network utility maximization (NUM) is presented in [10–12].
In [13–15], the authors use dual decomposition to decompose cross-layer optimization problems into the optimization of separated layers. The presented approaches lead to structural decomposition (e.g., to the routing layer, the capacity layer…) which is not suitable for the derivation of the in-network distributed algorithm. In [16], a general distributed algorithm for a strictly convex optimization problem with a common parameter for all nodes is presented. The decomposition of an optimal routing problem is presented, for example, in [17, 18], where the authors focus on the node-path formulation and based on dual decomposition derive an algorithm suitable for networks with a small number of communication paths.
In [19, 20], the authors use the duality theorem and node-link problem formulation to analytically derive the maximum network lifetime for linear networks. In [21], the authors use the node-link problem formulation and derive the distributed routing algorithm with an extension for the queuing delay. However, all these algorithms are limited to strictly convex cost functions and fail in the case of linear cost functions.
This paper also continues our previous work. It joins and extends the results from [22, 23]. In [22], we have derived a distributed in-network routing algorithm based on dual decomposition. The algorithm consists of one iteration loop and is even able to solve problems with a linear objective function. In [23], we have presented a centralized algorithm for energy optimal real-time routing, which is represented as a min-cost multicommodity network flow routing problem with side constraints.
2.1. Contribution and Outline
The main contributions of this paper are
introduction of a new mathematically derived, distributed algorithm for energy optimal real-time routing based on network replication and dual decomposition; introduction of a new approach for an in-network distribution of real-time routing problems with constant communication delay and linear objective function; application of a distribution procedure for routing problems presented in [22] on a real-time routing problem [23].
The paper is organized as follows. Section 3 briefly describes the multicommodity network flow model. In Section 4 we define the real-time routing model. In Section 5, the distributed algorithm and its derivation are presented. An example and computational complexity experiments are given in Section 6. Section 7 concludes the paper and mentions the future work. The proof of the algorithm convergence is presented in the Appendix.
3. Multicommodity Network Flow Model
In this section, we briefly summarize the basic terminology and specify the multicommodity network flow model. For more details see, for example, [3, 4].
The network is represented by an oriented graph, where for each device able to send or receive data, a node of the graph exists. The nodes are labeled as
By m we denote an index of the communication demand and by ℳ we denote a set of all communication demands. The communication demands can be seen as the flow of various commodities incoming/leaving the network in some nodes. The flow of each communication demand has to satisfy the flow conservation law at each node (for a given commodity, the sum of the flow incoming to the node is equal to the sum of the flow leaving the node)
In this work, the node capacity constraints are used. They are the most common capacity constraint used for wireless networks. The total volume of the flow leaving one node has to satisfy the capacity constraint
In summary, the network flow model imposes the following constraints on the network flow variables
The task of the total energy minimization is to minimize the cost function
Another target application of this approach is a network, where the energy supplies of the nodes can be recharged with different maintenance costs (e.g., depending on the node reachability). In such an application, the recharge price is included in vector
4. Real-Time Multicommodity Network Flow Model
In this section, we extend the multicommodity flow model by real-time constraints, which guarantee a controllable routing delay through the network. Each communication demand has its own deadline, and the communication delay of each demand has to be shorter than its deadline. We model the hop delay as an integer value associated with each communication link. For transparent model derivation, we assume the same communication delay over the entire network (i.e., each communication hop causes a delay equal to one). However, the model can be extended to a more general form, where the communication delays are integers.
4.1. Mathematical Model of Real-Time Routing
Let vector
Vector
Through (4) and (5), we have converted the real-time constraint (i.e., the delay has to be shorter than the deadline) to the structural constraint. Only the flow, whose delay is shorter than the deadline, is represented. The flow, which does not meet the deadline, violates the flow conservation law, and then the network flow constraints are not satisfied; that is, this solution is not feasible.
If the flow is sent through the network, the flow delay is increased by each communication hop. The flow of demand m coming into node n with communication delay w has to either leave the network in node n with the same delay w or reach the neighbor node with delay
In summary, the real-time energy optimal multicommodity flow routing problem can be written as
Problem (7) describes the problem in a form, which can be solved in centralized way by any linear programming solver.
4.2. Intuitive Presentation of Extended Graph
In this section, we illustrate, in an intuitive way, the graph transformation, which has been discussed in Section 4.1 by mathematical equations. New variables have appeared for each communication link as well as new constraining equations for each node. These variables and constraints can be seen as virtual layers of the network where each layer represents a different communication delay w. The number of the network layers is equal to the integer deadline of the demand m plus one (the number of allowed communication hops plus a zero layer). As consistent with the structure of (6), all communication links are redirected to the nodes in the higher layer, which means that the flow is routed not only in node space but also in delay space. Because the number of layers is limited by the deadline and the flow can leave the network only in virtual nodes of the sink nodes, all possible routings through this transformed network hold the deadlines. An easy example of the graph replication is shown in Figure 1.

Example for the intuitive presentation.
5. Decomposition of the Routing Problem
To decompose the routing algorithm, we use the gradient optimization method to solve its dual problem. However, the linearity of the cost function of the problem (7) would cause oscillations in the gradient algorithm and prevents us finding the optimal solution. Therefore, we use the proximal-point method (for details see [4]) to modify the problem into a strictly convex form, which allows the usage of the gradient method. Moreover, we rewrite the problem into an equality form for a more transparent presentation:
We have added slack variables
5.1. Dual Problem
To solve the internal subproblem of (8) (minimization over the variables
The Lagrangian function of the problem (8) is
The dual problem of the internal subproblem of (8) is
5.2. Dual Gradient Algorithm
Using the dual problem (13) and the dual function (11) we rewrite the routing problem (8) into the form:
The important property of algorithm (17) is that it can be distributed as an in-network algorithm. Each node is responsible for the computation of the flow volume of the links leaving the node and for computation of the other corresponding variables. All the components of the variable vectors are a function of the node local variables and of the variables of the neighboring nodes that are within one hop communication distance. Only peer-to-peer communication during the algorithm is needed.
However, the distributed version of such an algorithm would have problems with the termination of the internal loop and with the synchronization of the loops between the nodes. Moreover the nested loops would cause an increase in the iterations.
To overcome these problems, we join both loops of the gradient algorithm into one loop, where we update all the variables simultaneously. Using (12), (14), and (15) we derive the iterative algorithm which is presented in Table 1, where k denotes the iteration number.
Distributed routing algorithm.
The correctness of such an algorithm is not seen directly from its derivation and has to be proven. The proof of the algorithm convergence is not a trivial problem, and its simplified version is presented in the Appendix. A necessary condition for the algorithm convergence assumed in the proof is
The initial variables
5.3. Variables Initialization
As we have mentioned in Section 5.2, the number of iterations depends on the initial variables
Let us suppose some initial variable
According to the complementary slackness condition (for details see, e.g., [4]) for the optimal solution holds for two neighboring nodes: if
6. Experiments
To demonstrate the behavior and the correctness of the distributed routing algorithm, we have performed several experiments in Matlab. We have focused on a basic problem, where for each communication demand one node sends data flow to one sink node (i.e., a multicommodity mono-source, mono-sink problem). Therefore,
The random networks for the experiments have been constructed as follows. We consider a square field of size [size × size], where the size is changing during the experiments. The field is divided into subsquares of size
During the experiments we evaluate k as a number of iterations needed to achieve less than 1% deviation of the cost function from the optimal value, less than 1% capacity violation, and less than 1% flow conservation law violation during the last 500 iterations. The 500 iterations are included in the statistics. (the optimal value was computed separately by a centralized algorithm for evaluation purposes only).
Unfortunately, as the presented approach of dual decomposition of the routing problems in node-link form is a new technique, there are only few works in this area at this moment. The most similar work can be found in [21]. However, it is focused on slightly different problems. It uses different energy consumption and communication delay models, and it is limited only on problems with strictly convex objective functions. Our work is focused on the problems with linear objective functions and presents different qualities than [21]. Due to the differences in the used models and algorithms derivations the experimental comparison would have a disputable contribution and would be strongly dependent on the chosen problems.
6.1. Example
To present the resulting optimal data flow routing in the network we have performed an experiment based on the network described above. The field size has been set to 9 (i.e., 81 nodes in the network), and the number of communication demands has been set to 8. The link capacities have been set to
The optimal data flow routing in the network is shown in Figure 2. The 3D routing model in the node-delay space is presented in Figure 3 where the vertical axis represents the communication delay. No communication demand routing has more than 6 communication hops.

Optimal data flow routing (multicommodity, mono-source, mono-sink problem).

Optimal data flow routing in node-delay space.
The algorithm behavior can be seen in [25] on video. The flow routing in the network and in the node-delay space and the progress of the flow conservation law are presented.
6.2. Algorithm Convergence
We have performed a set of experiments with random initial variables on random networks, and we have evaluated the algorithm convergence. The field size has been set to 7. There are 8 communication demands in the network. The initial values have been set randomly from intervals:
The algorithm has been run 2000 times on random networks. The results are presented in Figure 4. There, the number of iterations is placed on the horizontal axis, and the number of experiments, which has been finished before the number of iterations, is on the vertical axis.

Algorithm convergence with random initial variables.
This experiment provides an important practical verification of the theoretical proof of the algorithm convergence. 95% of the experiments have been finished before 14300 iterations.
6.3. Number of Iterations
To demonstrate the statistical behavior of the algorithm, we have gradually increased the number of nodes from 16 to 100 (i.e., the field size from 4 to 10) for 8 communication demands. The computation has been repeated, on random networks 1000 times for each number of nodes.
The results have been evaluated as a maximum, average, and minimum number of iterations needed to achieve the optimal value, and it is presented in Figure 5. There, the experiment progress is presented for the basic algorithm without the initial heuristic in black (the initial variables have been set to zero) and for the algorithm with the initial heuristic according to Section 5.3 in gray.

The number of iterations in relation to the number of nodes. In black, for zero initial variables. In gray, for initialization according to Section 5.3.
Similar experiments have been performed for the iterations dependence on the number of communication demands. We have gradually increased the number of communication demands from 1 to 16 in networks with 49 nodes. The computation has been repeated, on random networks 1000 times for each number of communication demands. The results are presented in Figure 6 for both algorithms with and without the initial heuristic.

The number of iterations in relation to the number of communication demands. In black, for zero initial variables. In gray, for initialization according to Section 5.3.
In Table 2, we present the percentages of infeasible problems for each number of communication demands. The values say how much percent of the generated problems have not been feasible due to the capacity and real-time constraints. From Table 2, it follows that the network has been close to saturation and that the constraints affect the final routings.
Percentage of infeasible problems in the experiment for the number of communication demands.
The important outcome of these experiments is the observation that the number of iterations is approximately linear. It follows that the algorithm is easily applied to networks with many nodes. We can see a significant improvement of the initial heuristic in the Figures.
6.4. Network Change
The advantage of the one-loop algorithm presented in this work is that it can automatically adjust the data routing in case of network changes. In order to evaluate the algorithm behavior in this case, we have simulated a dying node in the network as follow.
(1) We generated a random network with communication demands and found the optimal solution. (2) In the original problem from step 1, we removed one node and measured the number of iterations to find the new optimal solution. (3) We repeated step 2 for 15 different nodes with the largest data flow.
The simulation has been performed for 942 random original networks with field size set to 7 and with 8 communication demands (i.e.,
The results are presented in Figure 7. There, the number of iterations is placed on the horizontal axis, and the number of experiments, which has been finished before the number of iterations, is on the vertical axis.

Algorithm convergence for network change simulation.
Video presentation can be seen in [25].
7. Conclusion
We have presented a distributed algorithm for the real-time energy optimal routing in ad hoc and sensor networks for systems with linear cost functions and constant communication delays. Such networks are used very often in the industrial environment, where TDMA-derived mechanisms or mechanisms with a significant stack computation delay are used. We have described the routing problem as a multicommodity network flow optimization problem, modified it into a time aware form, and used the dual decomposition method to derive the distributed algorithm. The algorithm does not need any central computational node with knowledge about the whole network structure, and it only uses local communication between the neighboring nodes. This rapidly increases the robustness of the algorithm in the case of partial network damage. We have performed several simulations to evaluate the algorithm behavior and to test its convergence. The mathematical proof of the algorithm convergence is available in the Appendix.
The main purpose of this paper was to present the basic concept of a new in-network distributed routing algorithms for real-time data and its derivation. From the experimental section it is seen that the algorithm is not application-ready because of the high number of iterations, which leads to high number of communications. However, the main strength of the algorithm is not to find the whole optimal routing in an unknown network, but to adapt an existing routing in case of local network changes (dead/new node, loss of connection, communication costs, or capacities change, etc.) where the number of data communications could be significantly decreased. Moreover, the algorithm can easily adapt to slow network changes. The algorithm is suitable for static networks with sporadic changes or for networks with slow continuous changes, so the routing can be adjusted.
According to our preliminary experiments the number of iterations can be significantly decreased in future work. The algorithm can be extended by heuristics based on the partial knowledge about the network structure (e.g., node geographical position) and heuristics based on Newton's method. The results of our preliminary testing indicate that Newton's method-based heuristics can decrease the number of iterations more than 3 times.
Considering the fact that the algorithm is based on Linear programming formulation, we believe that the principle of the algorithm and the approach used to its derivation can be used to solve many different problems in the sensor networks area, like resource sharing, network localization, object tracking, and so forth.
Footnotes
Appendix A
Acknowledgment
This work was supported by the Ministry of Education of the Czech Republic under the Project P103/10/0850 and the Project ME 10039.
