# User-Centric Cell-Free Massive MIMO with Low-Resolution ADCs for Massive Access
## 4 AP-UE Association Algorithm
\(\mathcal{L}_{UE}\) represents the index list of UEs, and the connections between APs and UEs are established sequentially based on the \(\mathcal{L}_{UE}\). UE \(k\in\left\{1,\ldots,K\right\}\) is connected to the AP in \(\mathcal{C}_{k}\) with the highest LSFC. \[l=\arg\max_{j\in\mathcal{C}_{k}}\beta_{kj} \tag{36}\]  
If \(|\mathcal{A}_{l}|<\tau_{p}\), UE \(k\) takes AP \(l\) as its serving AP by \(\mathcal{M}_{k}\cup\left\{l\right\}\), and repeats Step 2 to seek for more APs. Step 3. If the number of UEs supported by AP \(l\) exceeds \(\tau_{p}\), \(|\mathcal{A}_{l}|>\tau_{p}\), the LSFCs of the UEs supported by AP \(l\) are compared. At this point, the UEs that have selected AP \(l\) as the master AP are excluded from the comparison. The connection of the UE with the smallest LSFC among the compared UEs is terminated, and this UE is included in its \(\mathcal{E}_{k}\) by AP \(l\). \[k^{{}^{\prime}}=\arg\min_{i\in\mathcal{A}_{l}\setminus\mathcal{A}_{l}^{M}} \beta_{il} \tag{37}\]  
Step 4. The above process repeats for all UEs until \(\mathcal{C}_{k}=\emptyset\). The pseudocode of this algorithm is given in Algorithm 1. ```
1 Input:\(\{\beta_{kl}\}\), \(\{\mathcal{L}_{UE}\}\),\(\{\mathcal{L}_{OV}\}\), \(\{\mathcal{E}_{k}\}\),\(\{\mathcal{M}_{k}\}\), \(\{\mathcal{A}_{l}\}\), \(\{\mathcal{A}_{l}^{M}\},L,K\leq L\times\tau_{p}\)
2 Output:\(\{\mathcal{M}_{k}\}\)
3 Initialization:\(\{\mathcal{L}_{OV}\}\),\(\{\mathcal{E}_{k}\}\), \(\{\mathcal{M}_{k}\}\), \(\{\mathcal{A}_{l}\}\),\(\{\mathcal{A}_{l}^{M}\}=\emptyset\),\(\mathcal{L}_{UE}=\{1,\ldots,K\}\), \(k\gets 1\)while\(k<K+1\)do
4\(l_{m}=\arg\max_{l\in\{1,\ldots,L\}}(\beta_{kl})\)\(\triangleright\) The process of selecting the master AP
5\(\mathcal{M}_{k}\leftarrow\mathcal{M}_{k}\cup\{l_{m}\}\), \(\mathcal{A}_{l_{m}}\leftarrow\mathcal{A}_{l_{m}}\cup\{k\}\)
6 if\(|\mathcal{A}_{l_{m}}|>\tau_{p}\)then
7\(\mathcal{L}_{OV}\leftarrow\mathcal{L}_{OV}\cup\{l_{m}\}\)
8
9 end if
10\(k\gets k+1\)
11
12 end while
13 while\(\mathcal{L}_{OV}\
eq\emptyset\)do
14\(l^{\prime}=\mathcal{L}_{OV}(1)\)\(\triangleright\) The process of re-selecting the master AP
15\(k^{\prime}=\arg\min_{k\in\mathcal{A}_{l^{\prime}}}\beta_{kl^{\prime}}\)
16\(\mathcal{A}_{l^{\prime}}\leftarrow\mathcal{A}_{l^{\prime}}\setminus\left\{k^ {\prime}\right\}\), \(\mathcal{A}_{l^{\prime}}^{M}\leftarrow\mathcal{A}_{l^{\prime}}^{M}\setminus \left\{k^{\prime}\right\}\), \(\mathcal{M}_{k}\leftarrow\mathcal{M}_{k}\setminus\left\{l^{\prime}\right\}\)
17\(\mathcal{E}_{k^{\prime}}\leftarrow\mathcal{E}_{k^{\prime}}\cup\left\{l^{ \prime}\right\}\)
18 if\(|\mathcal{A}_{l^{\prime}}|\leq\tau_{p}\)then
19\(\mathcal{L}_{OV}\leftarrow\mathcal{L}_{OV}\setminus\left\{l^{\prime}\right\}\)
20
21 end if
22
23 end while
24 while\(\mathcal{L}_{UE}\
eq\emptyset\)do
25\(k=\mathcal{L}_{UE}(1)\)\(\triangleright\) The process of connecting an additional AP
26 repeat
27\(\mathcal{C}_{k}=\{1,\ldots,L\}\setminus\{\mathcal{E}_{k}\cup\mathcal{M}_{k} \cup\mathcal{A}_{k}^{M}\}\)
28 if\(\mathcal{C}_{k}=\emptyset\)then
29 break;
30
31 end if
32 else
33\(l=\arg\max_{i\in\mathcal{C}_{k}}\beta_{k,i}\)
34\(\mathcal{M}_{k}\leftarrow\mathcal{M}_{k}\cup\{l\}\),\(\mathcal{A}_{l}\leftarrow\mathcal{A}_{l}\cup\{k\}\)
35 if\(|\mathcal{A}_{l}|>\tau_{p}\)then
36\(k^{\prime}=\arg\min_{k\in\mathcal{A}_{l}\setminus\mathcal{A}_{l}^{M}}\beta_{kl}\)
37\(\mathcal{A}_{l}\leftarrow\mathcal{A}_{l}\setminus\left\{k^{\prime}\right\}\),\(\mathcal{M}_{k^{\prime}}\leftarrow\mathcal{M}_{k^{\prime}}\setminus\{l\}\),\(\mathcal{E}_{k^{\prime}}\cup\{l\}\)
38
39 end if
40
41 end while
42 untilbreak;
43\(\mathcal{L}_{UE}\leftarrow\mathcal{L}_{UE}\setminus\{k\}\)
44 end while
45
46 end while
47
48 end while
49
50 end while
510
52 end while
53
54 end while
55 Return:\(\mathcal{L}_{UE}\leftarrow\mathcal{L}_{UE}\setminus\{k\}\)
```  
**Algorithm 1**Proposed AP-UE association algorithm