|
Algorithm 1 Dijkstra-based upload routing in time instant t. |
-
Require:
Directed graph with ; UD index set ; BS index 0
-
Ensure:
For each : shortest upload path and time
-
1:
Build in-neighbor adjacency: for each , append x to and store
-
2:
Initialize: for all , set , ; set
-
3:
Initialize a min-priority queue Q keyed by and insert 0
-
4:
while Q not empty do
-
5:
-
6:
for all do
-
7:
-
8:
if then
-
9:
,
-
10:
if then
-
11:
-
12:
else
-
13:
-
14:
end if
-
15:
end if
-
16:
end for
-
17:
end while
-
18:
Output per UD
-
19:
for all do
-
20:
if then
-
21:
;
-
22:
else
-
23:
,
-
24:
while do
-
25:
; if then ; ; break
-
26:
append v to
-
27:
end while
-
28:
;
-
29:
end if
-
30:
end for
-
31:
return
|