**Algorithm 2** Neighbor Function.

**Initialization:** *V<sup>i</sup>* : any vehicle *i*, *Tx*: Transmission range, *SPR*: Speed Range, *D*: Direction of a vehicle, *CountVID*: Counting of number of vehicles

```
Input: SPR, Tx, D
```
**Output:** Number of transmission range vehicles (*CountVID*)

```
1: for Vi = 1 → n do
```

```
11: Return (CountVID)
```