|
Algorithm 3: Preference-Based Bilateral Matching Offloading Algorithm |
|
Input: ,
|
|
Output:
|
| 1: Initialize , , , , , , equal to ; |
| 2: User side: each user sends an offloading request to its associated BS; |
| 3: MEC side: BSs mutually forward the users offloading requests; |
| 4: Initial task offloading: |
| 5: for do |
| 6: received offloading requests; |
| 7: , ; |
| 8: Initial offloading strategy : , according to user preferences, with full acceptance of offloading requests; |
| 9: Initial resource allocation strategy: , according to Algorithm 2; |
| 10: end for |
| 11: for do |
| 12: Computing Equation (7); |
| 13: ; |
| 14: if and
|
| 15: ; |
| 16: ; |
| 17: else |
| 18: Computing ; |
| 19: Sort in descending order, select a task with the smallest value to offload in turn, let and until and ; |
| 20: end if |
| 21: end for |
| 22: for do |
| 23: Computing offloading preference (); |
| 24: Sort in descending order, select a collaborative BS with the biggest value to send the offloading request preferentially. |
| 25: if do |
| 26: Accept the offloading request of , let , ; |
| 27: else |
| 28: if accepts the offloading request of , let , ; |
| 29: else send the offloading request of to the suboptimal collaborative BS , until it is accepted, let ; |
| 30: end if |
| 31: end if |
| 32: end for |