# Online Distributed User Association for Heterogeneous Radio Access Network
## 4 Algorithm Description
### Probability Scheme  
In this probability scheme, the UE selects a BS in a probabilistic manner upon arrival at the network. Actually, the UE considers two parameters, \(\eta_{i,j,k}\) and \(\lambda_{j,k}\), before associating with a BS \(j\) at tier \(k\). Higher values of \(\eta_{i,j,k}\) and optimal \(\lambda_{j,k}\) yield in higher probability of associating with the BS \(j\). The intuition behind this scheme is that higher \(\eta_{i,j,k}\) from the BS gives a higher data rate, and optimal \(\lambda_{j,k}\) of the BS leads to better down-link speed. The working principle of the probability scheme is easy to describe. The BSs periodically transmit their load parameter. When a new UE \(i\) arrives at the system, it checks for the BSs in range and calculates the \(\eta_{i,j,k}\), and also receives the \(\lambda_{j,k}\) parameter of these BSs.  
Let \(b\) be the set of BSs the UE can associate with. For each BS that satisfies the SINR constraint \(\tau\), the UE \(i\) calculates the following association parameter \(\alpha_{i,j,k}\):  
\[\alpha_{i,j,k}:=fun(\eta_{i,j,k},\lambda_{j,k}) \tag{11}\]  
The value of \(fun(\eta_{i,j,k},\lambda_{j,k})\) for \(\lambda_{jk}^{load1}\) and \(\lambda_{jk}^{load2}\) is given by \(\mathcal{U}\Big{(}\frac{r_{ij,k}}{|N_{ij,k}+1|}\Big{)}\), and \(\mathcal{U}\Big{(}r_{i,j,k}*\frac{\sum R_{ij,k}}{|N_{ij,k}|+1}\Big{)}\), respectively. Note that \(\mathcal{U}(.)\) represents the UE's own utility. After calculating the \(\alpha_{i,j,k}\) for each BS in its range, the UE \(i\) then calculates the probability of association. The probability of association with a BS is given by:  
\[\delta_{i,j,k}=\frac{fun(\eta_{i,j,k},\lambda_{j,k})}{\sum_{j\in b }\sum_{k\in K}fun(\eta_{i,j,k},\lambda_{j,k})},i\in\mathbb{U},j\in\mathbb{B},k\in\mathbb{k}. \tag{12}\]  
The UE now has information regarding the probability of association with each BS. Equipped with this information, the UE then selects one BS in a probabilistic way. Note that the BS having higher \(\alpha_{i,j,k}\) will have a higher probability to be selected. Algorithm 2 depicts the above scheme.  
```
1:Initialize \(\delta_{i,j,k}:=0\), \(i\in\mathbb{U}\), \(j\in\mathbb{B}\), \(k\in\mathbb{K}\)
2:for each UE \(i\) in the network do
3:\(B_{i}:=\{\) set of BSs \(\in\mathbb{B}\mid\eta_{i,j,k}\geq\tau\}\)
4: Calculate \(\alpha_{i,j,k}:=fun(\eta_{i,j,k},\lambda_{j,k})\)
5: Associate UE \(i\) with BS \(j\) of tier \(k\) with probability \(\delta_{i,j,k}\)
6:endfor
```  
**Algorithm 2** Probability scheme  
Each UE executes the Algorithm 2 at their respective end. In Step 1, all the UEs in the network initialize their association probability to 0. Cell selection begins at Step 2 and in Step 3, the UE collects the BS information, which satisfies the SINR threshold. These are the potential BSs the UE can attach to. As the BS broadcasts their load information periodically, the UE is able to calculate \(\alpha_{i,j,k}\) for each BS in \(B_{i}\) (Step 4). The expression \(fun(\eta_{i,j,k},\lambda_{j,k})\), given at Equation (11), is different for \(\lambda_{j,k}^{load1}\) and \(\lambda_{j,k}^{load2}\). The UE associates with a BS in \(B_{i}\) with a probability \(\delta_{i,j,k}\) according to Step 5.