## 2 Distributed Fair Rate Allocation Algorithm
### Proposed Algorithm  
Let us consider the problem formulation in Problem (3) and let us define \(\lambda_{j}\) as the Lagrange multiplier (equivalently, dual variable) associated with the constraint \(r_{j}\leq y_{j}\) for all \(j\). As in dual decomposition, we keep \(\mathbf{\mu}=[\mu_{1},\ldots,\mu_{L}]^{T}\) as the multipliers associated with the constraints in \(\mathbf{Ay}\preceq\mathbf{c}\). The technique we propose here intertwines primal and dual decompositions in a single approach and it is composed of four building blocks, namely: (i) dual subproblems; (ii) primal projection; (iii) primal subproblems and (iv) dual projection (see Figure 2). Before going to a more detailed description of the method, let us sketch out the four steps in the Figure 2, that form a complete iteration of the CDM, using a resource-price interpretation. From a practical point of view, this overview together with the contents of Section 2.5 shall suffice to develop our solution in real networks.  
It is usual in convex optimization to think of primal variables as resources and dual variables as the prices to be paid for them. Let us assume that \(\mathbf{\mu}^{k}\) fixes, at time instant \(k\), the cost of transmitting one unit of rate through each of the available multiple-user channels. Note that the more congested the channel, the higher the cost is and that the cost for a non-congested channel is \(0\). Given \(\mathbf{\mu}^{k}\), each sensor obtains \(\lambda_{j}^{k+1}\) as the sum of the prices in the multiple-user channels it uses. When the sensor computes the dual subproblem from \(\lambda_{j}^{k}\), it decides how many resources to buy, _i.e._, \(y_{j}^{k}\), which essentially depends on its own utility function. However, the overall rate acquisition may violate the constraints in the network and it must be corrected. This is the task of the primal projection, that is, it gathers all the values in \(y_{j}^{k}\) and modifies them to \(\hat{y}_{j}^{k}\) in order to satisfy the network constraints. Thereafter, the primal subproblems estimate the price they will pay for the new allocation, _i.e._, \(\hat{\lambda}_{j}^{k}\). Finally, the dual projection looks at all the individual prices and tries to find a new consensus price \(\mathbf{\mu}^{k+1}\). The entire process is repeated until all the sensors agree on the prices of the multiple-access channels.  
Next, we describe one iteration of the method that starts with \(\mathbf{\mu}^{k}\) and ends up with \(\mathbf{\mu}^{k+1}\). Afterwards, we prove in Section 2.8 that \(\mathbf{\mu}^{k}\rightarrow\mathbf{\mu}^{*}\). In the following, a star as in \(\mathbf{y}^{*}\) or \(\mathbf{\mu}^{*}\) indicates optimal values and a superindex \(k\) as in \(\mathbf{y}^{k}\) or \(\mathbf{\mu}^{k}\) indexes iterations. Furthermore, we make use of some of the Karush-Kuhn-Tucker optimality conditions [18] (Section 5.5.3) of Problem (3). These are  
\[\lambda_{j} = [\mathbf{A}^{T}]_{j}\mathbf{\mu} \tag{10}\] \[\mu_{j}([\mathbf{A}]_{j}\mathbf{y}-c_{j}) = 0,\quad j=1,\ldots,L\] (11) \[\mathbf{\mu}\succeq\mathbf{0} \tag{12}\]  
where \([\mathbf{A}^{T}]_{j}\) is the j-th row of \(\mathbf{A}^{T}\). Note that Equation (11) are the slackness conditions [18] (Section 5.5.2) related to the constraints \(\mathbf{A}\mathbf{y}\preceq\mathbf{c}\) in Problem (3).