Optimal Paths on Urban Networks Using Travelling Times

We deal with an algorithm that, once origin and destination are fixed, individuates the route that permits to reach the destination in the shortest time, respecting an assigned maximal travel time, and with risks measure below a given threshold. A fluid dynamic model for road networks, according to initial car densities on roads and traffic coefficients at junctions, forecasts the future traffic evolution, giving dynamical weights to a constrained K shortest path algorithm. Simulations are performed on a case study to test the efficiency of the proposed procedure.


Introduction
Traffic congestion on networks occurs in presence of an excess use of vehicles on a portion of roadway and is characterized by stopped or stop-and-go traffic, slower speeds, longer trip times, and increased queueing.Incidents (such as accidents or even a single car breaking heavily in a previously smooth flow) may cause ripple effects which then spread out and create a sustained traffic jam.The presence of hard congestions on urban networks provoke delays, which may result in late arrival and interference with emergency vehicles passage to reach their destinations.The shortest path is not often the less congested one and/or the most safe one, so it is crucial to forecast travel times and to find the shortest path taking into account the traffic conditions and the risks along the path.
Finding the K shortest paths is a classical network optimization problem and it has a great practical interest, with a wide variety of real world applications, such as transport, communication, and distribution networks, for which finding alternative paths plays an important role, in particular when some nodes are temporarily unreachable through the optimal route, because some links are obstructed or unavailable.
In such a context, we propose an algorithm that, once an origin o and a destination d on a graph are fixed, identifies the path that connects o and d and minimizes fore-casted travel times, satisfying a maximal travel time and a maximal accepted risks threshold.In particular, following [1] and considering additional constraints on risk levels and dynamical travel times, we use a particular extension of the generic label-correcting method for solving the classical single-origin all-destinations shortest path problem (see, e.g., [2,3]).The aim is to satisfy the user request: a driver could prefer a route with minimal travel time even if the trip is not safe, a longer but with no risks trip, or a safe and short path.
Here the travel times are estimated using a fluid dynamic model (see [4,5]), where the cars evolution on each road is given by a conservation law [6][7][8], while the dynamics at junctions is uniquely solved adopting the following rules: the incoming traffic at a node is distributed to outgoing roads according to some fixed distribution coefficients; drivers behave so as to maximize the flux through the junction.A further rule (yielding criterion) is needed if the number of incoming roads is greater than that of outgoing ones.
The algorithm, that allows to identify the optimal path, is as follows.Fix an origin o and a destination d in a road network graph.From the initial densities on roads, we predict future densities and then travelling times on all network roads.The latter are the weights of a Constrained K-Shortest Paths algorithm (CKSPa).Using a further procedure (analyzed in [9]), that computes the trajectory of a car on a network, we compute the time t 1 at which a car reaches the successive node s 1 .At t 1 , if the current density conditions are different from the forecasted ones, average density values on roads are computed invoking again the simulator with new initial conditions and the new densities are used as weights (travel times) that the CKSPa needs to select the optimal arc among those outgoing from s 1 .The time t 2 a car needs to cover the latter arc is computed; at t 2 , new weights are obtained by the density values and the CKSPa indicates the new arc of the optimal path; and so on, until the destination o is reached.
The goodness of this procedure is studied via simulations (numerics are obtained using [10][11][12]).We consider the case study of a portion of the Caltanissetta urban network, in Italy, and determine through the CKSPa the optimal route connecting an origin o and a destination d.It is shown that the time to cross the optimal route is lower than times needed to cover all the other possible paths joining o and d.Notice that the optimal path is time-variable, as weights continuously change due to the densities evolutions on road.Hence different paths are found if the travel starts in different times with different traffic conditions.
We remark that the fluid dynamic model needs real traffic data as initial densities on the road network in order to obtain simulations reproducing real phenomena.Then, the idea is to get data detected by special sensors installed in some points of each road or by databases containing traffic information.A procedure to reconstruct the initial density by detected real traffic data and to calibrate the fluid dynamic model is shown in [13].
The paper is organized as follows.Section 2 reports the model for urban networks, giving details about the construction of Riemann Solvers at junctions and numerical schemes for densities on roads.In Section 3, the Constrained K-Shortest Paths Problem is described.The integration of the fluid dynamic model and the CKSPa is presented in Section 4. Finally Section 5 deals with simulations for the case study.The paper ends in Section 6 through conclusions.

Fluid-Dynamic Traffic Flow Model
A road network is described by a couple (I, J), where I is the set of roads, modelled by intervals [a i , b i ] ⊂ R, i = 1, . . ., N, and J the collection of junctions.On each road, the traffic evolution is given by the conservation law: where ρ = ρ(t, x) ∈ [0, ρ max ] represents the cars density, ρ max is the maximal density, while f (ρ) = ρv(ρ) is the flux with v(ρ) the average velocity.We assume that Choosing a decreasing velocity function v(ρ) = v max (1 − ρ/ρ max ), ρ ∈ [0, ρ max ], and setting v max = ρ max = 1, a flux function ensuring (F) is which has a unique maximum σ = 1/2.Dynamics at junctions is described solving Riemann Problems (RPs) and Cauchy Problems with a constant initial datum for each incoming and outgoing road (see [4,5]).
If m ≥ n, a possible RS at J is defined by the following rules: (A) Car traffic is distributed at J according to some coefficients, collected in a traffic distribution matrix The ϕ column of A indicates the percentages of traffic that, from the incoming road I ϕ , distribute to the outgoing roads.Assuming an initial datum ρ 0 and the flux function (2), the solution ρ = f −1 ( γ) to the RS at J is defined by where τ :

Riemann Solvers.
Focus on a junction J of n × m type.We indicate the cars density on incoming and outgoing roads, respectively, by From condition (C2), fixing the flux function ( 2) and assuming ρ 0 = (ρ 1,0 , . . ., ρ n,0 , ρ n+1,0 , . . ., ρ n+m,0 ) as the initial datum of an RP at J, the maximal flux values on roads are defined by (4) For a 1 × 1 junction, with incoming road indicated by 1 and outgoing one by 2, the flux solution to the RP at Consider a 1 × 2 junction and label the incoming road by 1 and outgoing roads by 2 and 3.If α ∈ ]0, 1[ and 1 − α indicate, respectively, the percentage of cars that, from road 1, goes to the outgoing roads 2 and 3, the flux solution to the RP at , where Junction.Fix a 2 × 1 junction and indicate by 1 and 2 the incoming roads, and by 3 the outgoing road.In this case, we have only a right of way parameter, p. Since, from rule (B), the aim is to maximize the through traffic, we set Introduce the following conditions: 3 , we have the following: (i) γ = (pγ max 3 , (1 − p)γ max 3 , γ max 3 ), when (A1) and (A2) are both satisfied; , when (A1) is satisfied and (A2) does not hold; , when (A1) is not satisfied and (A2) holds.
Conditions (A1) and (A2) are never both false, otherwise 2.1.4.A 2 × 2 Junction.For a junction of 2 × 2 type, with incoming roads 1 and 2, and outgoing roads 3 and 4, the traffic distribution matrix A assumes the form: where α 3,1 and α 3,2 are the probabilities that drivers go, respectively, from road 1 and road 2 to road 3 and Let us suppose that α 3,1 / = α 3,2 in order to ensure uniqueness of solutions.
From rule (A), it follows that From rule (B), we have that the incoming fluxes γ ϕ , ϕ = 1, 2, are solutions of the linear programming problem max (γ 1 + γ 2 ), with 0 Observe that, for all the examined junctions types, once γ is known, ρ is found by (3).

Numerical Approximations.
To construct numerical approximations for the density ρ(t, x), whose evolution is ruled by (1), we apply the Godunov scheme (see [10][11][12]).Assume the flux (2).We introduce a numerical grid with (i) Δx being the space grid size on each road I i ; (ii) Δt being the time grid size on the time interval [0, T]; (iii) L and M, respectively, being the number of time and space nodes of the grid; (iv) (t l , x m ) = (lΔt, mΔx), for l = 0, 1, . . ., L and m = 0, 1, . . ., M, being the grid points.
Using the notation ρ l m = ρ(t l , x m ), the Godunov scheme is expressed as follows: where Δt and Δx satisfy the CFL condition Δt ≤ Δx/2, and f G (u, v) is the numerical flux given by Boundary conditions are imposed for incoming roads not linked on the left and outgoing roads not linked on the right.In particular, for roads connected at the right endpoint, the interaction at a junction is given by while, for roads connected at the left endpoint, we have where γ ϕ and γ ψ are the fluxes, respectively, on incoming and outgoing roads, computed using RSs at junctions.

Constrained K-Shortest Paths Problem
Consider a road network (I, J) and an integer K > 1.
Assigned an origin o and a destination d, according to the user profile and hence the available travelling time and the maximal accepted risk, the problem of finding K Modelling and Simulation in Engineering alternative paths from o to d is known as Constrained K-Shortest Paths Problem, CKSPP.In particular, we refer to a specified constraints class, the Recursive Path Constraints, RPC, which considers more arcs in one time, evaluating their admissibility, conditioned on the presence of previous arcs in the path.We deal with a modification of the study proposed in [1], taking into account (i) an origin o and a destination d; (ii) a maximal number K max of paths to generate; (iii) time instant in which the request by the user occurs; (iv) predicted travel times t i j , dependent on the day hours, for the arc I = (i, j) ∈ I, that connects nodes i and j belonging to J; (v) risk r i j for the arc I = (i, j) ∈ I, joining nodes i and j in J; the risk measure goes from 0 (extremely safe) to 10 (extremely unsafe); (vi) a maximal time T to complete the path; (vii) a maximal risk level R.
The aim is to individuate K paths (K ≤ K max ) from the origin o to the destination d which minimize the travelling time, under constraints on the maximal path time and the risk level.We indicate by r (k) j the risk to reach the node j through the k-th path P (k) , by w (k)  j the number of occurrence of node j in the k-th path, and by d (k)  j an upper bound for the length of the k-th path from the origin o to the node j.
A k-th path is admissible if r (k) j ≤ R and w (k) j ≤ 1 for all j ∈ J.
In what follows we use the following dominance criterion: let 1 and P (k) 2 be two k-th paths to which labels (d (k) 1 , r (k) 1 , P (k) 1 ) and (d (k)  2 , r (k) 2 , P (k) 2 ) are associated.Then, P (k) 1 dominates 1 |; at least one inequality is satisfied in strict sense.
We report the pseudocode of the proposed algorithm.Initially, For all ξ = 1, . . ., K max , (1) remove a node i from J (ξ) ; set Erase the paths (d (k) j , r (k) j , P (k) ), k = k+1, . . ., k, dominated by (d (k)  j , r (k) j , P (k) ), where k is the greatest index such that k ≤ k, and d ( k) j < ∞.Update in coherent way d (k)  j , r (k) j , and w (k) j for all k such that (d (k)  j , r (k) j , P (k) ) is not dominated; (b) if set Erase the paths (d (k) j , r (k) j , P (k) ), k = k+1, . . ., k, dominated by (d (k)  j , r (k) j , P (k) ), where k is the greatest index such that k ≤ k, and Update in coherent way d (k)  j , r (k) j , and w (k) j for all k such that (d (k)  j , r (k) j , P (k) ) is not dominated; for all k = k, . . ., k + 1: if (d (k)  j , r (k) j , P (k) ) has been erased, remove j from J (k) ; otherwise, if j / ∈ J (k) , add j to J (k) . ( According to the node selection policy adopted in Step 1, a label setting method is used (see [1]), in which, at each iteration, the node i exiting J (ξ) , ξ = 1, . . ., K max is the node with the minimum label.Due to the assumption of the nonnegative arc lengths, node i, once removed, has a permanent label value.

Integration of Traffic Flow Simulator with CKSPa
Fix an origin o and a destination d in a urban network graph.The optimal route, joining o and d, is found using the CKSPa and weighting the arcs with travel times.
As risk coefficients we consider earthquakes, high accidents rate, landslides, floods, high crime zones, and so forth.
To each arc we associate a risk, given as the average value on all risk parameters related to the arc with values ranging from 0 to 10.The latter are obtained from historical series.
Variable travel times are computed using the fluiddynamic model.Fixing the arc I = (i, j) ∈ I, that connects nodes i and j belonging to J, the time to cross I, namely, the weight t i j , follows the relation: with v(ρ I ) = 1 − ρ I being the velocity and L I being the length of I.
Since the traffic conditions can change during the trip, when the passenger is near a junction, a new simulation is invoked if current densities are different from those predicted by the model.The time in which a single vehicle reaches the junctions is estimated considering that the position of the car driver, x = x(t), along a arc is obtained solving the Cauchy problem: where x in is the initial position at the initial time t in (see [9]).
For finding the optimal route on the network in a generic time instant t 0 , the CKSPa individuates, among all possible arcs exiting from the origin o, the arc I ψ with minimal travel time t oψ (t 0 ) connecting o with the node ψ.The second arc of the optimal path is found estimating the time t 1 a car needs to cross the arc I ψ according to (17).At the time instant t 1 , arc weights are updated using (16) invoking a new simulation if it is necessary and the CKSPa indicates, among all arcs exiting from the node ψ, the arc I ψ , that connects the nodes ψ and ψ with weight t ψψ (t 1 ).The time t 2 a car needs to cover I ψ is computed again using (17); at t 2 , new arc weights (if it is necessary) are obtained and the CKSPa determines the new arc of the optimal path; and so on, until the destination d is reached.
Notice that the choice of the initial time t 0 strongly influences the evolution of the optimal path.This is a direct consequence of the temporal evolution of densities on arcs.The analysis of the various paths is made considering six different simulation cases whose characteristics are the following.
Case A. Initial conditions are zero for all roads (namely empty network); boundary data: 0.1 for road 35; 0.2 for roads 1, 5, 40, 47, 52, and 57; 0.4 for road 24, 69, and 83; 1 for all outgoing roads; and maximal time T and maximal risk level R equal to 200 and 100, respectively.Case B. Initial conditions are zero for all roads; boundary data: 0.1 for road 35; 0.2 for roads 1, 5, 40, 47, 52, 57, 69, and 83; 0.4 for roads 24; 1 for all outgoing roads; and maximal time and maximal risk as in Case A.
Case C. Initial conditions are zero for all roads, with the exception of roads 70, 71, 76, and 82 with initial datum 0.3; roads 67 and 68, for which the initial datum is 0.4; roads 9, 11 and 12 with initial datum 0.7; boundary data: 0.01 for roads 47, 52, and 57; 0.1 for road 35; 0.2 for roads 1, 5, and 40; 0.3 for roads 69 and 83; 0.4 for road 24; 1 for all outgoing roads; and maximal time as in Case A and maximal risk level R = 400.
Case D. Initial conditions are zero for all roads, with the exception of roads 13 and 15 with initial datum 0.5; roads 9, 11, and 12, for which the initial datum is 0.7; roads 18, 19 and 20 with initial datum 0.9; boundary data: 0.01 for roads 52, 57, 69, and 83; 0.1 for roads 1, 5, 24, 35, 40, and 47; and 1 for all outgoing roads.Maximal time as in Case A and maximal risk level R are equal to 500.
Case E. Initial conditions, boundary data, and maximal time are as in Case A; maximal risk level is R = 29.
Case F. Initial conditions, boundary data, and maximal time are as in Case A; maximal risk level is R = 31.
Notice that a boundary datum equal to ρ max = 1 on outgoing roads indicates that high congestion phenomena may occur when the car traffic flows out of the network.Moreover, the difference in initial conditions discriminates the traffic behaviour, hence leading to a probable different choice of the optimal path.For all previous simulation cases, right of way parameters and distribution coefficients are chosen as in Tables 3, 4, and 5.

Simulation Results
. Densities on network roads are evaluated numerically by the Godunov scheme, with space step Δx = 0.1 and time step determined by the CFL condition.
For each simulation case we have a different optimal path, as reported in Table 6, due to the different evolution of densities when different maximal risk levels and initial and boundary conditions are used.The maximal travel time constraint is satisfied in all cases by the optimal path.
The goodness of the obtained results is also confirmed estimating the time T od a car needs to reach the destination j 32 , starting from the origin j 2 (numerics are in [9]), in the different cases for all the alternative paths (see Table 7, where lengths in Kilometers and the sum of risks along paths, Sr, are also reported).First of all, notice that, as maximal risk levels are very high for Cases A, B, C, and D, the computation of the optimal path in such cases is influenced only by times T od .In Case A, the optimal path is the shortest one, P 2 , unlike Case C, where the optimal route has the highest length.In fact for Case C, P 2 is more congested than P 1 , P 3 , and P 4 .
Cases A, E, and F have the same times T od as they have the same initial conditions and boundary data but a  different maximal risk level.However, while Cases A and F have the same optimal route P 2 , since it respects risk constraint, in Case E, due to the maximal risk level, lower than those of Cases A and F, P 1 is the better path.Notice that the determination of K-Shortest Paths together with the computation of the total risk associated to each path allows to choose not the optimal path in terms of travel times but the one with a lower level risk, and a T od not far from the lowest one.
We make a further analysis on the density evolutions for some roads of the junction j 5 .Notice that, from road 7, a driver can choose road 9 or 43.In Figures 3 and 4, we report the behaviour of densities on such roads for simulation Cases B and C. In Case C, road 43 belongs to the optimal path P 3 and its density grows slowly, as the one of road 9 does.Indeed, the density values on the two roads are very different; road 9 has a higher traffic due to the superpositions of more rarefaction traffic waves with respect to road 43 with 0.060828 and 0.413329 maximal densities on roads 43 and 9, respectively.
Case B is more interesting.Road 9 belonging to the optimal path P 1 has a quick evolution of density with respect to the one of road 43.High-density fluctuations are the result of dynamics at junctions j 4 , j 5 , and j 6 : road 8 shock waves coming from roads 41 and traffic flow coming from road 40.In particular the maximal value of the density reached on road 9 is 0.346572, while on road 43 the density is less than or equal to 0.060384.This does not contradict the fact that the average travel time is minimized going on road 9, since the path P 1 is less congested than the paths P 3 and P 4 , determined by the choice of road 43 at junction j 5 .

Conclusions
In this paper, it is proposed an algorithm that, given an origin o and a destination d on a road network graph, computes the K optimal paths to follow using a modified version of a CKSPa, whose weights are determined by a fluid-dynamic model for road networks.
The procedure for finding the best paths has been tested via simulations on a real portion of the urban network in Caltanissetta, Italy.The optimal path connecting o and d has been evaluated using as weights the predicted travel times along roads, respecting the constraints on the maximal travelling time and the maximal risk coefficient accepted on the path.The goodness of the optimal path has been confirmed determining the trajectory of a car on it; it is proven that the time to cross the optimal route is lower than times needed to cover all the other possible paths connecting o and d.The dependence of the algorithm from the traffic conditions has been analyzed.

(
B) Fulfilling (A), drivers maximize the flux through J.If n > m, a further rule (a yielding criterion) is necessary:(C) Assume that not all cars can enter the outgoing roads, and let C be the amount that can do it.Then, p ϕ C cars come from the first incoming road I ϕ , where p ϕ ∈ ]0, 1[ is the right of way parameter of road I ϕ , ϕ = 1, . . ., n, and n ϕ=1 p ϕ = 1.

Figure 1 :
Figure 1: Map of a portion of Caltanissetta city.

Table 1 :
Correspondence among roads names and numbers in the graph of Figure 2.

Table 3 :
Right of way parameters for 2 × 1 junctions.

Table 4 :
Right of way parameters for 1 × 2 junctions.

Table 6 :
Different optimal paths for different simulation cases.

Table 7 :
T od for different paths and simulation cases.