## 2 Distributed Fair Rate Allocation Algorithm
### Proposed Algorithm
#### 2.4.4 Dual Projection  
The dual projection is the last step of the method and its mission is to update \(\mathbf{\mu}\) having the information in \(\hat{\mathbf{\lambda}}^{k}\). We already know that one of the optimality conditions of our problem is Equation (10). However, this linear system of equations is in general overdetermined and we can not use it to guess \(\mathbf{\mu}^{k+1}\) from \(\hat{\mathbf{\lambda}}^{k}\). Fortunately, it is possible to choose some of the entries in \(\hat{\mathbf{\lambda}}^{k}\) to obtain an alternative system of equations, say \(\mathbf{\lambda}_{D}^{k}=\mathbf{B}_{D}^{k}\mathbf{\mu}_{D}^{k+1}\), that determines the non-zero values in \(\mathbf{\mu}^{k+1}\). Note that due to Equation (11), \(\mu_{j}^{k+1}\)  
Figure 3: Distributed primal projection. Initially, nodes 2, 3 and 4 are grouped together into the supernode 2’. The first allocation distributes \(c_{1}\) between 1 and 2’. Then, the second allocation distributes the rate granted to 2’ among nodes 2, 3 and 4 taking into account the maximum rate \(c_{2}\). is necessarily \(0\) if the corrected allocation after the primal projection verifies \([\mathbf{A}]_{j}\hat{\mathbf{y}}^{k}-c_{j}<0\). In the following, we describe how \(\mathbf{\lambda}_{D}^{k}\) and \(\mathbf{B}_{D}^{k}\) are constructed. First of all, let us define the subsets of nodes \(\mathcal{I}_{m}\) and \(\mathcal{A}_{n}^{k}\). The subset \(\mathcal{I}_{m}\) does not depend on the iteration number and includes all the nodes using the m-th wireless channel except for the parent node. On the contrary, \(\mathcal{A}_{n}^{k}\) depends on the subset of active constraints [32] in the network, which evolves on time. Specifically, if the n-th channel is congested, the subset \(\mathcal{A}_{n}^{k}\) is the union of \(\mathcal{I}_{n}\) with all the subsets \(\mathcal{I}_{m}\) that accomplish: (i) the path from any of the nodes in \(\mathcal{I}_{m}\) to the sink goes through one of the nodes in \(\mathcal{I}_{n}\) and (ii) none of these paths makes use a congested channel, that is, the channels in the path do not attain their rate constraints with equality. If the n-th channel is not congested, we do not define \(\mathcal{A}_{n}^{k}\). A simple example can be found in Figure 4, where \(\mathcal{I}_{1}=\{1,2,3\}\), \(\mathcal{I}_{2}=\{4,5,6\}\) and \(\mathcal{I}_{3}=\{7,8,9\}\). In this example, we transmit at the maximum possible rate only in channels 1 and 3 whereas channel 2 is not congested. Therefore, we define \(\mathcal{A}_{1}^{k}=\mathcal{I}_{1}\cup\mathcal{I}_{2}\) and \(\mathcal{A}_{3}^{k}=\mathcal{I}_{3}\) but not \(\mathcal{A}_{2}\). Once the subsets \(\{\mathcal{A}_{n}^{k}\}\) are identified, we select one sensor from each group using the following selection rules:  
1. Choose the node with the value of \(\hat{\lambda_{j}}^{k}\) that is closest to \(\lambda_{j}^{k}\) (note that \(\lambda_{j}^{k}=\lambda_{i}^{k}\) if \(i,j\in\mathcal{A}_{n}^{k}\)) and that verifies (SR2). 2. The corresponding value in \(\hat{y}_{j}^{k}\) attains \(\hat{y}_{j}^{k}\in(m_{j},M_{j})\) (as shown in Proposition 3, there is at least one value of \(\hat{y}_{j}^{k}\) inside the interval). (SR1) forces the smallest update from \(\lambda_{j}^{k}\) to \(\lambda_{j}^{k+1}\) whereas (SR2) is necessary to have the required linear dependance between \(\mathbf{\lambda}\) and \(\mathbf{\mu}\); otherwise there exist more dual variables that come into the equation as shown in Section 2.8. Finally, the linear system of equations \(\mathbf{\lambda}_{D}^{k}=\mathbf{B}_{D}^{k}\mathbf{\mu}_{D}^{k+1}\) is constructed by gathering all the selected values of \(\hat{\mathbf{\lambda}}^{k}\) in \(\mathbf{\lambda}_{D}^{k}\) and the corresponding rows of \(\mathbf{A}^{T}\) in \(\mathbf{B}_{D}^{k}\). Note that since \(\mathbf{\mu}_{D}^{k+1}\) does not include the values of \(\mathbf{\mu}^{k+1}\) that are known to be zero beforehand, it is necessary to discard the corresponding rows of \(\mathbf{A}^{T}\) when building \(\mathbf{B}_{D}^{k}\).