Skip to main content
. 2014 Nov 27;14(12):22564–22594. doi: 10.3390/s141222564

Algorithm 2 Utility Greedy algorithm

Input:
G = (V, E): The weighted road graph;
T: The delay bound;
B: The budget constraint;
Output:
Inline graphicc: The placement set of installing c-RSUs;
Inline graphicw: The placement set of installing w-RSUs;
1: Inline graphic = ∅, Inline graphic = ∅;
2: For all i, jV, initial Dij according to Equation (2);
3: while the placement cost is not exceed the budget Bdo
4: for all unselected viVdo
5:   Calc c-RSUs delay-bounded coverage utility uc(i) according to Equation (11);
6: end for
7: for all unselected viU and vi is with the transmission range of an existing RSU do
8:   Calc w-RSUs delay-bounded coverage utility uw(i) according to Equation (11);
9: end for
10: v* = {vi ∣ max{uc(l), uw(k)}, ∀viV };
11: if install a c-RSU then
12:    Inline graphicc = Inline graphicc ∪ {v*};
13: end if
14: if install a w-RSU then
15:    Inline graphicw = Inline graphicw ∪ {v*};
16: end if
17: V = V \ {v*};
18: Inline graphic = Inline graphicInline graphicv*;
19: end while
20: return Inline graphicc, Inline graphicw