Algorithm 2 Route optimization with the minimum spanning tree algorithm. |
-
1:
initialize variables:
-
2:
-
3:
←
-
4:
←
-
5:
centroid node
-
6:
C ← cluster
-
7:
for all clusters (C) do
-
8:
calculate from centroid
-
9:
if distance between ( and centroid) == 1 then
-
10:
-
11:
else
-
12:
-
13:
end if
-
14:
if
then
-
15:
select node for routing
-
16:
else
-
17:
drop node
-
18:
end if
-
19:
end for
-
20:
repeat
-
21:
step 7
-
22:
until the centroid does not change
-
23:
while the topology has changed do
-
24:
steps 1 to 7
-
25:
end while
|