# Green Small Cell Operation of Ultra-Dense Networks Using Device Assistance +
## 4 Online Algorithm: DANCE
### DANCE Algorithms  
DANCE solves the same problem given in (3) to (6). By using matrix-based algorithms, DANCE determines the turned-on/off APs and the user association together. Once the target AP is chosen, then the association is automatically decided on the matrix \(\mathcal{A}\), so that the result of user association is shown on the matrix \(\mathcal{S}\). DANCE includes three algorithms: AP-first, UE-first and the proximity-ON (Prox-ON) algorithm.  
In DANCE algorithms, two main algorithms, AP-first and UE-first, are designed to choose the most influential AP or UE, respectively. Depending on the type of feedback, both AP-first and UE-first have several variations: AP-N/AP-1 and UE-N/UE-1, where the number implies the length of the feedback bits. Following the categorization, AP-first and UE-first are described in Algorithms 1 and 2, respectively.  
\begin{table}
\begin{tabular}{c c c c} \hline \hline
**1-bit Feedback (\(\mathcal{A}^{(1)}\))** & \multicolumn{2}{c}{\(N\)**-bit Feedback (\(\mathcal{A}^{(N)}\))**} & \multicolumn{2}{c}{**Association Matrix (S)**} \\ \hline \(\mathcal{A}^{(1)}=\begin{bmatrix}0&0&1&\cdots&0\\ 0&1&1&\cdots&0\\ 1&1&0&\cdots&0\\ \vdots&\vdots&\vdots&\ddots&\vdots\\ 0&0&1&\cdots&1\end{bmatrix}\) & \(\mathcal{A}^{(N)}=\begin{bmatrix}0&0&3&\cdots&0\\ 0&2&4&\cdots&0\\ 3&5&0&\cdots&0\\ \vdots&\vdots&\vdots&\ddots&\vdots\\ 0&0&2&\cdots&2\end{bmatrix}\) & \(S=\begin{bmatrix}0&0&1&\cdots&0\\ 0&0&1&\cdots&0\\ 0&1&0&\cdots&0\\ \vdots&\vdots&\vdots&\ddots&\vdots\\ 0&0&0&\cdots&1\end{bmatrix}\) \\ \hline \hline \end{tabular}
\end{table}
Table 1: Examples of matrices \(\mathcal{A}^{(1)},\mathcal{A}^{(N)}\) and \(S\).  
```
1:Initialize \(s_{i,j}=0\), \(\forall i\in I\), \(\forall j\in J\).
2:while\(\mathcal{A}\
eq\varnothing\)
3:\(i^{*}=\operatorname*{argmax}_{i}\sum_{i}a_{i,j}\).
4:for all\(i\in I\)
5:if\(a_{i,j^{*}}>0\), then \(s_{i,j^{*}}=1\),
6:else\(s_{i,j^{*}}=0\).
7:endfor
8: Eliminate the column \(j^{*}\) of \(\mathcal{A}\).
9: Eliminate \(i^{\prime}\) rows of \(\mathcal{A}\) where \(i^{\prime}\in\{i|a_{i,j^{*}}>0\}\).
10:endwhile
```  
**Algorithm 2** UE-first  
The algorithm works as follows. AP-first algorithms, AP-1 or AP-N, firstly choose an AP on the matrix \(\mathcal{A}\) as previously mentioned. AP-1 algorithm chooses the AP that has the greatest number of association-possible UEs. The AP-N algorithm otherwise chooses the AP that has the greatest sum of the maximum achievable data rate or the AMC of each UE depending on whether \(a_{i,j}\) stands for the data rate or AMC levels. Then, the chosen AP is turned on, and all UEs having connectivity with the chosen AP are associated with the chosen AP. This is repeated until all UEs are associated.  
As a counterpart, UE-first algorithms, UE-1 and UE-N, consider UEs foremost. For example, in the UE-1 algorithm, we firstly find the UE having the smallest number of association-possible APs, i.e., potentially the worst case UE is considered first. Then, among the APs that can connect to the chosen UE, we select the \(\text{AP}\ j^{*}=\operatorname*{argmax}_{j}\sum_{i}a_{i,j}\) where \(\forall j\in\{j^{\prime}|a_{i^{\prime},j^{*}}>0\}\) in order to minimize the number of turned-on APs. Note that UE-first is a generalization of [28] where only a single bit feedback was assumed.  
The other is the proximity-ON algorithm. In this algorithm, each UE associates with the AP that provides the highest SINR, while non-selected APs are turned off. It can be seen as a basic heuristic algorithm in order to determine the set of the turned-off APs. Therefore, among DANCE algorithms, the results of the proximity-ON algorithm can provide baselines to measure performance gains of AP-first and UE-first, respectively.