# A Comparative Analysis of Wi-Fi Offloading and Cooperation in Small-Cell Network
## 4 Comparison between Cooperation and Wi-Fi Offloading in Small-Cell Network
### Offloading in Co-Located Wi-Fi-Small-Cell BS  
In this subsection, we will formulate a problem of sum-rate maximization by using Wi-Fi offloading in small cellular network and propose a heuristic to solve it by associating a user to SBSs on LTE, offload it to unlicensed band to meet its data rate demand and allocating power. ```
1:Input:\(h_{ij},R_{j}^{th},P_{i}^{max},RB_{total}\)
2:Output:\(R_{j}^{c},x_{ij^{\prime}}^{k},p_{i}^{k}\)
3:\(i^{\prime}\subseteq F_{j}\leftarrow\operatorname*{argmax}_{\mathrm{i}}\{h_{i,j }\}\text{first priority}\quad\forall j\)
4:\(x_{i^{\prime},j}^{k}=1\) without repetition of \(\mathrm{K}^{\prime}\mathrm{s}\quad\forall j\)
5:\(p_{i^{\prime},j}^{k}=(P_{i}^{max}-\Delta_{i^{\prime}})/N_{i}^{\prime}\quad \forall i^{\prime}\in I\)
6:Calculate \(R_{j}\;\forall j\)
7:while\(RB_{i}<RB_{total}\)do
8:for all users do
9:if\(R_{j}\;<\;R_{j}^{th}\;OR\;RB_{i}<RB_{total}\)then
10: For All SBSs **Check** if \(i^{\prime\prime}==SBS\)
11: where \(i^{\prime\prime}\subseteq F_{j}\leftarrow\operatorname*{argmax}_{\mathrm{i} \in I^{\prime}}\{h_{i,j}\}\)
12:if\(RB_{i^{\prime}}\;\leq\;RB_{total}\)then
13:\(x_{i^{\prime},j}^{k}=1,\;\text{increment values of }M_{j},N_{i^{\prime}},RB_{i^{\prime}}\)
14:elseif\(\Delta h\{i^{\prime},i^{\prime\prime}\}<v_{th}\)and\(RB_{i^{\prime}}^{\prime\prime}<RB_{total}\)then
15:\(x_{i^{\prime},j}^{k}=1,\;\text{increment values of}M_{j},N_{i^{\prime\prime}},RB_{i^{\prime \prime}}\)
16:elseif Available power of \(\mathrm{i}^{\prime}>0\)then
17:\(p_{i^{\prime},j}^{k}=\Delta_{i}/2\)
18:endif
19: Update powers allocation
20: Calculate \(R_{j}\)
21:else
22: For All SBSs and RBs **Check** its associations
23:while\(R_{j}>R_{j}^{th}\)do
24:\(\Delta_{i}=\Delta_{i}+\text{extra power allocated to user j}\)
25:endwhile
26:endif
27:endfor
28:endwhile
29: Overall Rate is \(\sum_{j}R_{j}^{c}\)
```  
**Algorithm 1** Sequential Cooperative Rate Enhancement (SCRE)  
In co-located Wi-Fi-SC network, we formulate the problem as a sum-rate maximization problem as done for cooperative SC network. In this case, the constraints of QoS, maximum Wi-Fi leftover capacity, maximum association limit and maximum power are ensured. For a fair analysis of cooperation and Wi-Fi offloading, this problem is formulated for a time frame \(T\) to be solved by a central controller. The central controller directs to associate UE to a single SBS, allocate RBs, offload on Wi-Fi for partial satisfaction of data rate of a user and assigns power. We use single variable for SBS LTE association and RB allocation \(y_{ij}^{k}\), single variable for SBS LTE-U association \(z_{ij}\), \(R_{ij}^{U}\) for leftover data rate allocation and \(P_{ij}^{k}\) is the power allocation variable. The problem is formulated as:\[\max_{\mathbf{v},\mathbf{Z},\mathbf{P},R_{ij}^{U}} \sum_{j\in I}(\sum_{i\in I}\sum_{k\in K}y_{ij}^{k}R_{ij}^{LTE,k}+ \sum_{i\in I_{j}}z_{ij}R_{ij}^{U}),\] (15) subject to \[\sum_{j\in I}z_{ij}R_{ij}^{U}\leq(R_{A_{P_{i}}}-\sum_{w\in W}r_{i }^{w})\quad\forall i\in I_{j}, \tag{16a}\] \[R_{j}^{LTE}+R_{j}^{U}\geq R_{ij}^{U}\quad\forall j\in J,\] (16b) \[\sum_{i\in I}y_{ij}^{k}\leq 1\quad\forall j\in J,k\in K,\] (16c) \[\sum_{i\in I_{j}}z_{ij}\leq 1\quad\forall j\in J,\] (16d) \[\sum_{j\in J}\sum_{k\in K}x_{ij}^{k}P_{ij}^{k}\leq P_{max}\quad \forall i\in I. \tag{16e}\]  
As already discussed, our objective function as given in (15) is to maximize achievable rate over all SC UEs. Here a UE is served using additional Wi-Fi capacity from a SC on LTE-U band, therefore, data rate maximization is achieved over both licensed and unlicensed band. Constraint (16a) is the Wi-Fi rate assignment constraint [32]. It ensures that sum achievable data rate of all the cellular UEs on LTE-U band should be less than total leftover capacity \(L_{i}\) of the Wi-Fi AP which is co-located with the SBS. All the UEs are candidates to offload which have SBS \(i\) in their specific Wi-Fi range and these selected SBSs are in set \(I_{j}\) for each of the \(j^{th}\) UE.