## 3 Multiaccess Resource Allocation Algorithms and Power Control
### Resource-Allocation Algorithm  
In order to effectively utilize limited spectrum resources and better satisfy the demanding data rate needs of VUEs, a multiaccess resource-allocation mechanism is implemented. The allocation technique and interference arising from the shared channel exhibit a higher level of complexity; yet, they have the potential to greatly enhance spectrum usage and data transmission rates. In order to address the subcarrier-allocation issue, this study initially considers binary variables \(\{C_{i}^{v},C_{j}^{v}\}\) to be determined as either 0 or 1. It further assumes that the power of CUEs is set to the highest value (\(W_{i}^{\max}=W_{i}^{v}\)), while the power of VUEs is uniformly distributed among all subcarriers (\(W_{i}^{v}=W_{i}^{\max}/V\)). Consequently, Problem 1 is restated as  
\[ \begin{array}{c}\text{{Problem 2:}}\max\limits_{\{C_{i}^{v},C_{j}^{v}\}}\sum_{i=1}^ {X}\sum_{e=1}^{V}\left(\log(1+\psi_{i}^{v})\right),\\ \text{s.t}\\ c1:\;C_{i}^{v},C_{j}^{v}\in\{0,1\},\forall v\in V,\forall j\in Y,\forall i\in X,\\ c2:\sum_{j}^{Y}C_{j}^{v}\leq 1,\forall v\in V,\\ c5:\sum_{\
u=1}^{V}\Psi_{j}^{v}\geq\Psi_{j}^{size},\forall j\in Y,\end{array}  \tag{5}\]  
Problem 2 includes binary allocation variable constraints and basic data rate requirements for CUEs. The multiaccess heuristic resource-allocation algorithms used in this article are divided into three stages: CUEs' subcarrier allocation, VUEs' subcarrier allocation, and VUEs' multiplexing subcarriers. Figure 2 shows the flowchart of the resource-allocation algorithm. Step 1: To ensure the minimum data rate requirement for CUEs, first we allocate subcarriers to CUEs and maximize the distance data rate requirement \(\left(j^{*}=max\big{(}\Delta\Psi_{j}\big{)}=max\left(\Psi_{j}^{size}-\Psi_{j} \right)\right)\), allocating the subcarrier \(v^{*}\big{(}v^{*}=max\big{(}a_{i}^{v}\big{)}\big{)}\) with the highest channel gain to CUEj*. This step concludes either when all CUEs satisfy the data rate criteria or when all subcarriers have been allocated. If there exist any subcarriers that have not been allocated in the current stage, the system should advance to the second stage. Otherwise, it should go to the third stage. This stage ensures that the CUEs have exclusive access to their assigned subcarriers, and that the orthogonality between subcarriers is maintained. This stage also takes into account the channel quality and the rate demand of each CUE on each subcarrier, which is enabled by OFDMA. Step 2: Allocate the remaining subcarriers to VUEs, and allocate the subcarrier with the best channel gain \(\left([v^{*},i]=max\;a_{i}^{v}\right)\) to VUEs. This stage ends when all remaining subcarriers are allocated. Step 3: In order to fully utilize spectrum resources, VUEs can reuse subcarriers already allocated to other users. To determine the optimal VUE for a given subcarrier, it is necessary to identify the unused VUE with the maximum gain on the corresponding channel. The potential for VUE to reuse this subcarrier can be categorized into two distinct scenarios: The subcarrier has been previously allocated a CUE, and it is imperative to determine whether the combined interference resulting from VUE multiplexing will interfere with the fulfillment of the CUE's data rate prerequisites. If this is the case, the practice of multiplexing is prohibited, resulting in the discontinuation of the current subcarrier multiplexing. Contrary to the initial assertion, it is permissible. Subsequently, we proceed to examine the subsequent set of VUEs until the cumulative interference fails to satisfy the data rate prerequisites of the CUE. The process of multiplexing the current subcarrier concludes and transitions to the subsequent subcarrier. The CUE system does not utilize the subcarrier in question, but it is permissible for the VUE system to utilize it in order to transition to the subsequent subcarrier. The procedure mentioned above is a resource-allocation algorithm consisting of three stages.