# Improved Branch-and-Bound Antenna Selection Algorithm for Massive MIMO
## 3 Efficient Antenna Selection via Enhanced Branch-and-Bound Optimization
### Branch-and-Bound Antenna Selection
```
1:Initialize : Set \(S=\{1,2,\cdots,\,N_{r}\}\), \(F=S\), \(l=0\), \(n=\mid S\mid\), \(C_{current}=\log_{2}\det\Bigl{(}\mathbf{I}_{N_{r}}+\frac{\rho}{N_{r}}\mathbf{H }^{\text{H}}\mathbf{H}\Bigr{)}\), \(C_{opt,\,d}=-\infty\), \(S_{opt,\,d}=S\), \(\forall d\in[MIN,\,MAX]\). Create root node \(S,\,F\), \(C_{current},\,t=n,\,l\). Push root node into stack. ```
**Algorithm 2**I-BAB algorithm for multi-cardinality antenna selection
```
2:while stack is not empty: current-node = Pop the top node from stack. for\(i=MAX\) to \(MIN\)do if current-node.\(C_{current}>C_{opt,\ i}\), then \(d=i\), break endif endfor if\(d\geq MIN\) and \(\leq MAX\), then if\(|\)current-node.\(S|=d\), then \(C_{opt,\ d}=\) current-node.\(C_{current},\ S_{opt,\ d}=\) current-node.\(S\). else, \(m\)= current-node.\(t-(n-d-\text{current-node. }l-1)\) if\(m>0\), then  For each \(k\in\) current-node.\(F\) calculate \(\Delta_{k_{l+1},\ l+1}=\log_{2}\Bigl{(}1+\frac{\rho}{N_{t}}\alpha_{k_{l+1},\ l+1} \Bigr{)}\), sorting \(\Delta_{k_{l+1},\ l+1}\) in ascending order, the top-\(m\ \Delta_{j}\ \ (j=1,\ 2,\ \cdots,\ m)\) with minimal values are selected, i.e., \(\Delta_{1}<\Delta_{2}<\cdots<\Delta_{m}\), then we can get an ordered index vector \(J\). for\(i=m\) to \(1\), do  Create child nodes child-node\({}_{i}<S_{child,\ i}\), \(C_{current,\ i}\), \(F_{i}\), \(I_{i}\), \(t_{i}\)>,  where \(S_{child,\ i}\)= current-node.\(S\backslash[J]_{i}\), \(C_{current,\ i}=\log_{2}\det\Bigl{(}\mathbf{I}_{N_{t}}+\frac{\rho}{N_{t}} \mathbf{H}_{child,\ i}^{H}\mathbf{H}_{child,\ i}\Bigr{)}\), \(\mathbf{H}_{child,\ i}\)\(\mathbb{C}^{|S_{child,\ i}|\times N_{t}}\) denotes the channel submatrix constituted by the receive antennas corresponding to \(S_{child,\ i}\) and transmit antennas), \(F_{i}\)= current-node.\(F\backslash\{\{\boldsymbol{I}\}_{m},\ \cdots,\ [J]_{i}\}\), \(l_{i}\)= current-node.\(l+1\), \(t_{i}\)= current-node.\(t-i\). Push the child node into stack. endfor endif endif endwhile
```

**Algorithm 2**_Cont._

Regarding the two limitations identified in the BAB algorithm in Section 3.3, the proposed I-BAB algorithm demonstrates significant improvements. For question 1, we first employ the Last-In-First-Out (Last-In-First-Out, LIFO) property of a stack to implement Depth-First Search (DFS). The critical operation involves a preprocessing step where child nodes are reverse sorted based on their reduction value \(\Delta_{j}\ (j=1,\ 2,\ \cdots,\ m)\) before being pushed onto the stack. Why does reverse push operation enhance pruning efficiency? Without implementing reverse stacking, child nodes are sequentially pushed into the stack as \(S_{child,\ 1}\), \(S_{child,\ 2}\), \(\cdots\), \(S_{child,\ m}\). According to the Last-In-First-Out (LIFO) principle of stack structures, this configuration prioritizes access to child node \(S_{child,\ m}\) (the child node inducing the maximum reduction) while deferring access to \(S_{child,\ 1}\) (the child node yielding the minimum reduction) until the final traversal stages. In other words, \(S_{child,\ 1}\) retains the antenna contributing most significantly to channel capacity. After reversing the stack sequence, child nodes are pushed into the stack sequentially follow ing \(S_{child,\ m},\ S_{child,\ m-1},\ \cdots,\ S_{child,\ 1}\), with \(S_{child,\ 1}\) being prioritized for the traversal. Since the stack structure inherently implements a depth-first search (DFS), the optimal subset corresponding to current parameter \(d\) and its maximum channel capacity \(C_{opt,\ d}\) can be identified during the exploration of \(S_{child,\ 1}\)'s entire descendant nodes. Subsequent nodes popped from the stack and their offspring will inherently exhibit channel capacity values less than or equal to \(C_{opt,\ d}\) thereby activating the pruning mechanism to eliminate redundant computations. The reverse stacking mechanism inverts the node visitation order, enabling earlier evaluation of critical branches and thereby accelerating unnecessary path elimination during pruning processes.