{'fraction_non_alphanumeric': 0.02821792923811591, 'fraction_numerical': 0.008291729976123291, 'mean_word_length': 4.313956170703576, 'pattern_counts': {'":': 0, '<': 1, '<?xml version=': 0, '>': 2, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Analysis of risk levels for traffic on a multi-lane highway

We present an analysis of risk levels on multi-lane roads. The aim is to use the crash metrics to understand which direction of the flow mainly influences the safety in traffic flow. In fact, on multi-lane highways interactions among vehicles occur also with lane changing and we show that they strongly affect the level of potential conflicts. In particular, in this study we consider the Time-To-Collision as risk metric and we use the experimental data collected on the A3 German highway.


INTRODUCTION
The analysis, the prediction and the control of critical traffic situations are important aspects of the modern world. In fact, with the increase of the number of circulating vehicles the risk of accidents is considerably increased. See the recent report World Health Organization (2015). Therefore, the necessity of forecasting e.g. the evolution of the flow as well as of the potential risks has arisen. These problems have motivated research both in the mathematical and in the engineering literature.
From the mathematical point of view, the analysis of traffic critical situations is carried out by means of mathematical models at different scales. Microscopic, macroscopic and kinetic simulations provide useful tools to study e.g. the links among traffic volumes and safety issues as well as the creation of shock or stop-and-go waves, which represent typical effects of instabilities and thus of potential risks in the flow. See e.g. Moutari et al. (2013); Moutari and Herty (2014); Freguglia and Tosin (2017) In contrast, engineering studies on the risk levels in traffic flow are mainly based on a-posteriori descriptions of collected real data on roads. In this field experimental measurements are used to study the evolution of the safety indicators related to traffic. See e.g. Minderhoud and Bovy (2001); Kuang et al. (2015bKuang et al. ( , 2017; Wang et al. (2017) Among these we recall the Headway Distribution, the Time-To-Collision or the Aggregated Crash Index.
In this paper we are aimed to take into account an intrinsic characteristic of traffic flow which is however usually neglected in the study of risk levels: the lane changing. We will focus in particular on the Time-To-Collision metric and we generalize the definition also for the direction This work has been supported by  orthogonal to the flow of vehicles. The Time-To-Collision indicator is defined as the remaining time until a collision between two vehicles would have occurred. For each pair of interacting vehicle, the complete formulation of the Time-To-Collision is given by (1) where ∆x, ∆v and ∆a are the relative distance, speed and acceleration of the two vehicles. Here, we will study also the lateral safety by comparing it with the classical notion of the Time-To-Collision indicator concerning only the longitudinal driving tasks. The aim is to understand which direction of traffic flow influences mainly the safety level of a multi-lane road. This will be therefore an aposteriori analysis based on experimental data collected on a German highway. At the same time we will give a macroscopic approximation of the Time-To-Collision indicator in order to show a link among the risk metric and the evolution in time of traffic volumes, giving also a hint on how macroscopic equations can be used for realtime predictions of safety measures.
In detail the paper is organized as follows. In Section 2 we describe the German data-set recovering, from the microscopic quantities, the macroscopic data which lead to the fundamental diagrams of traffic. In Section 3 we define the meaning of a car-following scenario on a multi-lane road and we define the Time-To-Collision risk indicators for the two directions of the flow. We further give a macroscopic approximation of the risk metric. In Section 4 we show the analysis of the risk levels on the German highway comparing the result obtained by considering separately the flow along the road and across the lanes. Finally, we end in Section 5 summarizing the result of the paper and giving an outlook for future research.

EXPERIMENTAL DATA COLLECTION
In this paper we consider a set of experimental data recorded on a German highway. We have two-dimensional trajectory data collected on a 80 meters stretch of the westbound direction of the A3 highway near Aschaffenburg. Laser scanners detect the two-dimensional positions P i (t) = (x i (t), y i (t)) of each vehicle i at time t on the road segment with a temporal resolution of 0.2 seconds for a total time of approximately 20 minutes. Here the position x is in driving direction, the position y is across lanes. During the time observation, the laser scanners record the trajectories of 1290 vehicles.
The road section consists of three lanes and an outgoing ramp. However, we only consider the stretch as if there is no ramp. In fact, the data show that the flow on the ramp does not influence the traffic conditions, namely the amount of traffic on the ramp is not significant. Taking into account only the three main lanes, the road width is 12 meters.
The microscopic velocities of vehicles are recovered by the knowledge of their positions P i (t) = (x i (t), y i (t)) at each time. Since the road section is relatively short, we compute the velocity, both in x-and y-direction, of each vehicle by using a linear approximation in the least squares sense of x i (t) and y i (t), respectively. In other words we assume that the vehicle velocity is constant during the crossing of the road section and is exactly the slope of the linear fit. The maximum detected speed in x-direction is about 120 kilometer per hour which means about 2.7 seconds to travel the 80 meters of the road section. Instead, the maximum detected speed in y-direction is about 2 kilometer per hour which means about 21.6 seconds to travel the road section from a side to the other side.
The time-dependent microscopic positions and the microscopic velocities of vehicles can be used to compute the macroscopic quantities, namely the density (measured as number of vehicles per kilometer), the flux (measured as number of vehicles per hour) and the mean speed (measured as kilometer per hour) of the flow. We refer to Herty et al. (2017a) for a detailed description, where we derived the macroscopic data for each direction of the flow, separately.
The diagrams showing the relations between the vehicle density ρ and the fluxes or the mean speeds in the two possible directions are called fundamental diagrams and speed-density diagrams, respectively. They represent the basic tools for the analysis of traffic problems operating in a homogeneous steady state or equilibrium conditions.
In Figure 1 we show the fundamental diagrams and the speed-density diagrams resulting from the German dataset. The diagrams are obtained by computing the macroscopic quantities each 1 second and then aggregating the data over a time period of 60 seconds. The data-set pro-  vides several levels of congestion but we never observe bumper-to-bumper conditions. In fact, the maximum density is about 70 vehicles per kilometer. The red solid lines in each panel of Figure 1 show the best data-fit obtained by solving a constrained minimization problem. See Herty et al. (2017a) for further details.
Notice that the flux and the speed in y-direction have positive and negative values since across the lanes vehicles are free to travel in the two directions, towards right and left. Precisely, we assume that positive speeds represent the motion towards the leftmost lane, instead negative speeds represent the motion towards the rightmost lane. The values of the flux and of the mean speed in y-direction are about 10 3 smaller than the values in x-direction. This is obvious since the velocity of vehicles along the road is higher then the lateral velocity and thus this latter is not dominant with respect the other speed. In other words, we are looking at two behaviors occurring at different scales. But this does not mean that the behavior in y-direction can be neglected and that the flow across the lanes does not influence the safety. In fact, an analysis of the trajectories shows that about the 15% of the total vehicles crosses a lane while traveling the road section. See Figure 2.

RISK ANALYSIS ON A MULTI-LANE ROAD
Several metrics were introduced in order to study risk levels in traffic flow scenarios. Among them, here we will Fig. 3. Choice of the interacting car in the case v i > 0. The interacting vehicle will be car 2, namely the nearest vehicle in the driving direction of vehicle i.
consider the so-called Time-To-Collision (TTC) metric.
The TTC can be defined as the remaining time until a collision between two vehicles would have occurred, see Hayward (1972). The notion of TTC represents the most used indicator in the analysis of safety measures for traffic.
In the literature, the TTC metric is usually used by considering one-dimensional car-following scenarios and thus it is computed by looking at only the positions along the road, as well as the velocities in x-direction, of the two interacting vehicles. Here, instead, we are aimed at studying the risk levels on a multi-lane highway, thus using two-dimensional microscopic data. Therefore, we firstly need to define the concept of a car-following interaction in two-space dimensions and we use the same approach introduced in Herty et al. (2017b).
We assume that there is no particular order among vehicles on the road. We just label them. From now on, let u i and v i be the speeds in x-direction and y-direction, respectively, of car i. For each vehicle i, the interacting car j(i) is determined by the following map This choice is motivated as follows, see also Figure 3. Assume that each test vehicle i defines a coordinate system in which the origin is its right rear corner if v i ≥ 0 and its left rear corner if v i < 0. We are indeed dividing the road in four areas. Let θ h be the angle between the x-axis (in the car coordinate system) and the position vector Q h of vehicle h. Then the request θ h ∈ − π 2 , π 2 allows to consider only cars being in front of vehicle i. Instead, the request v i sin θ h > 0 allows to consider only cars in the driving direction of vehicle i. Among all these vehicles we choose the nearest one. Therefore, map (2) can be rewritten as

Time-To-Collision and Individual Risk
Map (3) allows us to define the car-following scenarios on a two-dimensional road section for each observation time.
Here, we are interested in generalizing the TTC metric (1) for car i in each direction of the flow by looking at the same interacting vehicle j(i). However, since in Section 2 we have described the trajectory of all vehicles with a linear function approximating the time positions in the least-square sense, the acceleration is supposed to be zero. Therefore, we consider a simplified version for the TTC and along with the classical definition of the TTC in xdirection in this paper we introduce also the TTC in y-direction as (5) The TTC y i defines thus the remaining time to a collision with car j(i) moving across the lanes. The analysis of this metric was never considered previously in the literature but we think it is useful to study which direction of the flow mainly influences the safety. Clearly, using map (3), a car i could have no leading vehicles, namely when there are no obstacles in its driving direction. Then we set the two TTC metrics to +∞ also in this case.
The TTC metric has been widely used in order to evaluate the risk level in traffic flow phenomena. However, as suggested by several authors, Kuang et al. (2017), the TTC does not give direct information on the safety conditions of vehicle. Moreover, the fact that the TTC is +∞ when an interaction does not occur makes this metric not suitable for computations from microscopic data. Therefore, in this paper, following the methodology introduced in Kuang et al. (2017), we represent the Individual Risk (IR) described by the TTC by comparing, for each car, this value with thresholds: The fixed values TTC x,y are the TTC thresholds in the two direction of the flow and they are supposed to be the safety values below which an interaction is considered unsafe. Using definition (6) then a car-following scenario is considered to be safe if the IR is low. Several value of the TTC threshold are proposed, see e.g. Minderhoud and Bovy (2001); Kuang et al. (2015a,b). Here, we consider safety values the times to travel the road section in x and y at the maximum speeds detected in the two directions. Thus, using the German data-set introduced in Section 2 we have TTC x = 2.7 seconds, TTC y = 21.6 seconds.
With this choice we say that a vehicle is in safe conditions if it can freely travel along and across the road at the maximum speed.
In order to aggregate the individual risk of single carfollowing scenarios we proceed as follows. First we fix a sequence of M + 1 equally spaced discrete times {t k } M k=0 such that t k+1 − t k = dt, t 0 = 0 and t M = t max , where t max is the final observation time in the data-set (here 20 minutes). Then, for each discrete time t k , we count the number of vehicles N (t k ) and for each one we find the interacting vehicle using (3). We define the individual risk at time t k as IR x,y where IR x,y i is given by (6). Finally, we consider a moving mean by aggregating with respect a certain time period T , with T t max and including m consecutive observations. This temporal average leads to M +1 (7) In particular, in this paper we take dt = 1 second and then we aggregate the data over the time period T = 30 or T = 60 seconds.

Macroscopic formulation of TTC
Here we show, from a mathematical point-of-view, that the TTC is indeed able to describe the safety levels of a road since it is linked to the variation of the traffic volume. For the sake of simplicity, let us to focus on the simple onedimensional case and thus we assume to have TTC y i = 0, ∀i. We define the density and the specific volume around each vehicle at time t as where ∆X is the characteristic length of a vehicle. Differentiating τ i in time, we have that the variation of the specific volume is given bẏ Let us again to consider the simplified version of the TTC (4), namely we assume that the velocity of each car on the road is constant while traveling the road section. Using the same considerations introduced in Herty et al. (2017b) in order to derive macroscopic models from particle models, we can identify the microscopic velocities u i with a function u out of the discrete dynamics in such a way u i = u(x i ), ∀i. Moreover, at the same time we can identify τ i with a function τ out of the discrete dynamics in such a way τ i = τ (x i , t). With these considerations we can write d dt .
Since we are interested in the macroscopic formulation, i.e. when the number of vehicles becomes larger, it is quite natural to assume that ∆X ≈ x j(i) −x i . In the macroscopic limit we consider the limit for ∆X going to zero and thus we obtain .
In other words, the inverse of the TTC is able to describe the time evolution of the specific volume and therefore this in turn means that there is a strict link between the safety and the congestion level of the road. This result can be easily extended also to the two-dimensional case, using the considerations introduced in Herty et al. (2017b). In addition, the above result paves the way to a possible realtime analysis of the potential conflicts on a road by means of macroscopic models.

POTENTIAL RISK ON THE GERMAN HIGHWAY
In this section we show that, at least using the German data-set, the safety on a multi-lane highway seems to be highly influenced by the movements in the orthogonal direction of the flow, i.e. by the lane changing.
In Figure 4 we consider the time behavior of the aggregated individual risk (7) In this way the individual risk is directly comparable and quantities (8)  Thus, values below zero (see the dashed red line) mean that the individual risk in y-direction is higher than the individual risk in x-direction. Using this plot we can easily observe that the normalized individual risk IR y is higher in connection to the peaks of the density. This behavior can be explained by the fact that more lane changing occur when the density increases.
The above consideration can be also quantitatively analyzed by using a methodology used e.g. recently in Kuang et al. (2017) and which consists in dividing the aggregated values of the individual risk into many traffic states, sorted by the density, with uniform span. With this approach it is possible to analyze easily the relationship between traffic risk and traffic states. The following procedure allows us to divide the aggregated macroscopic data into many traffic states, sorted by the density.
Step 1 Rank all the M +1 m + 1 observations of the individual risks according to the related value of the density, from the lowest to the highest.
Step 2 Count the total number n of intervals for those density observations with a constant span δ. Thus, n = round ρ max − ρ min δ where ρ max and ρ min are the maximum and the minimum value of the density computed from the data-set.
Step 5 Finally, compute the Average Risk (AR) value for each interval as AR x,y n = CR x,y n N n , n = 1, . . . , n.
The same procedure described above can be used to sort the traffic states with respect to the other macroscopic fundamental quantities, as the speeds and the fluxes. In the following simulations, in place of the average risk AR x,y we will consider the normalized average risk defined as AR x,y n = AR x,y n TTC x,y , n = 1, . . . , n in order to make comparable the quantities in the two directions of the flow. In Figure 5 we show the normalized average risk AR x and AR y computed on the traffic states sorted by the density as described by the previous procedure. In particular, the traffic states are obtained by using δ = 2.5 vehicles per kilometer, which represents the minimum value of span to get at least one observation for each interval defined in Step 3. The left and the right panels of Figure 5 differ for the time aggregation, which is taken as T = 60 seconds and T = 30 seconds, respectively. We observe that the result does not change by varying T . In fact, in both panels we observe that the average risk increases as the traffic density increases. This means that a higher density influences the safety and leads to more conflicts. Moreover, the two average risks are comparable when the density is still low, while for higher values AR y becomes larger than AR x proving that the traffic conflicts are mainly due to the interactions in y-direction, thus regarding lane changing.
The above consideration is explained also by Figure 6 and Figure 7 in which we show the normalized average risk AR x and AR y computed on the traffic states sorted by the two speed in the two directions of the flow. We take here δ as 7.5 and 0.05 kilometer per hour, respectively. We observe that the risks decreases as the speed along the road increases, i.e. when the density is low and thus vehicles are free to travel with higher speeds. More significant is Figure 7. In fact, we notice that the risk in x-and ydirection is low for negative values of the lateral speed. This happens when the density is low and vehicles tend to reach the slowest lane. In contrast, the risk in AR x increases and is higher than AR y around the zero values of the lateral speed, i.e. when the lane changing are rare and the conflicts mainly happen with cars ahead. On the opposite side, when the lateral speed becomes positive, i.e. when the higher values of the density induce vehicles to overtake and to move from the slowest lane, then the average risk in y-direction increases substantially. This behavior again proves that the flow in y-direction affects the traffic safety more than the interactions occurring along the road.
Finally, in Figure 8 we again show the average risk computed on the traffic states sorted by the density but for each state we map the AR value to the corresponding position on the speed-density curve in x-direction obtained by fitting the experimental data. In the left panel of Figure 8 we show AR x , while in the right one we consider AR y . We use the AR value to determine the size and color of each point. The bigger size and darker color indicate the higher average risk of a traffic state. Obviously, as observed in Figure 5 and Figure 6, the traffic conflict risk increases with an increase in density and a decrease in speed. Moreover, we notice that the average risk tends to increase substantially when the so-called critical density, namely the density value in which we have a sharp decrease in the speed, is reached.

OUTLOOK
In this work we have proposed an analysis of the risk on a multi-lane highway by means of a suitable indicator and studying separately the potential conflicts that could arise from the two direction of the flow. To this end, we have used the Time-To-Collision indicator, which represent the remaining time to avoid a collision between two vehicles. The aim of this paper was to investigate the influence of the lane changing on the traffic safety since only the behavior of the flow along the road was previously considered in the literature. The analysis is carried out using a data-set collected in Germany on the A3 highway. The microscopic trajectories shows that the lane changing is an important behavior in traffic flow and thus the safety can be highly influenced by the movement in the orthogonal direction of the motion of vehicles. This conjecture has been indeed proved by comparing the Time-To-Collision indicators in the two flow directions, showing that the potential conflicts arising by the lane changing are much higher.
In future works, more data can be collected or a different data-set can be considered. Moreover, the analysis conducted here shows the necessity of establishing suitable safety measures having a real impact on the potential risk on multi-lane highways where the flow across the lanes is high. To this end the macroscopic formulation of the Time-To-Collision indicator proposed in this paper could help to develop real-time models to manage safety measures in traffic flow. Ideally, one would measure online traffic data, predict the next minutes of traffic flow and indicate with the macroscopic formulation of risk metrics the likelihood of an accident. Then, by variable speed control or other measures one would try to regulate the traffic flow such that the the Time-To-Collision metric is reduced under the same simulation. Another possibility is the planning process in which we would simulate (e.g. by means of a simulator) a real traffic road and then show the risk indicators. Hopefully, by clever designs of the road the potential conflicts can be reduced. This perspective could be used to plan e.g. construction sites more efficiently.