## 2 System Model and Problem Formulation  
### Channel and System Models for 5G NOMA-Based Networks  
In this work, let's consider a downlink transmission of a NOMA-based 5G cellular network with a single cell within which \(K\) number of users are randomly and uniformly deployed. A single BS is located at the center of the cell, serving all NOMA users on an allocated 5G frequency band \(B_{T}\) which is divided equally into \(M\) number of subcarriers, each with a bandwidth of \(B=B_{T}/M\). The distance of a user \(n\) from the BS is denoted as \(d_{n}\). In this context, it is assumed that the BS is endowed with the full knowledge of the channel state information (CSI) of all users in this network. Based on the prior knowledge of the CSI, the superposed signal is transmitted by the BS with a power \(p_{n,m}\) to the user \(n\) on subcarrier \(m\) and the channel gain between the BS and the user \(n\) on subcarrier \(m\) is characterized as \(g_{n,m}\). Unlike the conventional OMA, a NOMA-based network allows the sharing of subcarriers among all users. In this work, we incorporate a NOMA system with a dynamic subcarrier sharing environment in which a user is allowed to autonomously form a group with other users to receive their own data from the BS using the same sets of subcarriers. The flexibility in terms of the group formation introduced in this work enables the users to freely form any cluster with others regardless of the limitation on the number of users per cluster or the number of clusters allowed to be formed in the networks, which is normally enforced in literature to satisfy the SIC constraint. This dynamic clustering may result in a \"grand\" cluster (all users sharing all their subcarriers in a single big cluster) or a \"singleton\" cluster (one cluster contains one user only where each cluster/user is exclusively allocated with different sets of subcarriers, which is similar to the OMA implementation). In between the singleton and grand clusters, there are \(B_{K}-2\) possible combinations of clustering outcomes where \(B_{K}\) can be denoted as Bell number [15] as follows:  
\[B_{K}=\sum_{k=0}^{K-1}\left( \begin{array}{c}K-1\\ k\end{array} \right)B_{k} \tag{1}\]  
where \(B_{0}=B_{1}=1\). For brevity, the user set containing \(N\) number of the NOMA users sharing the subcarrier \(m\) can be denoted as \(U_{m}=\{U_{1,m},U_{2,m},\ldots,U_{n,m},\ldots,U_{N,m}\}\) where \(N\leq K\). Since a cluster consists of a set of users sharing the same set of subcarriers, a cluster \(i\) can be formed by having \(C_{i}=U_{m},\ m\in M_{i}\) where \(M_{i}\) is the set of subcarriers assigned to cluster \(i\). Consider a specific two-user scenario on subcarrier \(m\) where a NOMA nearby user \(U_{1,m}\) and a NOMA distant user \(U_{2,m}\) (\(d_{1}<d_{2}\)) in which the channel condition of \(U_{1,m}\) is naturally superior to that of \(U_{2,m}\) (\(g_{1,m}>g_{2,m}\)). If \(U_{1,m}\) and \(U_{2,m}\) are grouped in the same cluster to receive data on subcarrier \(m\), a lower transmit power is assigned to \(U_{1,m}\) but the power allocation must meet the SIC constraint denoted as \(p_{2,m}g_{1,m}-p_{1,m}g_{1,m}\geq p_{min}\) where \(p_{min}\) is the minimum power difference to distinguish the decoded signal and the remaining nondecoded signals. With this condition, SIC can be performed successfully by \(U_{1,m}\) which first decodes the interfering signal destined to \(U_{2,m}\) and removes it subsequently. After that, the message intended to \(U_{1,m}\) can be decoded accordingly without interference. Figure 1 illustrates an \(N\)-user NOMA-based 5G system where \(N\) users are sharing a specific band of frequency for the downlink transmission in a cluster. The SIC operation is independently performed by the \(N\) users to retrieve their respective messages from the superposed signals. The SIC constraint described above can be extended into an \(N\)-user scenario so that each user is able to distinguish and decode their message successfully.