has the minimum weight maximizing the minimum average sum energy after removal. The algorithm begins with a fully connected graph and stops when all beamform to exactly $L$ . Hence, note that $M(K-L)$ iterations are needed to select the sets $\mathcal{K}_m$ for $m\in\{1,\ldots,M\}$.

Small-scale training phase {#subsec:small-scale-training}
--------------------------

Communication in any coherence interval of a -based massive system invariably starts with the sending the pilot sequences to allow the channel to be estimated at the . Let $\tau_p$ denote the training phase duration (measured in samples on a time-frequency grid) per coherence interval. During the training phase, all $K$ simultaneously transmit pilot sequences of $\tau_p$ samples to the and thus, the $L_A \times \tau_p$ received signal matrix at the $m$th is given by $${{\boldsymbol}{Y}_p}_m=\sqrt{\tau_p P_p}\sum_{k'=1}^K {\boldsymbol}{g}_{mk'} {\boldsymbol}{\varphi}_{k'}^T+{{\boldsymbol}{N}_p}_m,$$ where $P_p$ is the transmit power of each pilot symbol, ${\boldsymbol}{\varphi}_k$ denotes the $\tau_p\times 1$ training sequence assigned to $k$, with $\|{\boldsymbol}{\varphi}_k\|_F^2=1$, and ${{\boldsymbol}{N}_p}_m$ is an $L_A\times\tau_p$ matrix of i.i.d. additive noise samples with each entry distributed as[^3] $\mathcal{CN}(0,\sigma_u^2(N))$. Ideally, training sequences should be chosen to be mutually orthogonal, however, since in most practical scenarios it holds that $K>\tau_p$, a given training sequence is assigned to more than one , thus resulting in 