# Phase Shift Design in RIS Empowered Wireless Networks: From Optimization to AI-Based Methods
## 2 RIS Resource Allocation Examples and General Formulation
* Computation offloading in Internet of Things (IoT) networks [22]: In the downlink transmission of an RIS-aided cache-enabled radio access network, a multi-antenna BS transmits signals to a number of single-antenna users as shown in Figure 3c. The goal is to minimize the total network cost that consists of both the backhaul capacity and the transmission power by adjusting the caching proportion of the file requested by user \(k\), the precoding vector \(\mathbf{p}_{k}\in\mathbb{C}^{M\times 1}\) at the BS for user \(k\), and the RIS coefficients. In addition, the constraint on the RIS coefficients, we also have a constraint on the size of total cached content to be smaller than the local storage size \(S_{\max}\) at the BS. Further letting the target rate of user \(k\) be denoted by \(R_{k}\), the total network cost minimization problem is formulated as \[\min_{\mathbf{x},\mathbf{e},\left\{\mathbf{p}_{k}\right\}_{k=1}^{ K}} \sum_{k=1}^{K}(1-x_{k})R_{k}+\eta\sum_{k=1}^{K}\|\mathbf{p}_{k}\|^{2},\] s.t. \[\sum_{k=1}^{K}x_{k}\leq S_{\max},\] \[x_{k}\in[0,1],\ \forall k\] \[\|\mathbf{w}\|^{2}\leq P_{\max},\]0 \[\|\mathbf{w}\|^{2}\leq P_{\max},\]1 (3) where \(\eta\) is a regularization parameter, \(2^{R_{k}/B}\)-1 is the SINR requirement in terms of the content-delivery target rate of user \(k\), \(B\) is the bandwidth of the system, and \(\mathbf{\hat{h}}_{k}\) is defined as in the previous example. In the above three applications and beyond [23, 24, 25, 26, 27, 28, 29, 30, 31], we can see that most of the constraints in the resource allocation problems are decoupled in the sense that constraints for the RIS coefficents \(\mathbf{e}\) do not involve other resources, and vice versa. For the coupled constraints, e.g., the last constraints in problems (2) and (3), they can be converted into penalty terms in the objective function [32, 33] or decoupled by introducing auxiliary variables [34, 35, 36, 37]. After these operations, without loss of generality, we consider a general resource allocation problem appearing in the form  
\[\|\mathbf{w}\|^{2}\leq P_{\max},\]2  
where \(f(\mathbf{x},\mathbf{e})\) is a continuous objective function, and \(\mathbf{x}\) represents the conventional communication resources with the set \(\mathcal{X}\) representing the constraint on \(\mathbf{x}\), such as the maximum transmit power, limited cache size, operation time limitation, etc. With the decoupled constraints for \(\mathbf{x}\) and \(\mathbf{e}\), the optimization problem is tractable under the commonly used block coordinate descent (BCD) framework, which alternatively solves for \(\mathbf{x}\) with \(\mathbf{e}\) fixed and solves for \(\mathbf{e}\) with \(\mathbf{x}\) fixed. In particular, when the phase shift coefficients of the RIS \(\mathbf{e}\) are given, the resource allocation problem reduces to a standard communication problem without the RIS. On the other hand, when \(\mathbf{x}\) is fixed at a certain value, say \(\mathbf{x}^{(n)}\), the subproblem for optimizing \(\mathbf{e}\) is  
\[\|\mathbf{w}\|^{2}\leq P_{\max},\]3  
Before discussing various methods for solving (5), let us review the modeling of the constraint set \(\mathcal{F}\) on the RIS coefficients. Depending on whether the phase is modeled as a continuous or discrete variable, the feasible set \(\mathcal{F}\) is defined differently:  
\[\|\mathbf{w}\|^{2}\leq P_{\max},\]4 (**a**) Secure beamforming for MISO systems [20]. (**b**) MISO uplink communication networks [21]. (**c**) Computation offloading in IoT networks [22]. * **Continuous phase shift**: Each RIS coefficient has infinite phase resolution, i.e., \(e_{m}\) is expressed as \(\beta_{m}e^{i\theta_{m}}\) with \(i\) being the imaginary unit, and \(\theta_{m}\) as a real number. For \(\beta_{m}\), there are three variations in the literature. * C1. \(\beta_{m}\) is a known constant, which is the ideal phase shift model [23, 38, 39]. This is the most popular model at the time of writing, and \(\mathcal{F}\) is represented by modulus constraints \(|e_{m}|^{2}=1\);
* C2.