# Resource Allocation for Reconfigurable Intelligent Surface Assisted Dual Connectivity
## 4 Proposed Heuristic For RIS Assisted DC  
In this section, we present the proposed heuristic for a RIS-assisted DC system as in Algorithm 1 for solving (14). The problem presented in (14) is the global optimization problem for the RIS-assisted DC system. This involves the selection of DC users, scheduling, and computation of its resultant data rate. Solving for all at once is NP-hard and is difficult to solve. We propose this heuristic for a step-by-step procedure to solve the optimization problem proposed in (14).  
```
1: INPUTS : \(\{P_{j}^{r}h_{u,j}^{r}\}\), \(\mathbf{U}\), \(\tau\)
2: OUTPUT : \(\lambda_{u}\)
3: Initialize : u=1, \(\{x_{u,j}^{r}\}=0\), \(\{d_{u,j}^{r}\}=0\)
4: Repeat
5: Sort \(\{P_{j}^{r}h_{u,j}^{r}\},\forall r\geq 1\) in decreasing order of received power from RIS. The rearranged order is represented using \(q\). \(r=0\) implies direct link between BS and user.
6: if\(P_{j}h_{u,j}^{q}\geq P_{j}h_{u,j}^{0}\)then
7:\(\omega_{u,j}^{q}=f(\{P_{j}h_{u,j}^{q}\})\) as in (7)
8:\(\omega_{u,k}^{q+1}=f(\{P_{k}h_{u,k}^{q+1}\})\) as in (7)
9:\(x_{u,j}^{q}=1\)
10: if\(\omega_{u,j}^{q}\geq\tau\) & \(\omega_{u,k}^{q+1}\geq\tau\)then
11:\(d_{u,k}^{q+1}=1\)
12:else
13:\(d_{u,k}^{q+1}=0\)
14:endif
15:else
16:\(\omega_{u,j}^{0}=f(\{P_{j}h_{u,j}^{0}\})\) as in (3)
17:\(x_{u,j}^{0}=1\)
18:endif
19: Set \(u=u+1\)
20: Until \(u>\) U
21: Set u=1
22: Repeat
23: Compute \((\delta_{u,j}^{r})^{*}\) as in (26)
24: Compute \(\lambda_{u}\) as in (15)
25: Set \(u=u+1\)
26: Until \(u>\) U
27: Stop
```  
**Algorithm 1** Proposed heuristic for RIS-assisted DC  
The set of received powers, user set, and the threshold for the selection of DC users (\(\tau\)) are taken as inputs. The resultant data rate as in (15) is the output of the system. The heuristic is initialized by setting, \(u=1\), binary association matrix \(x_{u,j}^{r}=0\), and DC binary association matrix \(d_{u,j}^{r}=0\). As an initial step, the received power of the user \(u=1\) from all RIS is arranged in the decreasing order. The rearranged order of RIS based on the received power is now denoted with a variable \(q\). The SINR of the user \(u\) is computed using (7) or (3) based on its received power. If the received power of users' direct link with the BS is greater than the received power with RIS, then the SINR of the user \(u\) is computed using (3) and the corresponding \(x_{u,j}^{0}\) is set to 1. If received power with RIS is greater than the direct link, then the SINR is computed using (7) and so the \(x_{u,j}^{q}\) is set to 1. Further, we define DC users as eligible users to utilize radio resource from two different BSs via two different RIS. If the first two values of users' received power in rearranged is greater than certain predefined threshold \(\tau\), then the user is considered to be RIS-assisted DC user. This user now utilizes radio from two different BSs via two different RISs. Given that all the SINR of users with direct and RIS link have been computed, the next step is to compute users' resultant data rate (\(\lambda_{u}\)) as in (15). To compute \(\lambda_{u}\), we need to first compute the optimal user scheduling time fraction \((\delta^{\tau}_{u,j})^{*}\) as in (26). The complexity of the heuristic is in the order of 2U, where U is the total number of users in the system. The heuristic is divided into two main steps. The computation of SINR and the selection of normal, DC, and RIS-assisted DC users at the first step. The latter step continues with computation of optimal user scheduling time fraction and the resultant data rate. The numerical evaluation for different scenarios are presented next.