# Traffic Incident Detection Based on Dynamic Graph Embedding in Vehicular Edge Computing
## 3 Traffic Incident Detection Based on Dynamic Graph Embedding
### Dynamic Graph Embedding-Based Traffic Incident Detection  
In road traffic networks, the intersection areas are more susceptible to traffic congestion. Depending on the different root causes, traffic congestion can usually be divided into two types: (1) recurrent congestion and (2) nonrecurrent congestion [32]. Recurrent congestion is caused by predictable phenomena, such as rush hours and holidays. Nonrecurrent congestion is produced by traffic incidents, for example, collisions, disabled cars, work zones, extreme weather conditions, and special events. Because of its unpredictable character, nonrecurring congestion produced by traffic incidents is more responsible for traffic delays than recurrent congestion in metropolitan areas. This work aims to develop an intelligent system that can use real-time, multiple time series from road traffic to determine an incident at the intersections.  
To detect traffic incidents at the intersections, we utilize the installed RSU. Each RSU acts as a traffic controller, monitoring a specific intersection area for traffic incident detection in real time. V2V and V2I communications allow connected vehicles to perceive their driving surroundings and transmit the traffic data [14; 15; 23]. When a connected vehicle enters the coverage area of the RSU, the vehicle broadcasts a message with its driving information (e.g., vehicle identification, current speed, waiting time, location, and timestamp). The RSU fuses the driving data of vehicles traveling in its coverage area and estimates the traffic flow parameters. Three fundamental characteristics in traffic flow theory are traffic volume, traffic speed, and occupancy [6; 7; 10]. Although these parameters can be collected via inductive loop detectors (sensor-based) and cameras (vision-based) [33], they are more correctly collected in real time under the VEC environment. In the context of the intersection area, the selected parameters are specified as follows.  
Number of vehicles: The number of vehicles within the coverage area of the RSU. It represents the traffic volume characteristic of the traffic flow.
* Mean speed (m/s): The average speed of all vehicles. It represents the traffic speed characteristic of the traffic flow.
* Mean waiting time (s): The average time spent of all vehicles waiting to pass the intersection. The waiting time of a vehicle at the intersection is the consecutive time in which the vehicle was standing. It represents the occupancy characteristic of the traffic flow.  
The RSU continuously collects the data and estimates three parameters, forming three data as time series. Then, we apply the dynamic graph embedding model to these time series for traffic incident detection. A graph is a typical data structure for modeling the items and their relationships. Therefore, it is used to build the correlation among the time series. Given a graph \(G=(V,E)\), \(V\) indicates the vertices in the graphs, and each vertex is a traffic time series. The weight value of the edge \(E\) indicates the correlation coefficient between the two time series. The dynamic graph is composed of graphs in a continuous time. It records the evolution of the correlation among the traffic time series. Figure 2 illustrates an example of the dynamic graph, where \(S\) is the mean speed, \(V\) is the number of vehicles, and \(T\) is the mean waiting time. The weight of the edge indicates the correlation coefficient between two vertices, and \(G_{i}\) indicates the graph at the \(i\)th time interval. Then, we calculate the entropy of the graph at each time interval. Next, we embed all graphs into an embedding space based on the graph entropy. Since there are multiple intersections and each intersection consists of a dynamic graph, we map the graphs of all intersections into an embedding space. In this way, the intersection with an incident is far from the most normal intersections, and we can detect the location and time of the incident.