1 Introduction

Increased vehicle density has led to an increased number of traffic accidents [1]. because road capacity is limited [2]. In addition, in congested traffic conditions, drivers may not follow traffic laws, which can cause accidents. Vehicular transportation is important in daily life; thus, this issue must be addressed. Vehicular ad-hoc networks (VANET) have been proposed to deal with communication between cars and various transportation service applications, such as emergency service systems, have been proposed [3, 4].

Emergency services deal with various unexpected situations [5, 6]. Such services comprise prior and posterior services. A prior service is intended to avoid accidents. A posterior service is a protective measurement method employed when accidents occur. Posterior services attempt to reduce the impact of accidents. Both prior and posterior services require information exchange among VANETs; thus, a significant number of emergency messages are generated. Consequently, bandwidth bottlenecks can occur [7], particularly when some vehicles use a mobile communication network [8, 9] that cannot handle such a large number of messages.

Generally, emergency messages will be sent to vehicles in the neighborhood of an accident. However, we found that not all vehicles in this neighborhood will pass through the accident scene [10]. Thus, we attempt to eliminate unnecessary message transmission based on predicted vehicle behavior. In this study, we propose a prediction model, which we refer to as the Road Lane Decision (RLD) algorithm, based on a Markov chain. However, the RLD algorithm only reduces the traffic load of a roadside unit (RSU). It does not reduce the traffic load generated by a traffic accident on a real road. In principle, no algorithm can deal with the traffic load of a real road because accident events should be handled by professional medical personnel and police. Although the RLD algorithm cannot handle traffic accidents, it can help medical personnel and police get to the accident scene quickly. The proposed RLD algorithm can send emergency messages to vehicles that may pass the accident scene. We utilize this feature to send a message regarding the best navigation path to such vehicles. Thus, these vehicles can reach their destinations and avoid blocking police vehicles heading to the accident scene. Therefore, roadside assistance can be completed successfully. We refer to this method as RLD-based Roadside Assistance (RLD-RA). Simulation results show that the proposed method can successfully reduce the number of emergency messages and mitigate bandwidth bottlenecks.

The remainder of this paper is organized as follows. Section 2 introduces related work. Section 3 defines the problem and introduces the proposed RLD and RLD-RA algorithms. Simulation results are given in Section 4. Finally, research contributions are summarized and future work is discussed in Section 5 (Table 1).

Table 1 Notations

2 Background and related work

2.1 Vehicular ad hoc network

VANET technology is based on Mobile ad-hoc Networks [11, 12]. VANETs can be roughly divided into three types, i.e., Roadside-to-Vehicle Communications (RVC) [13], Inter-Vehicle Communications (IVC) [14, 15], and Hybrid Vehicular Communication (HVC) [16]. With RVC, all vehicles communicate with a server through wireless access points or base stations. With IVC, messages can be transmitted via vehicles; thus, it is more flexible than RVC. However, IVS has a distributed structure; thus, it has low computational ability. RVC and IVS have advantages and disadvantages; thus, some researchers have integrated them into HVC, as shown in Fig. 1. In Table 2, we compare the scope of common VANET applications [17,18,19,20,21]. RVC adopts a centralized perspective; thus, it can perform more complex computations to prevent events and communicate with all neighborhood vehicles. Thus, such RVC applications depend on significant amounts of long-term information to make decisions. RVC applications include approaching emergency vehicle warnings, intersection collision warnings, stop sign movement assistance, pedestrian crossing information at designated intersections, and traffic efficiency. IVC computing power is based on the vehicles; thus, they cannot perform overly complex operations. IVC applications primarily handle real-time services that only require short-term information, such as lane change warnings, cooperative forward collision warnings, and cooperative adaptive cruise control. HVC integrates the advantages of RVC and IVC. Thus, we base this study on HVC.

Fig. 1
figure 1

Types of vehicular ad-hoc networks

Table 2 Typical scope of VANET applications

3 Proposed mechanism

3.1 Road lane decision

The proposed method is composed of Vehicle-to-Vehicle (V2V) and Vehicle-to-Infrastructure (V2I). The proposed method provides greater computation capability and achieves higher flexibility. The RLD method focuses on crossroads and intersections. A crossroad is considered a phased destination at which we can determine whether cars will pass through the accident scene. Therefore, we positioned RSUs at every crossroad to predict the direction of cars, as shown in Fig. 2. Notations used in this paper are given in Table 1. The main goal of the proposed method is to minimize the number of emergency messages. The problem is formulated based on linear programming Table 3.

Fig. 2
figure 2

HVC as a VANET

Table 3 Linear programming model

Generally, an emergency message is broadcast. Thus, cars equipped with a layer 2 network interface can receive emergency messages. If we want to reduce unnecessary message transmissions, we must focus on layer 3 techniques because an RSU can transmit an emergency message only if it has the vehicle’s IP address. Many important roads have been designed with three lanes, which means that each car has two lane-changing direction choices when driving in the middle lane. We formulate these three lanes as three states in a Markov chain [22], i.e., right, middle, and left lanes, denoted 1, 2, and 3, respectively. The mapping of lanes and transitions is given in Table 4. The transition matrix is expressed as follows:

$$ \vspace{6pt} T= \left( \begin{array}{ccc} P_{11}& P_{12} &P_{13} \\ P_{21}& P_{22} &P_{23} \\ P_{31}& P_{32} &P_{33} \end{array} \right). $$
(1)
Table 4 Transition matrix of lanes

As noted in Table 1, the variable P i j represents the probability of a car moving from the i th lane to the j th lane. The probability of passing through the accident scene can be calculated with this transition matrix when a car is at an intersection. Thus, we can determine which cars should receive emergency messages. The value of variable T depends on the three-lane environment, which is expressed as follows:

$$ \vspace{6pt} T= \left( \begin{array}{ccc} \alpha_{11}\times\frac{1 }{2}&\alpha_{12}\times\frac{1 }{2} &0 \\ \alpha_{21}\times\frac{1 }{3}&\alpha_{22}\times\frac{1}{3} &\alpha_{23}\times\frac{1 }{3} \\ 0&\alpha_{32}\times\frac{1 }{2} &\alpha_{33}\times\frac{1 }{2} \end{array} \right). $$
(2)

Assume that all drivers obey traffic laws and cannot cross the middle lane to reach next lane directly. Thus P 13 and P 31 are set to 0. The variable α is an effect parameter used to represent physical phenomena, e.g., angle, speed, and distance. We normalize these three metrics to derive α as follows:

$$ \alpha_{ij}=\frac{\frac{\theta_{(nearest)}}{\theta_{max}}+\frac{v_{(nearest)}}{v_{max}}+\frac{d_{(nearest)}}{d_{max}}}{3}, $$
(3)

where 𝜃 is used to identify the position of neighbor cars. 𝜃 (m a x) is set to 360 because all neighbor cars should be considered when changing lanes to avoid collisions. v m a x is the legal speed limit and vehicles should not exceed this limit. When a driver wants to change lanes, they must consider whether the rear car is being driven faster than their car and whether the front car is being driven slower than their car. According to the traffic laws of many countries, d m a x should be set to \(\frac {v}{2}\), which will not only not be dangerous, it will not cause traffic jams. where 𝜃 (n e a r e s t), v (n e a r e s t) and d (n e a r e s t) are difference with nearest car. These three metrics are used because the nearest car will affect the current car whether overtaking. In other words, α is a weight to adjust the influence of neighbor cars that may affect the chance to change lanes. For example, when 𝜃 (m a x), v (m a x) and d (m a x) are 90, 100 and 10, 𝜃 i , v i and d i are 90, 50 and 10, and 𝜃 j , v j and d j are 90, 90 and 10, respectively, α i is approximately 83.3% and α j is approximately 96.6%. In other words, α i has a lower probability to impact lane changing.

In the initial process, a vehicle involved in an accident will send an emergency message to the RSU to describe where the accident occurred. Therefore, in the beginning of the RLD algorithm, we define two cases that represent whether the accident is located at right side, front or left side. The RLD algorithm compares the probability in T i . For example, an accident occurs on the right side; thus, Case1 is chosen. Then, we compare whether the probability that vehicle i will enter the 1st-lane is minimum. T i (P j,1) represents the probability that a car will move from 1-lane from j-lane in the transition matrix T i . For the details that they are P 1,1, P 2,1 and P 3,1 respectively. If T i (P j,1) = M i n(T i ) is true, vehicle i will probably turn right; thus, the emergency message will be sent to vehicle i The main body of the proposed algorithm is shown in Algorithm 1.

figure a

3.2 RLD-based roadside assistance

The proposed RLD algorithm reduces the number of unnecessary emergency messages and provides greater accuracy; thus, it is considered an efficient scheme. The RLD algorithm is a pure method for emergency message reduction; however, the content of the emergency message is ignored. In other words, the RLD method only relieves infrastructures load but the traffic load. Traffic police and ambulance personnel are vital to rescues when an accident happens. Accidents usually congest traffic, e.g., vehicle damage and legal disputes. The police and ambulance personnel must arrive at the accident scene quickly to reconcile the situation. However, as mentioned previously, accidents cause traffic jams; thus, police and ambulance personnel cannot always reach the scene quickly. A schematic diagram is shown in Fig. 3. To address this problem, we consider the interaction of general vehicles and police vehicles. The police car scheme will be triggered if an accident happens. At this time, some vehicles are receiving emergency messages if they are close to the accident. This means that we can utilize the RLD algorithm to help police notify such vehicles that a police car is on the way to the scene; thus, vehicles can be asked to clear the road the police. We define a status transition rule to express how vehicle i affects a police car, which is shown in Table 5. From the original matrix T , a new transition matrix T can be derived as follows:

$$ \vspace{6pt} T^{\prime}= \left( \begin{array}{ccc} P^{\prime}_{11}& P^{\prime}_{12} \\ P^{\prime}_{21}& P^{\prime}_{22} \end{array} \right). $$
(4)
Fig. 3
figure 3

Roadside assistance scenario

Table 5 Transition matrix of influences for police car

Generally, the road lanes are regular; however, once an accident occurs, the behavior of all vehicles will become jumbled. The situation will be more severe closer to the accident scene. Although the problem becomes more complicated, we only need to know whether vehicles will affect the police. Therefore, \(P^{\prime }_{ij}\) is only used to represent a transition between two statuses. Similar to variable β, variable α is an impact parameter that includes angle, speed, and distance:

$$ T^{\prime}= \left( \begin{array}{ccc} \beta_{11}\times \frac{1}{2}&\beta_{12}\times \frac{1}{2} \\ \beta_{21}\times \frac{1}{2}&\beta_{22}\times \frac{1}{2} \end{array} \right). $$
(5)

Once P and P are obtained, we can identify ways to avoid police vehicles and reach the appropriate destination.

Assume that all vehicles comply with the recommendation from the received emergency message; thus, this problem can be considered a traffic scheduling problem. From a police perspective, they do not need to know where all vehicles go. They are only concerned about obstructions on the shortest path to the accident scene. However, a waste of space may occur if all cars are removed from the police vehicle’s path. To reduce such wasted space, we calculate the maximum number of vehicles that can drive in front of the police car as long as their speed is not less than the speed of the police car. The shortest path between a police car and the accident scene is defined as a set S that includes all coordinates of such shortest paths s i . The set S can be considered a knapsack, and goods in the knapsack correspond to cars in this study. The set of cars is denoted C = [ c 1, c 2, ..., c n ]. The delay time may increase if more cars are added to set S. Thus, this problem can be considered a knapsack problem. The goal is to find the maximum number of goods with less delay time because we think that efficient road usage will reduce traffic congestion. We formulate a new problem definition for dynamic programming (DP) as follows (Table 6).

Table 6 Dynamic programming model

Assuming the whole scenario is a two-dimensional Euclidean space, both c i and s i are mapped using two dimensional coordinates. Therefore, |CS| represents how many cars are driving in front of the police car. In other words, if c i exists and have the intersections, car i will occupy space in S. Thus, we know that when |CS| is small, there are not too many cars blocking the police car. In this way, the police car can arrive at the scene using the shortest path. Therefore, the major objective function is to minimize Ψ. To avoid cars stopping the police car, the time of cars approaching the accident scene must be less than the time of the police car reaching the accident scene, denoted t p , and Ψ must be less than the length of the shortest path S, because the police car does not have free space for driving if the shortest path is filled with cars. We assume that all coordinates have 1-m intervals so that t i and t p can be calculated easily. Based on the RLD algorithm and the knapsack problem concept, we combine RLD with DP for roadside assistance. Therefore, we proposed the RLD-based Roadside Assistance (RLD-RA) algorithm (Algorithm 2).

figure b

With DP, R1 and R2 can be represented by two possibilities that whether car c i can be placed in front of the police car. R1 represents that c i has been put into knapsack K, and R2 represents that c i has not been put into knapsack K. \(T_{i} \times T^{\prime }_{j}\) represents the probability that neighbor cars pass the accident scene as long as the accident occurred in the i-lane. Accordingly, \(Min(T_{i} \times T^{\prime }_{i})\) is a necessary condition to filter vehicles who rarely pass this location. The minimum cumulative time t m i n increases when a car is added to S. When no more cars can be added to K, t m i n maintains the status quo. In other words, if there are additional cars with slower speed join to K, this road cannot serve more cars; thus, t m i n must be updated by m a x(t(K)) each time. m a x(t(K)) represents that the needed maximal time of one of a car who has joined in the K. This process is terminated when K has no further space. In this moment, emergency messages will sent to K’s complement K c which represents that other than the cars in K, all the cars will receive emergency messages. Then, cars that cannot be added to K will receive a new recommendation according to T. Finally, we can obtain K, which represents the best permutation; thus, the police car will not be hindered and road usage efficiency is increased.

4 Simulation

4.1 Simulation settings

The simulation was performed using MATLAB (version 7.11, R2010b). The detailed parameters are given in Table 7. In this simulation, there are four crossroads in the simulated area; thus, there are four RSUs. All vehicles are distributed in a normal distribution. Each road is a two-way street with six lanes (three lanes each way). The simulation scenario is shown in Fig. 4.

Fig. 4
figure 4

Simulation scenario

Table 7 Simulation parameters

4.2 Simulation results

Figure 5 shows a short-term simulation. When the number of vehicle is 10, RLD reduces 70% of messages compared to the traditional flooding method. As can be seen, RLD has the highest ratio of sending messages when there are 10 vehicles. This is attributed to the fact that there are fewer neighbor vehicles; thus, the RSUs cannot accurately predict due to the higher value of d (n e a r e s t). However, it is still superior to the traditional method. To validate that the RLD method will not miscalculate while reducing the number of messages, two scenarios are defined.

  1. 1.

    The car needs to receive emergency message but does not.

  2. 2.

    The car does not need to receive emergency message but does.

Fig. 5
figure 5

Number of sent messages

The false positive ratio and false negative ratio are shown for these two cases. Therefore, we can observe whether emergency messages are used efficiently.

As can be seen in Fig. 6, the false positive ratio of the traditional flooding method was 0% because the flooding concept allows all neighbors to receive a message regardless of whether they actually need the message. The RLD method yields a 30% false positive ratio with 10 vehicles because RLD is based on a Markov model; thus, it requires more vehicle state information to calculate the transition matrix. This means that miscalculation will occur when the difference of every P i j is too large. However, this is acceptable because it is difficult to cause traffic congestion with only 10 vehicles in a three-lane street. The false negative ratio of RLD decreases when the number of vehicle increases.

Fig. 6
figure 6

False negative ratio

Figure 7 compares the false negative ratios of the proposed and traditional methods. The ratio of cars passing the accident scene was set to 80%; thus, the traditional flooding method sends more than 20% messages in the low-density scenario. When the number of vehicle increases, the false negative ratio of the traditional flooding method increases severely (even exponentially). Because road space is limited so that the transmission range of RSU can cover more cars. The flooding method is a multi-hop scheme; thus, nearly all cars will receive the emergency message in the high-density scenario. It can be observed that the RLD false negative ratio increases slightly when the number of vehicles is greater than 60. This is attributed to the fact that vehicles cannot change lanes easily because road space is occupied. As a result, vehicles can be incorrectly considered as moving straight even if some want to move to the left or right lanes. However, this increase with the proposed RLD method is very slow. This validates that the proposed method is very effective.

Fig. 7
figure 7

False positive ratio

To verify the feasibility of the proposed method, we simulated an accident event on the left side. Here the vehicle distribution model is the same as that of the three-lane case. As can be seen in Fig. 8 state 1 is fewer than other states. This indicates that the proposed can successfully guide vehicles to other routes. In other words, the proposed method does not produce too many misjudgments due to the large reduction in the number of messages.

Fig. 8
figure 8

Markov process of the proposed method

Figure 9 compares the RLD and RLD-RA methods relative to roadside assistance efficiency. Here, the y-axis is the police car speed. Note that higher police car speeds are considered more efficient for roadside assistance. With the proposed method, cars in the shortest police car path can be directed to other lanes; thus, roadside assistance efficiency will increase. Note that, here, the maximum speed of a police car is set to 100 k m, which is much faster than the speed of general cars. Such a design can test whether cars will actually be evacuated. In addition, vehicle density affects police car speed; however, this influence is not a linear phenomenon because the number of cars in front of the police car depends on the length of the shortest path. Therefore, we designed six shortest path lengths, i.e., 100, 300, 500, 700, 900, and 1100 m.

Fig. 9
figure 9

Comparison of police car speed with different shortest path length

When the length of shortest path is set to 100, 300, and 500 m, the speed of the police car will decrease with an increasing number of vehicles. This is attributed to the fact that the shortest path has higher probability to be congested. When the shortest path length is 700 m, the police car speed is not affected significantly. With a fixed number of vehicles, there is sufficient space to place more cars on the shortest path. In other words, these cars have more opportunity and time to change lanes. According to this observation, we found that the slope of the curve will be smaller if the shortest path is sufficiently long. Such cases are a continuous process. Without loss of generality, traffic is most congested near an accident scene. This means that vehicles approaching the accident scene must be redirected. However, the RLD method cannot overcome this problem. Thus, compared to the RLD-RA method, the RLD method reduces the speed of the police car. Furthermore, they always encounter situations where in they are unable to move earlier.

5 Conclusion

Vehicular technologies are continuously updated to make life more convenient; however, such advances are accompanied by an increasing number of traffic accidents. Although current techniques can relieve traffic congestion, such methods incur huge network bandwidth bottlenecks at RSUs. We have proposed the RLD algorithm, which accurately sends emergency messages to vehicles that must pass the accident scene. In addition, the RLD-RA algorithm was proposed to help police cars and ambulances arrive at the scene quickly. Simulation results show that the proposed method reduces unnecessary message transmission and provides a stable transportation environment. Real-world scenarios are more complex; thus, in future, various metrics must be considered, e.g., vehicle destination, traffic signs, and the various functions of a vehicle. Therefore, a first-order Markov chain may not be able to deal with such a complex environment. Thus, in future, we will consider adopting a multi-order Markov chain to achieve better performance.