## 3 Problem Formulation and Proposed Solution
### Problem Solution  
We utilize the Hungarian method, which is a combinatorial optimization algorithm, to solve the proposed bipartite graph assignment problems in this work with \(K\) RF chains at each AP and \(\mathcal{Z}_{m}=[\mathcal{Z}_{1,m},\mathcal{Z}_{2,m},\ldots,\mathcal{Z}_{K,m}]\). The reason behind assuming the length of \(\mathcal{Z}_{m}\) equals the number of RF chains at each AP is to obtain a square matrix for the reward matrix \(\mathcal{R}\) in order to make the assignment operation less complicated for the proposed Hungarian algorithm. Algorithm 1 summarises the whole procedure of the proposed antenna selection matching strategy. This algorithm maximizes the EE for uplink cell-free mm-Wave massive MIMO systems. The first three steps are utilized to generate \(\tilde{W}_{m}\) based on Equation (13) for each AP. Then, all connections between \(N_{r}\) and the RF chains are in the inactive state, and antenna indices are sorted in ascending order based on the smallest channel magnitude for each AP, and symbolized as \(\tilde{J}_{m}=[\tilde{J}_{1,m},\tilde{J}_{2,m},\ldots,\tilde{J}_{K,m}]\). Thus, each RF chain has several values of \(\mathrm{SE}_{m}\) based on \(\mathcal{Z}_{m}\). Therefore, reward matrix \(\mathcal{R}\) describes the problem formulated in (19), and it can be solved based on the steps of the Hungarian algorithm mentioned in Algorithm 1. The Hungarian algorithm is used to arrange the reward matrix \(\mathcal{R}\) in order to maximize weight matching. Moreover, as shown in Figure 2, the suggested algorithm's high-level diagram begins by assigning to each RF chain randomly a \(\mathcal{Z}_{k,m}\) from the set \(\mathcal{Z}_{m}\). Then, the Hungarian algorithm starts by reducing each row in the input reward matrix, which consists of the computed \(R_{k,m}\) with all elements of the set \(\mathcal{Z}_{m}\), by subtracting the minimum item in each row from all other items in the same row, and repeating the process for each column. Accordingly, we look for the convenient \(\mathcal{Z}_{k,m}\) switches for each RF chain. If \(k_{th}\) RF chain is already assigned to \(\mathcal{Z}_{k,m}\) switches, it is better to be assigned with another  
Figure 2: Proposed matching strategy for RF chain-subset selected antennas for each AP diagram with flowchart of the Hungarian algorithm. \(\mathcal{Z}_{k,m}\); we prime the alternative before moving on to the next \(\mathcal{Z}_{k,m}\) candidate switches; however, if that is the only \(\mathcal{Z}_{k,m}\) switches for which \(k_{th}\) RF chain is qualified, we would like to reassign any other RF chain to those \(\mathcal{Z}_{k,m}\) switches. We reassign RF chains to their alternate selected antennas to guarantee the assignment can provide the maximum spectral efficiency for each AP, which is the resolvability test. As a result, we can be confident that we progress toward our goal of identifying the best assignment with each iteration. Finally, because our proposed algorithm does not require a high number of iterations to reach the maximum total SE, especially when there exists a large number of both APs and/or \(N_{r}\) equipped for each AP, this proposed technique employing a matching strategy has much lower complexity compared to the state-of-the-are schemes, as presented in Section 6. ```
Input:\(N_{Q}\), \(\rho\), \(\hat{H}_{m}\), \(\sigma^{2}\) for\(m=1\to M\)do for\(k=1\to K\)do - Use QR decomposition to obtain \(\hat{H}_{m}\) based on \(\hat{H}_{m}\). - Quantize the phase \(\theta_{k,m}\) of each element of \(\hat{H}_{m}\) to \(\hat{\theta}_{k,m}\) based on (13). - Generate the analog combining \(\hat{W}_{m}\) based on (15). end - Initialize \(S_{m}=[s_{1,m},s_{2,m},\ldots,s_{K,m}]\) as \(0_{N_{r}\times K}\). - Then, \(J_{m}=[j_{1,m},\ldots,j_{K,m}]\) where \(j_{k,m}=[1,\ldots,N_{r}]^{T}\). for\(k=1\to K\)do - Sort the elements of \(j_{k,m}\) in ascending order of \(|[\hat{H}_{m}]_{n,k}|\) to find \(\tilde{j}_{k,m}\), where \(n=1,\ldots,N_{r}\). end - Initialize \(\mathcal{Z}_{m}=\{\mathcal{Z}_{1,m},\mathcal{Z}_{2,m},\ldots,\mathcal{Z}_{K,m}\}\).