|
|
Algorithm 1 Gain greedy algorithm |
|
| Input: |
|
G = (V, E): The weighted road graph; |
|
T: The delay bound; |
|
B: The budget constraint; |
| Output: |
|
c: The placement set of installing c-RSUs; |
|
w: The placement set of installing w-RSUs; |
| 1: |
= ∅,
= ∅; |
| 2: |
For all i, j ∈ V, initial Dij according to Equation (2); |
| 3: |
while the placement cost is not exceed the budget B
and
≠ |E| do
|
| 4: |
for all unselected vi ∈ Vdo
|
| 5: |
Calc c-RSUs delay-bounded coverage gain gc(i) according to Equation (10); |
| 6: |
end for
|
| 7: |
for all unselected vi ∈ U and vi is with the transmission range of an existing RSU do
|
| 8: |
Calc w-RSUs delay-bounded coverage gain gw(i) according to Equation (10); |
| 9: |
end for
|
| 10: |
v* = {vi ∣ max{uc(l), uw(k)}, ∀vi ∈ V }; |
| 11: |
if install a c-RSU and the placement cost is not exceed the budget Bthen
|
| 12: |
c =
c ∪{v*}; |
| 13: |
else
|
| 14: |
if install a c-RSU and the placement cost is exceed the budget Bthen
|
| 15: |
v* = {vi ∣ max{uw(k)}, ∀vi ∈ V }; |
| 16: |
end if
|
| 17: |
end if
|
| 18: |
if install a w-RSU and the placement cost is not exceed the budget Bthen
|
| 19: |
w =
w ∪{v*}; |
| 20: |
end if
|
| 21: |
if install a c-RSU or w-RSU and the placement cost is not exceed the budget Bthen
|
| 22: |
V = V \ {v*}; |
| 23: |
=
∪
v*; |
| 24: |
end if
|
| 25: |
end while |
| 26: |
return
c,
w
|
|