Skip to main content
. 2021 Jun 25;23(7):809. doi: 10.3390/e23070809
Algorithm 3: Low-complexity subcarrier scheduling and user pairing scheme.
1: Input:Nc, U, lnc,knc2, P1,nc and P2,nc.
2: Output: Subcarrier scheduling Mlow and user pairing knc.
3: Initialize: Mlow=, i1=1 and ς=1, where Mlow, i and ς denote the subcarrier mapping, ith element of Us and ςth user pairing result, respectively;
4: Arrange the elements of Us in descending order, known as Us¯;
5: whilei1,U2do
6:  Denote the subset of the use pairing as Ussub¯;
7: if i+U2=U then
8:   Ussub¯=Us¯i,Us¯i+U2,Us¯i+U2,Us¯i;
9: else
10:   Ussub¯=Us¯i,Us¯i,Us¯i,Us¯i;
11: end if
12: while ς[1,2] do
13:   Select the ςth element of Ussub¯;
14:   Determine the 1th and 2th users;
15:   Set C=nc˜|nc˜Mlow, nc˜ is the unsaturated points;
16:   if C then
17:    Find a new augmented branch χ;
18:    Mlow=Mlowχ;
19:   else
20:    Calculate Etotal as (16);
21:    Record Etotal, subcarrier scheduling Mlow and user pairing knc;
22:    ς=ς+1;
23:   end if
24:   i=i+1;
25: end while
26: i=1;
27: end while
28: Search the maximum Etotal and corresponding subcarrier scheduling Mlow and user pairing knc.