Skip to main content
. 2026 Jul 20;11(7):509. doi: 10.3390/biomimetics11070509
Algorithm 1: Hybrid UCB-ACO for multi-tier task offloading.
Input: N users, T iterations, J tiers {L,E,F,C}, weights wk
Output: Optimal Offloading Mapping X∗
  1. Initialize τi,j0=τinit and ni,j0=0 for all i∈N,j∈J

  2. For run=1 to num_runs do

  3.    For t=1 to T do

  4.      For each user i∈{1…N} do

  5.        Calculate Exploration Bonus: Bi,jt=lntni,jt

  6.        Compute UCB Score: Ui,jt=μ¯i,jt+c⋅Bi,jt (where c=2.0)

  7.        Select target tier j∗ using decision rule: j*=argmaxj∈Jτi,jt⋅Ui,jt

  8.        Execute task offloading and record Delayij and Energyij

  9.      End For

  10.      Evaluate Global Fitness: ft=w1T+w2E+Ψ (where Ψ represents the inelastic constraint violation penalty)

  11.      Update Pheromones: τjt+1=1−ρτjt+Δτjbest

  12.    End For

  13. End For

  14. Return Global Best Mapping X∗