# Low-Power Beam-Switching Technique for Power-Efficient Collaborative IoT Edge Devices
## 3 Proposed Algorithm  
To conduct the beam alignment toward \(\varphi=\varphi_{0}\) efficiently, the combinatorial optimization problem constrained with the predefined threshold SNR \(\zeta\), SNR improvement \(\
u\), and iterations \(\rho\) is introduced, and it is formulated as follows,  
\[\mathbf{\Theta}_{M}^{opt}=\arg\max F\big{(}\mathbf{\Theta}_{M}^{t}\big{)}, \tag{4}\]  
where \(\mathbf{\Theta}_{M}^{t}=\big{[}\Theta_{1}^{t},\cdots,\Theta_{M}^{t}\big{]}\) is the state vector, and the superscript \(t\) denotes the current state. To obtain the global optimum of (4), an exhaustive search can be used. However, it imposes the high complexity of \(\mathcal{O}\big{(}N_{t}^{M}\big{)}\). Thus, the GS, a traditional heuristic search, is utilized to efficiently approach the solution of (4). As the GS basically depends on the greedy transition from the worse state \(\mathbf{\Theta}_{M}^{t-1}\) to the better state \(\mathbf{\Theta}_{M}^{t}\), and the probabilistic transition is not allowed for \(\Delta F=F\big{(}\mathbf{\Theta}_{M}^{t}\big{)}-F\big{(}\mathbf{\Theta}_{M}^{t-1} \big{)}\leq 0\), it cannot guarantee that it will reach the global optimum. However, our goal is to achieve the predetermined SNR improvement using limited computing resources. Thus, the GS is recommended as the core of the proposed algorithm [61]. The specific description is given as follows.  
**Step 1: Initialization.**: As the first step of the algorithm, one of the active sensors, \(s\), sets the control parameters of the algorithm, \(\zeta\), \(\
u\), and \(\rho\) as the default values. These values are important to balance between SNR improvement and system complexity.
**Step 2: Broadcasting.**: \(s\) broadcasts a _switching message_ to alert the following beam-switching event to the neighbor sensors.  
Figure 6: (**a**) The received SNRs. Here, the difference between the terms of “ideal” and “practical” is whether \(\forall m\in\mathbb{M}\) has \(\Omega_{m}=0\) or not. (**b**) The simulated SNRs of the proposed algorithm versus the predefined iterations. The constraints of \(\zeta\) and \(\
u\) are not applied here.  
* **Beam Switching.** After receiving the _switching message_, each sensor randomly selects one of the directional beams, being generated from its own BSS, with \(i\sim U[1,\cdots,N_{t}]\) and sends a _selected message_ to \(s\).
* **Data Sharing.** After collecting the _selected messages_ from the neighbor sensors, \(s\) shares its transmission data with them. When each of the sensors receives the data, it sends a _shared message_ to \(s\).
* **Sounding.****(1)** After collecting the _shared messages_ from the neighboring sensors, \(s\) with \(\mathbb{M}\) transmits a _sounding message_ with the shared data through the CB. Here, it is assumed that \(s\) and \(\mathbb{M}\) are synchronized. \(AP\) measures \(F\big{(}\mathbf{\Theta}_{M}^{t}\big{)}\) and feeds it back to \(s\). **(2)** If \(F\big{(}\mathbf{\Theta}_{M}^{t}\big{)}\) is larger than the predetermined threshold SNR, \(\zeta\), or \(F\big{(}\mathbf{\Theta}_{M}^{t}\big{)}-F\Big{(}\mathbf{\Theta}_{M}^{t-1}\Big{)}\geq\
u\) is met, then go to **Step 7** directly
* **Updating.** If \(F\Big{(}\mathbf{\Theta}_{M}^{t-1}\Big{)}\) is available, \(s\) makes the decision for either the acceptance or rejection of the state transition. If it is not available, then go back to **(1)** of **Step 5**. When the transition is accepted, \(F\Big{(}\mathbf{\Theta}_{M}^{t-1}\Big{)}\) is replaced with \(F\big{(}\mathbf{\Theta}_{M}^{t}\big{)}\). Then, return to **Step 2**, and \(s\) repeats from **Step 2** to **Step 6** during \(\rho\) iterations.
* **Abort.** Check whether all iterations have stopped or \(F\big{(}\mathbf{\Theta}_{M}^{t}\big{)}\geq\zeta\mid\mid F\big{(}\mathbf{\Theta}_{M}^{t }\big{)}-F\Big{(}\mathbf{\Theta}_{M}^{t-1}\Big{)}\geq\
u\) is met. If either of these conditions are true, \(s\) broadcasts an _abort message_, and uses the set of beams having \(\mathbf{\Theta}_{M}^{t^{\prime}}\) (\(t^{\prime}\gg t\)) for the future data transmission.