Skip to main content
. 2018 Jan 15;20(1):64. doi: 10.3390/e20010064
Algorithm 1 Sum rate maximization algorithm.

Input: U, K, PT, αuk2

Output: cu, Pu

  • 1:

    (1) Initialization:

      Let A={1,2,,K} denote unassigned subcarrier sets; Pu=0 is the power allocated to user u; cuk=0 represents the number of bits allocated on the subcarrier k allocated to the user u; cu=0 indicates the total number of bits allocated to the user u; Au= denotes the set of subcarriers assigned to the user u;  

  • 2:

    (2) Carrier allocation:  

  • 3:

    for u=1,2,,U do  

  • 4:

        find subcarrier k that minimizes Δpuk(0), and assign the subcarrier to the user u; meanwhile, Au=Au{k}, A=A{k}

  • 5:

        if A= then break;

  • 6:

    while A do  

  • 7:

        find the subcarrier k with the smallest Δpuk(0) in the set A, and assign them to the corresponding user u; meanwhile Au=Au{k}, A=A{k}

  • 8:

    (3) Bit and power allocation:   

  • 9:

    while u=1UpuPT do  

  • 10:

        Traverse the subcarriers corresponding to all the users; find the subcarrier k and the corresponding user u with the smallest Δpuk(cuk), and allocate 1 bit of data to the subcarrier; meanwhile cuk=cuk+1, Pu=Pu+Δpuk(c), cu=cu+1  

  • 11:

    return cu, Pu