# Discrete Data Rate Adaptation for Wireless Body Area Networks
## 3 Optimization Problem Model  
This section develops the optimization problem model for deciding on content adaptation. The network structure of WBANs can be described as a graph \(G(V,E)\), where \(V\) denotes the nodes within the network and the edges \(E\) represent the wireless connection between two nodes. The number of nodes and edges are denoted by \(n\) and \(e\), respectively (\(n=|V|\), \(e=|E|\)). The network may consist of nodes of various types. Most of them are sensor nodes that generate and forward data streams. Let \(S\) denote the subset of the vertices consisting of sensor nodes. The number of sensor nodes is denoted by \(n_{s}\) (\(n_{s}=|S|\)). The sink nodes represent the target nodes of streaming, which may also belong to the sensor nodes. The network may include relay nodes as well, which only forward the data. Two nodes are connected by an edge if they are within each other's communication range. Each edge \(e_{ij}\) and node \(v_{i}\) may have a capacity \(C_{ij}\) and \(C_{i}\), respectively, which represent the maximum amount of traffic that could pass through them. The capacity at the sink is denoted by \(C_{s}\), which can be considered as an upper bound for all capacities in the network. The data rate adaptation follows the routing phase. Let the set of the edges of the routing tree be denoted by \(E_{r}\), which is a subset of \(E\). The routing tree consists of edges used for data transmission; therefore, it is enough to check capacity constraints only on the edges in \(E_{r}\). The routing tree consists of the same nodes as the network graph. Therefore, the routing tree can be denoted by \(G_{r}(V,E_{r})\). Let \(P_{i}\) and \(Q_{ij}\) denote the set of nodes whose routing path to the sink passes through node \(\mathrm{n_{i}}\) and edge \(e_{ij}\), respectively. These sets can be easily determined based on the routing tree \(G_{r}\). Let \(R_{i}\) denote the unique route from node \(v_{i}\) to the sink in the routing tree, which can be determined in linear time in the length of the route from routing tree \(G_{r}\). Let \(l_{lrec}\) denote the maximum of the route lengths. The total number of variants is denoted by \(n_{v}\). Let \(D_{i}\) represent the set of the variations of specific data generated in the network node \(v_{i}\in S\) with respect to the sensor capabilities (see Figure 2). \(l_{i}\) denotes the number of possible data variations at node \(v_{i}\) (\(l_{i}=|D_{i}|\)). Let \(max_{v}\) denote the maximum number of variants for the nodes, i.e., the maximum of \(l_{i}\). Let \(r(d_{ik})\) denote the required data rate of a data variation (\(d_{ik}\in D_{i}\), \(v_{i}\in S\), \(1\leq k\leq l_{i}\)). Furthermore, we suppose that the utilities of the data variations are given. The utility is denoted by \(u(d_{ik})\) for the data variation \(d_{ik}\). The data variations with zero utility and the ones which do not provide a further increase in the utility can be omitted. We introduce \(d_{i0}\) for each \(v_{i}\in S\) to denote the case when the data stream is stopped. This special variation neither requires resources nor has utility (\(u(d_{i0})=0\), \(r(d_{i0})=0\)). We aim to select a data variation (\(d_{i}\)) for each sensor to maximize the total utility (\(\sum\limits_{v_{i}\in S}u(d_{i})\)) under the constraints. The data variation is selected from the ones the sensor can generate. In addition, \(d_{i}\) can be 0 as well if streaming from the sensor should stall. The capacity constraints must be fulfilled both on the network edges and the nodes. Input:  
* The routing tree: \(G_{r}(V,E_{r})\);
* The set of possible data variations for each sensor node: \(D_{i}\) for \(v_{i}\in S\);
* Utility for each data variation: \(u(d_{ik})\) for \(v_{i}\in S\), \(1\leq k\leq l_{i}\);
* Bit rate for each data variation: \(r(d_{ik})\) for \(v_{i}\in S\), \(1\leq k\leq l_{i}\);
* Bandwidth of each edge: \(C_{ij}\) for \(e_{ij}\in E_{r}\);
* Limit on the bit rate for each node: \(C_{i}\) for \(v_{i}\in V\).