# Exploiting Mobile Edge Computing for Enhancing Vehicular Applications in Smart Cities
## 4 The Proposed Protocol
### Traffic Condition Detection and Representation  
The detection of traffic condition may effectively benefit different types of applications correlated with congestion management and navigation systems. These systems can rely on the detection of traffic condition in different road segments for an enhanced routing recommendations. In our protocol, we propose to utilize traffic condition information in controlling the dissemination of safety messages to provide high data delivery without the drawbacks of unnecessary transmissions. More specifically, excessively broadcasted messages under high density traffic scenario may easily result in packet loss due to collisions, however, providing an efficient broadcast suppression according to traffic conditions is the solution we propose for an improved data dissemination in vehicular networks. Instead of relying on local data for detecting traffic condition as we have proposed in our previous work [38], we propose to utilize a MEC architecture for accurately detecting the condition of any road segment in the network. Data dissemination can then be controlled via both V2I and V2V communication. The network is represented as a directed graph \(G=(V,E)\) where the set of \(n\) vertices \(V=\{v_{1},\,v_{2},\,v_{3},\,\ldots,\,v_{n}\}\) represents road intersections, and the set of \(m\) edges \(E=\{e_{1},\,e_{2},\,e_{3},\,\ldots,\,e_{m}\}\) represents the links between these vertices, where \(E\subseteq\{(u,v)\,|\,u,\,v\in V\,\wedge\,u\
eq v\}\). To indicate trafficcondition of each road link in the network, an irreflexive weighted adjacency \(n\times n\) matrix \(A\) is defined as follows:  
\[A=\left[w_{ij}\right]_{t_{x}}= \begin{cases}\left(CF_{ij}\right)_{t_{x}},&\quad if \ a\ link\ from\ i\ to\ j\ exists\\ \quad\quad\quad\quad 0,&\quad otherwise\end{cases}  \tag{1}\]  
where \(w_{ij}\) is the weight given to the link connecting \(v_{i}\) and \(v_{j}\) according to its traffic condition at time \(t_{x}\). We define the traffic Condition Factor (_CF_) which combines a set of weighted parameters to indicate traffic condition of a road link during a predefined time interval. In addition to active parameters such as speed, acceleration and direction, _CF_ can include parameters inferred from historical data such as accident frequency. For a set of \(n\) parameters with defined weighs, the condition factor of a road link connecting \(v_{i}\) to \(v_{j}\) is computed as:  
\[CF_{ij}=\sum_{k=1}^{n}\left(P_{k}.w_{k}\right)_{ij} \tag{2}\]  
where \(P_{n}\) is the set of weighted parameters utilized in calculating _CF_, and \(w_{n}\) is the set of weights given to them. The weighted matrix is updated whenever a new weight is calculated. The cloud server keeps a record of calculated weights for long-term data analysis. A network edge needs only to keep the last updated weights of the road links belong to the area it supervises. Edges can share their weights with nearby vehicles and edges or request for information about missing weights depending on the application. Active data generated by mobile vehicles are collected by the nearest edge. Here we focus on the speed as an example active parameter to consider for calculating _CF_ for two main reasons: simplicity and effective representation. Specifically, the speed-density relationship is the most descriptive of driver behavior, since average speeds decline as density increases. In other words, traffic density can be derived from the speed and flow rate, which are relatively simple traffic measurements. Therefore, speed data series generated by mobile vehicles is a representative collection of data that can be utilized by network edges not only to estimate traffic condition, but also to derive other parameters.