Skip to main content
. 2021 Feb 4;21(4):1075. doi: 10.3390/s21041075
Algorithm 1: Routing Accumulative Weight
G = (N, L); (Topology, N is the set of nodes and L the set of Links. Each Link is composed of Node1, Node2, and Weight);
TrafficDescriptor[n][4]; (Matrix with n flows and 4 parameters: Priority, SourceNode, DestNode, Deadline);
MaxDeadline = getMaxValue from TrafficDescriptor[n][4]
NodeUse[N]; (usage counter of each node)
fori = 1 → n do
 Path[i] = Dijkstra (G, SourceNode[i], DestNode[i]);
for each Node in Path[i] do
  NodeUse[N]+ = Maxdeadline/Deadline[i]; (accumulate the amount of traffic)
end
for each Link in G do
  Link weight = NodeUse[Node1]+NodeUse[Node2]; (Update the weight of all Links)
end
end