# Optimized Combination of Local Beams for Wireless Sensor Networks
## 3 Proposed Algorithm
 \tag{8}\]  
To minimize the average INR, we open the combinatorial optimization problem with the objective function of \(O\left(\boldsymbol{\vartheta_{\mathrm{t}}}\right)\triangleq\Xi\left( \boldsymbol{\vartheta_{\mathrm{t}}},\boldsymbol{\Gamma}_{1}\right)\) as follows:  
\[\boldsymbol{\vartheta_{opt}}=\underset{\boldsymbol{\vartheta_{\mathrm{t}}}}{ \operatorname{arg\,max}}\ O\left(\boldsymbol{\vartheta_{\mathrm{t}}}\right). \tag{9}\]  
Here, \(\boldsymbol{\vartheta_{\mathrm{t}}}=\left[\vartheta_{1,\mathrm{t}},\cdots, \vartheta_{L_{\mathrm{c}},\mathrm{t}}\right]\) is the state vector to change the combination of the beams in a discrete manner, and \(\vartheta_{i,\mathrm{t}}\in\left\{-\pi+\frac{\pi}{N},\cdots,-\pi+\frac{\pi \left(2m_{i,\mathrm{t}}-1\right)}{N},\cdots,-\pi+\frac{\pi\left(2N-1\right)}{N}\right\}\) is the steering angle having the approximate 3-dB beamwidth of \(2\pi/N\)[40]. To find the global optimum of (9), all of the \(N^{L_{\mathrm{c}}}\) combinations should be exhaustively searched due to its non-convex characteristic. However, this approach imposes the impractical overhead on the system. Therefore, we utilize SA to ensure not getting stuck in local optima and approach goodapproximations to the global optimum efficiently. The SA emulates the metal annealing process, the goal of which is to reach a stable ground state. Similar to conventional methods (e.g., local search), the SA is basically based on the greedy transition from the current state \(\mathbf{\vartheta}_{\mathbf{t}}\) to a better state \(\mathbf{\vartheta}_{\mathbf{t}+1}\) for \(\mathbf{\vartheta}_{\mathbf{t}}\
eq\mathbf{\vartheta}_{\mathbf{t}+1}\), where both of the states are randomly created. However, even when \(\Delta O=O\left(\mathbf{\vartheta}_{\mathbf{t}+1}\right)-O\left(\mathbf{\vartheta}_{\mathbf{t }}\right)\leq 0\) is not met, it uniquely allows the probabilistic transition toward a worse \(\mathbf{\vartheta}_{\mathbf{t}+1}\) by the Metropolis criterion [41], such as  
\[exp\left(\frac{-\Delta O}{T_{f}}\right)\geq\eta, \tag{10}\]  
where \(\eta\sim\mathcal{U}\left[0,1\right]\), and \(T_{f}\) is the current temperature. With the two transition mechanisms, the SA starts running the inner loop for the \(R_{tot}\) iterations at the initial temperature \(T_{0}\). After finishing the inner loop, the outer loop for cooling the temperature from \(T_{0}\) to \(T_{1}\) by the geometric temperature schedule of \(T_{1}=T_{0}\times\rho\) with \(\rho\in\left\{0.5,\cdots,0.99\right\}\) is run, and another inner loop is repeated at \(T_{1}\). This process continues until \(T_{f}\) decreases to \(T_{F}\), which is sufficiently low for the rare acceptance of new worse states. In addition, \(R_{tot}\) at \(T_{f}\) is adaptively determined as \(R_{B}+\left\lfloor R_{B}F\right\rfloor\) to be close to the stationary distribution at the given temperature, where \(R_{B}\) is the fixed number of the iterations, \(\left\lfloor\cdot\right\rfloor\) is the flooring function, \(F=1-exp\left[-\frac{\left(O_{H}-O_{L}\right)}{O_{H}}\right]\), and \(O_{H}\) and \(O_{L}\) are the highest and lowest values of the objective function at \(T_{f-1}\), respectively [42]. Based on the above description, the SA can minimize the average INR effectively through the following steps. **Step 1: Initialization. **  
As the first step, \(\mathfrak{S}\) sets the control parameters of the SA, \(T_{0}\), \(T_{f}\), \(\rho\), and \(\mu\), to the default values and broadcasts the _initialization message_. Here, \(\mu\) is the predetermined acceptable INR in the undesired APs, and, for simplicity, it is equally set over the whole undesired APs. When each \(d_{i}\) receives the message, it generates the beam the beam whose \(\theta_{i,1}\in\mathbf{\vartheta}_{1}\) is closest to \(\varphi_{1}\). If \(\varphi_{1}\) is in the middle between the two consecutive steering angles, one of them is selected. Go to **Step 2-2**. **Step 2: Optimization. **  
**- Step 2-1: Beam Perturbation(BP).