## 4 The Proposed QoS-Aware Routing
### Energy-Aware Geographic Forwarding  
Rather than using traditional end-to-end path discovery-based routing, we use localized packet forwarding that implements hop-by-hop routing. This deferred choice gives each packet transmission multiple opportunities to make progress toward the destination. Our goal is to select a downstream node that has comparatively higher residual energy and gives higher geographic progress toward the destination sink. Note that while the second criterion decreases the number of hops between the source and the destination, the first one attempts to balance the energy consumption among the candidate downstream nodes. Our proposed energy-aware geographic forwarding (EAGF) uses a multiobjective Lexicographic Optimization (LO) approach [4] to manage this trade-off. In LO, the objective functions are arranged according to their absolute importance and the most important objective function is maximized (or minimized) first subject to the original constraints. If this problem has a unique solution, it will solve the whole multiobjective optimization problem. Otherwise, the second most important objective function is maximized (or minimized). Now, in addition to the original constraints, a new constraint is added. This new constraint is imparted to guarantee that the most important objective function preserves its optimal value. If this problem has a unique solution, it solves the original problem; otherwise, the process goes on as above. In solution to our problem, there are only two objective functions of which the first one, the maximization of the geographic progress, is the most important. Let the objective functions be arranged according to the lexicographic order, with the most important function being, \(f_{1}(j)=\frac{dist(i,s)-dist(j,s)}{dist(i,s)},\forall(i,j)\in\mathcal{N}, \forall s\in\mathcal{S}\), where \(dist(a,b)\) denotes the geometric distance between nodes \(a\) and \(b\); and, the least important one being \(f_{2}(j)=\frac{e_{res}(j)}{e_{init}}\). Thus, we write the lexicographic problem for any node \(i\in\mathcal{N}\) as follows,  
\[\text{lex maximize} f_{1}(j),\ f_{2}(j) \tag{1}\] \[\text{subject to}\] \[j\in\mathcal{N}_{i}, \tag{2}\]  
where, \(\mathcal{N}_{i}\) is the list of \(i\)'s single hop neighbor nodes. The above LO problem can be divided into two separate problems with different constraint sets. The first problem is formulated as  
\[\text{maximize} f_{1}(j) \tag{3}\] \[\text{subject to}\] \[j\in\mathcal{N}_{i}\] (4) \[dist(i,\mathcal{S})>dist(j,\mathcal{S}),\quad\forall j\in \mathcal{N}_{i}\] (5) \[dist(i,j)\geq\overline{dist(i,j)},\quad\forall j\in\mathcal{N}_{i} \tag{6}\]and its solution \(j_{1}^{*}\) and \(f_{1}^{*}=(j_{1}^{*})\) is obtained; here, \(\overline{dist(i,j)}\) is the average distance from node \(i\) to all neighbor nodes \(j\). Then the second problem is formulated as  
\[\mathrm{maximize} f_{2}(j) \tag{7}\] \[\mathrm{subject\ to}\] (8) \[\text{subject to}\]0 (9) \[\text{subject to}\]1 (10) \[\text{subject to}\]2 (11) \[\text{subject to}\]3 (12) \[\text{subject to}\]4  
and the solution of this problem is \(j_{2}^{*}\) and \(f_{2}^{*}=(j_{2}^{*})\); here, \(\overline{e_{res}(j)}\) is the average residual energy level of the neighbor nodes \(j\) of \(i\). If \(j_{2}^{*}\) does not produce a unique solution, we break the tie by selecting the one that produces the most geographic progress. Note that the nice property of LO is its simplicity, and such a lightweight but effective method is suitable for resource-constrained BSNs. Even though LO has the drawback of neglecting less important objective functions when the most important one produces the unique solution, in our case, such situations should occur less frequently due to the high density of the network nodes. Moreover, LO exploits only local information to make routing decisions.