# Energy-Saving Traffic Scheduling in Hybrid Software Defined Wireless Reschargeable Sensor Networks
## 4 Mathematical Optimization Model
### Mathematical Optimization Model  
In order to get mathematical optimization model of the traffic scheduling problem in hybrid SDWRSNs, we assume \(V\) is the set of relay nodes (including sink node) in the network and \(C\) is the set of wireless chargers. \(N\) and \(D\), respectively, represent the subset of normal nodes and the subset of the SDN nodes. The sink node is expressed as \(s\). Obviously, there is \(N\subseteq V\), \(D\subseteq V\), and \(N+D+\{s\}=V\). The optimization objective is:  
\[\min:\sum_{v\in V,\;p\
eq s,\;c\in C}E_{cv}. \tag{11}\]  
For this problem, there are some constraint conditions to be followed. The flow conservation conditions are first. For node \(v\), in a given time span \(t\), the data it transmitted (\(k_{Tv}\)) equals to the data it received from the sensor subnet (\(k_{v}\)) and other relay nodes (\(k_{Rv}\)), except the sink node which only receives data from other nodes. For the entire network, the amount of data received is equal to the amount of data transmitted. Then, the constraints come as shown in Equations (12)-(14):  
\[k_{Tv}=k_{v}+k_{Rv},\quad\forall v\in V,v\
eq s, \tag{12}\]  
\[k_{Rs}=\sum_{\forall v\in V,\;v\
eq s}k_{v}, \tag{13}\]  
\[\sum_{\forall v\in V}k_{Tv}=\sum_{\forall v\in V}k_{Rv}. \tag{14}\]  
Another basic constraint is the capacity. Practically, the real data transmission rate is smaller than the nominal data rate. It is a general rule in communications to set a traffic allocation upper bound, which is lower than the channel's nominal data rate. Denote the data rate with \(R\) and the threshold with \(\beta\), there is:  
\[\frac{k_{Tv}+k_{Rv}}{t}\leq\beta R,\quad\forall v\in V,\;0<\beta\leq 1. \tag{15}\]  
For the normal nodes that run MTE protocol, the routes they choose have the minimum transmission energy. Assume \(r_{vw}\) is the minimum transmission energy from node \(v\) to node \(w\), and use a binary variable \(u_{vlbv}\) to show whether the node \(l\) (which is one of the one-hop neighbours of node \(v\)) is on the way from node \(v\) to node \(w\) and is equal to 1 when it is on that way. Assuming \(M\) is an arbitrarily large value and \(m\) is an arbitrarily small value, then there are two constraints as below:  
\[ \begin{split}& r_{vl}+r_{lw}-r_{vw}\leq(1-u_{vlbv})M\quad\forall v,l,w \in N,\\ & r_{vl}+r_{lw}-r_{vw}\geq(1-u_{vlbv})m\quad\forall v,l,w\in N, \end{split}  \tag{16}\]  
when a node \(l\) is not on the way from node \(v\) to node \(w\); on node \(l\), there should be no data sent from node \(v\) to node \(w\). When \(k_{vlbv}\) represents the amount of data transferred from node \(v\) via node \(l\) to node \(w\), then:  
\[k_{vlw}\leq u_{vlw}\times k_{lw}\quad\forall v,l,w\in N. \tag{17}\]  
For MTE, the route for each node is unique, therefore,  
\[\sum_{l}u_{vlw}=1,\quad\forall v,l,w\in N. \tag{18}\]  
From Equation (7), to a node \(v\), if the energy consumption speed is larger than the energy charging speed, the node will eventually drain out its power and become inactive. To avoid this problem, at any time there should be  
\[E_{rest-v}=E_{mb-v}+\frac{P_{cv}t_{cv}}{A\times d_{cv}^{2}}-E_{v}>0. \tag{19}\]Note that, in a short time span, i.e., from the starting time to any time point \(t\) (\(t<<\infty\)), there may exist \((P_{cv}t_{cv})/(A\times d_{cv}^{2})<E_{v}\) since the battery energy can make up for the difference. However, when \(t_{2}-t_{1}\rightarrow\infty\), there is \((P_{cv}t_{cv})/(A\times d_{cv}^{2})=E_{v}\), which is consistent with Equation (10). When \(E_{rest-v}\) keeps decreasing and tends to 0, the charging power \(P_{cv}\) should be increased, or the charging time \(t_{cv}\) should be lengthened, so as to ensure constraint Equation (19) always holds. At the same time, increasing the charging power or charging time will bring a heavier burden to the wireless chargers.