UAV-Assisted Data Dissemination in Delay-Constrained VANETs
Algorithm 2
Polynomial time approximation scheme for graph knapsack.
Input: Q: a list of for node u, every ;
δ: the predefined delay threshold
Output: approximation solution P(1)INITIALIZE , set up the value of for corresponding link;(2)Let for every ;(3)for to - 1 do(4)for each edge do(5)for each do(6) Calculate = + ;(7) Add to ;(8)end for(9) Trim();(10)end for(11)end for(12)return P, which contains the set of links selected