Research Article

Solving “Limited” Task Allocation Problem for UAVs Based on Optimization Algorithms

Pseudocode 3

Greedy algorithm
Input: Individual x
Output: Optimized individual x
1: ;
2: do
3: fori =1 tomdo
4:  for∀𝑣𝑖𝑗,∈𝑥𝑖 (𝑗𝑘)do
5:   Exchange the positions of 𝑣𝑖𝑗 and 𝑣𝑖𝑘 in 𝑥𝑖;
6:   Calculate ;
7:   if 𝑜𝑙𝑑𝐹−𝑛𝑒𝑤𝐹≤0 then
8:    Restore the positions of 𝑣𝑖𝑗 and 𝑣𝑖𝑘 in 𝑥𝑖;
9:   end if
10:  end for
11: end for
12: while (x is updated)
13: returnx