## 3 Problem Formulation and Proposed Solution
### The RPSO Algorithm  
However, \(\mathbf{F}_{0}\) may not be the optimal solution to the problem (16) according to the final modified operation in Section 3.2, and consequently, we need to search for a meta-heuristic algorithm to calculate the global optimization solution while satisfying the constraints. Motivated by the work in [17], we adopt the result \(\mathbf{F}_{0}\) as one of the initial values of the heuristic algorithm to intervene in the computational process. The purpose of this operation is to accelerate the rate of convergence and satisfy the constraints simultaneously. The particle swarm optimization (PSO) algorithm is an intelligent algorithm that can help us search for the global optimization of the problems mentioned above by simulating the behavior of biological populations [27]. Normally, the initial value of each particle is randomly chosen to guarantee that all the possible searching regions can be explored. In our simulations, we choose the solution \(\mathbf{F}_{0}\) as one of the initialization to ensure a faster rate of convergence. In our practical scenarios, the location of each particle indicates a possible assignment scheme of RIS (i.e., a kind of \(\mathbf{F}\)), and the fitness of each particle is characterized by the objective function in (17) to evaluate the optimality of the possible solution. The process of searching for the maximum fitness for each particle is achieved by updating its velocity and position according to the principle characterized by  
\[\mathbf{V}_{i}^{t+1}=\xi\mathbf{V}_{i}^{t}+a_{1}r_{1}(\mathbf{X}_ {i,best}^{t}-\mathbf{X}_{i}^{t})+a_{2}r_{2}(\mathbf{X}_{\text{all},best}^{t}- \mathbf{X}_{i}^{t}), \tag{20}\] \[\mathbf{X}_{i}^{t+1}=\mathbf{X}_{i}^{t}+\mathbf{V}_{i}^{t+1},1 \leq i\leq m,1\leq t\leq T \tag{21}\]  
where \(\mathbf{V}_{i}^{t}\) and \(\mathbf{X}_{i}^{t}\) represent the velocity and position of the \(i\)-th particle at the \(t\)-th iteration, respectively. Meanwhile, \(\mathbf{X}_{i,best}^{t}\) and \(\mathbf{X}_{\text{all},best}^{t}\) are the historically optimal position of the \(i\)-th particle and the entire particle swarm at the \(t\)-th iteration, respectively. \(m\) is the size of the particle swarm, \(T\) represents the maximum number of iterations. Furthermore, \(\xi\) denotes the inertia weight characterizing the ability to balance the globality and convergence rate, \(a_{1}\) and \(a_{2}\) represent the learning factors assessing the ability to exchange information in the particles, and \(r_{1}\) and \(r_{2}\) are the random numbers uniformly distributed in \([0,1]\). We modify the PSO algorithm by setting the initial value of the first particle as \(\mathbf{F}_{0}\). In addition, other particles' initial positions are selected randomly from feasible values satisfying the constraints in (18). Meanwhile, the constraint on velocity needs to be imposed to prevent missing the ideal solution on account of the excessive velocity or encountering delays in achieving the final solution caused by the stagnant updating velocity for particles. Consequently, the velocity of the updating process meets \(\mathbf{V}_{i}^{t}\subseteq[-\mathbf{V}_{\text{max}},\mathbf{V}_{\text{max}}]\), where \(\mathbf{V}_{\text{max}}\) is the maximum updating velocity set for each particle. As for the first iteration (i.e., \(t=1\)), the initialization for the particles' positions and velocities can be expressed as  
\[ \begin{array}{ll}\mathbf{X}_{1}=\mathbf{F}_{0}&\\ \mathbf{X}_{i}=rand_{1}(\mathbf{F})&2\leq i\leq m\\ \mathbf{V}_{i}=rand_{2}(\mathbf{V})&1\leq i\leq m\end{array}  \tag{22}\]  
where \(\mathbf{X}_{i}\) and \(\mathbf{V}_{i}\) denote the initial position and velocity for the \(i\)-th particle at the first iteration, \(rand_{1}(\cdot)\) represents the random function which can select a random matrix from the feasible value satisfying the constraints in (18), and meanwhile, \(rand_{2}(\cdot)\) denotes the random function which selects a random number from \(\subseteq[-\mathbf{V}_{\text{max}},\mathbf{V}_{\text{max}}]\).