Algorithm 2. Transmission Mode and Relay Selection Optimization |
|
1: |
Solving optimal power allocation subproblem |
|
to obtain and , construct Table 1
|
2: |
for the mth PU |
|
if
,
|
|
|
then
|
|
|
set
|
|
|
delete the mth row in Table 1b |
|
|
end |
|
end |
|
Table 1b is updated |
3: |
repeat |
4: |
Apply K-M algorithm on Table 1b to find |
|
optimal relay node obtaining
|
5: |
if
|
|
|
set
|
|
|
set
|
|
|
Update Table 1b removing the mth row |
|
end |
6: |
until,∀ PU in Table 1b. |