Skip to main content
. 2021 Jun 25;23(7):809. doi: 10.3390/e23070809
Algorithm 1: Subcarrier scheduling and user pairing scheme.
1: Input:Nc, U, lnc,knc2, P1,nc and P2,nc.
2: Output: Subcarrier mapping ϑ and user pairing knc.
3: Initialize: nc=0 and i=1, where i denotes the ith element of Us;
4: whilenc[0,Nc1]do
5: while i[1,U·(U1)] do
6:   Select the ith element of Us;
7:   Determine the 1ncth and 2ncth users;
8:   Calculate Etotal as (16);
9:   Record Etotal, subcarrier scheduling ϑ and user pairing knc;
10:   i=i+1;
11: end while
12: i=1;
13: nc=nc+1;
14: end while
15: Search the maximum Etotal and corresponding subcarrier scheduling ϑ and user pairing knc.