Globally Optimal Departure Rates for Several Groups of Drivers

The first part of this paper contains a brief introduction to conservation law models of traffic flow on a network of roads. Globally optimal solutions and Nash equilibrium solutions are reviewed, with several groups of drivers sharing different cost functions. In the second part we consider a globally optimal set of departure rates, for different groups of drivers but on a single road. Necessary conditions are proved, which lead to a practical algorithm for computing the optimal solution.


Introduction
Macroscopic models of traffic flow, first introduced in [25,27], have now become a topic of extensive research. On a single road, the evolution of the traffic density can be described by a scalar conservation law. In order to extend the model to a whole network of roads, additional boundary conditions must be inserted, describing traffic flow at each intersection; see [10,15,19,20,22,23] or the survey [4]. A major eventual goal of these models is to understand traffic patterns, determined by the behavior of a large number of drivers with different origins and destinations.
In a basic setting, one can consider N groups of drivers, say G 1 , . . . , G N . Drivers from each group have the same origin and destination, and a cost which depends on their departure and arrival time. For such a model, two kind of solutions are of interest: -The Nash equilibrium solution, where each driver chooses his own departure time and route to destination, in order to minimize his own cost.
-The global optimization problem, where a central planner seeks to schedule all departures in order to minimize the sum of all costs.
In general, these criteria determine very different traffic patterns. To fix the ideas, let t → u i (t), i = 1, . . . , N , be the departure rate of drivers of the i-th group, so that t −∞ u i (s) ds yields the total number of these drivers who depart before time t. We recall that the support of u i , denoted by Supp(u i ), is the closure of set of times t where u i (t) > 0.
Roughly speaking, the two above solutions can be characterized as follows.
(I) In a Nash equilibrium, all drivers within the same group pay the same cost. Namely, there exists constants K 1 , . . . , K N such that • every driver of the i-th group, departing at a time t ∈ Supp(u i ) bears the cost K i .
• if a driver of the i-th group were to depart at any time t ∈ IR (possibly outside the support of u i ), he would incur in a cost ≥ K i .
(II) For a global optima, there exist constants C 1 , . . . , C n (where C i is the marginal cost for adding one more driver of the i-th group) such that • If one additional driver of the i-th group is added at any time t ∈ Supp(u i ), then the total cost increases by C i .
• If one additional driver of the i-th group is added at any time t ∈ IR (possibly outside the support of u i ), then the increase in the total cost is greater or equal to C i .
At an intuitive level, these conditions are easy to explain. In Fig. 1, left, the function Γ i (t) denotes the cost to an i-driver departing at time t. If Γ i did not attain its global minimum simultaneously at all points t ∈ [a, b] = Supp(u i ), then we could find times t 1 ∈ [a, b] and t 2 ∈ IR such that Γ i (t 2 ) < Γ i (t 1 ). In this case, the driver departing at time t 1 could lower his own cost choosing to depart at time t 2 instead. This contradicts the definition of equilibrium.
In Fig. 1, right, the function Λ i (t) denotes the marginal cost for inserting one additional driver of the i-th family, departing at time t. This accounts for the additional cost to the new driver, and also for the increase in the cost to all other drivers who are slowed down by the presence of one more car on the road. If Λ i did not attain its global minimum at all points in [c, d] = Supp(u i ), then we could find times t 1 ∈ [c, d] and t 2 ∈ IR such that Λ i (t 2 ) < Λ i (t 1 ). In this case we could consider a new traffic pattern, with one less driver departing at time t 1 and one more departing at time t 2 . This would achieve a smaller total cost, contradicting the assumption of optimality.
While the criterion (I) for an equilibrium solution is easy to justify, a rigorous proof of the necessary condition (II) for a global optimum faces considerable difficulties. Indeed, to compute the "marginal cost" for adding one more driver, one should differentiate the solution of a conservation law w.r.t. the initial data (or the boundary data). As it is well known, in general one does not have enough regularity to carry out such a differentiation. To cope with this difficulty one can introduce a "shift differential", describing how the shock locations change, depending on parameters. See [8,9,13,26,29] for results in this direction. Figure 1: Left: the rate of departures u i , for drivers of the i-th group, in a Nash equilibrium solution.
Each of these drivers starts at some time t ∈ [a, b]. To achieve an equilibrium, the cost Γ i (t) to any driver departing at time t must be constant inside [a, b] and larger outside. Right: the rate of departures u i , in a globally optimal solution. Here Λ i (t) denotes the marginal cost for inserting an additional driver of the i-th group, departing at time t. To achieve global optimality, Λ i must be constant on the support of u i , and larger outside.
The first part of this paper contains an introduction to macroscopic models of traffic flow on a network of roads. Section 2 starts by reviewing the classical LWR model for traffic flow on a single road, in terms of a scalar conservation law for the traffic density. We then discuss various boundary conditions, modeling traffic flow at an intersection. Finally, given a cost function depending on the departure and arrival times of each driver, we review the concepts of globally optimal solution and of Nash equilibrium solution.
The second part of paper contains original results. We consider here N groups of drivers traveling along the same road, but with different departure and arrival costs. We seek departure rates u 1 (·), . . . , u N (·) which are globally optimal. Namely, they minimize the sum of all costs to all drivers. A set of necessary conditions for optimality is derived, thus extending the result in [5] to the case where several groups of drivers are present. Relying on these conditions, in the last section we introduce an algorithm that numerically computes such globally optimal solutions.
For an introduction to the general theory of conservation laws we refer to [3,18,28]. A more comprehensive discussion of various models of traffic flow can be found in [1,2,17,19].
2 Conservation law models for traffic flow 2.1 Traffic flow on a single road.
According to the classical LWR model [25,27], traffic density on a single road can be described in terms of a scalar conservation law Here t is the time, while x ∈ IR is the space variable along the road. Moreover • ρ is the traffic density, i.e., the number of cars per unit length of the road.
• v = v(ρ) is the velocity of cars, which we assume depends only the traffic density.
• f = f (ρ) is the flux, i.e., the number of cars crossing a point x along the road, per unit time. We have the identity As shown in Fig. 2, the velocity should be a decreasing function of the car density. Concerning the flux function, a natural set of assumptions is Here ρ jam is the maximum density of cars allowed on the k-th road. This corresponds to bumper-to-bumper packing, where no car can move.
Smooth solutions of the conservation law (2.1) can be computed by the classical method of characteristics. By the chain rule, one obtains In other words, the density is constant along each characteristic curve satisfying (2.4). Notice that the assumptions (2.2) imply the inequality With reference to Fig. 2, let ρ max be the density at which the flux is maximum. We say that a state ρ is Due to the non-linearity of the flux function f , It is well known that solutions can develop shocks in finite time. The conservation law (2.1) must thus be interpreted in distributional sense. For the general theory of entropy weak solutions to conservation laws, we refer to [3,28].

Traffic flow at road intersections.
To model vehicular traffic on an entire network of roads, the conservation laws describing traffic flow on each road must be supplemented with boundary conditions, describing the behavior at road intersections. Consider an intersection, say with m incoming roads i ∈ {1, . . . , m} = I and n outgoing roads j ∈ {m + 1, . . . , m + n} = O, see Fig. 3. We shall use the space variable x ∈ ] − ∞, 0] for incoming roads and x ∈ [0, +∞[ for outgoing roads. Throughout the following we assume that the density of traffic on each road is governed by a conservation law where the flux function f k satisfies (2.2), for every k = 1, . . . , m + n. An appropriate model must depend on various parameters, namely • c i = relative priority of drivers arriving from road i.
• θ ij = fraction of drivers from road i that turn into road j.
For example, if the intersection is regulated by a crosslight, c i could measure the fraction of time when drivers from road i get green light, on average. It is natural to assume Boundary conditions should determine the limit values of the traffic density on each of the m + n roads meeting at the intersection: At first sight, one might guess that m + n conditions will be required. However, this is not so, because on some roads the characteristics move toward the intersection. For these roads, the limits in ( It now becomes apparent that, to assign a meaningful set of boundary conditions, several different cases must be considered. To circumvent these difficulties, an alternative approach developed by Coclite, Garavello, and Piccoli [15,20,21] relies on the construction of a Riemann Solver. Instead of assigning a variable number of boundary conditions, here the idea is to introduce a rule for solving all Riemann problems (i.e. the initial-value problems where at time t = 0 the densities ρ k and turning preferences θ ij are constant along each road). Relying on front-tracking approximations, under suitable conditions one can prove that the solutions with general initial data are also uniquely determined.
We briefly review the main steps of this construction, for the constant initial data ρ 1 , . . . , ρ m , ρ m+1 , . . . ρ m+n = initial densities on the incoming and outgoing roads, θ ij = fraction of drivers from road i that turn into road j.
Step 1. Determine the maximum flux f max i that can exit from each incoming road i ∈ I.
As shown in Fig. 4, this is computed by Figure 4: Computing the maximum flux that can come out from a road i ∈ I.
Step 2: Determine the maximum flux f max j that can enter each outgoing road j ∈ O.
As shown in Fig. 5, this is computed by Figure 5: Computing the maximum flux that can get into a road j ∈ O.
Step 3: Given the maximum incoming and outgoing fluxes f max i , f max j , and the turning preferences θ ij , determine the region of admissible incoming fluxes Step 4. To construct a Riemann solver, it now suffices to give a rule for selecting a point ω = (f 1 , . . . , f m ) in the feasible region Ω. In general, this rule will depend on the priority coefficients c 1 , . . . , c m assigned to incoming roads. Observe that, as soon as the incoming fluxes f i , i ∈ I, are given, the outgoing fluxes are uniquely determined by the identities Various ways to define a Riemann Solver are illustrated by the following examples.
Example 1: Given priority coefficients c 1 , . . . , c m , following [15] one can choose the vector of incoming fluxesω In particular, if c 1 = · · · = c m = 1 m , this means we are maximizing the total flux through the intersection (see Fig. 7, left).
Since in (2.10) we are maximizing a linear function over a polytope, in some cases the maximum can be attained at multiple points. This somewhat restricts the applicability of this model. An alternative model, with better continuity properties, is considered below.
Example 2: Given positive coefficients c 1 , . . . , c m as in (2.6), consider the one-parameter curve As shown in Fig. 7, right, we then choose the vector of incoming fluxes Figure 7: Left: the pointω ∈ Ω which maximizes the total flux through the intersection. Right: the pointω ∈ Ω constructed by the Riemann Solver at (2.11)-(2.12). Example 3 : To model an intersection with two incoming and two outgoing roads, where road 2 has a stop sign, we choose the point ω = (f 1 , f 2 ) according to the following rules (see Fig. 8).
According to (2.13), as many cars as possible are allowed to arrive from road 1. According to (2.14), if any available space is left, cars arriving from road 2 are allowed through the intersection.

Intersection models with buffers.
Having defined a way to solve each Riemann problem, a major issue is whether the Cauchy problem with general initial data is well posed. Assuming that the turning preferences θ ij remain constant in time, some results in this direction can be found in [15].
We remark, however, that in general these turning preferences may well vary in time. One should thus regard θ ij = θ ij (t, x) as variables. Assuming that drivers know in advance their itinerary, the conservation of the number of drivers on road i that will eventually turn into road j is expressed by the additional conservation law Combining (2.15) with the conservation law one obtains a linear transport equation for each of the quantities θ ij , namely A surprising counterexample constructed in [14] shows that, for a very general class of Riemann Solvers, one can construct measurable initial data ρ i (0, ·), ρ j (0, ·), and θ ij (0, ·), so that the Cauchy problem has two distinct entropy-admissible solutions.
The ill-posedness of these model equations represents a serious obstruction, toward the existence of globally optimal traffic patterns, or Nash equilibria, on a general network of roads.
To cope with this difficulty, in [10] an alternative model was proposed, for traffic flow at an intersection. Namely, it is assumed that the junction contains a buffer (say, a traffic circle). Incoming cars are admitted at a rate depending of the amount of free space left in the buffer, regardless of their destination. Once they have entered the intersection, cars flow out at the maximum rate allowed by the outgoing road of their choice.
More precisely, consider a constant M > 0, describing the maximum number of cars that can occupy the intersection at any given time, and constants c i > 0, i ∈ I, accounting for priorities given to different incoming roads. For j ∈ O, at any time t we denote by q j (t) ∈ [0, M ] the number of cars, already within the buffer, that seek to turn into road j.
As before, let f max i and f max j the maximum fluxes that can exit from road i ∈ I, or can enter into road j ∈ O. We then require that the incoming fluxes f i satisfy In addition, the outgoing fluxes f j should satisfy Having determined the incoming and outgoing fluxes f i , f j , the time derivatives of the queues q j are then computed byq The well-posedness of the intersection model with buffers, for general L ∞ data, was proved in [10].
It is interesting to understand the relation between the intersection model with buffer, and the models based on a Riemann Solver. The analysis in [12] shows that, letting the size of the buffer M → 0, the solution of the problem with buffers converges to the solution determined by the Riemann Solver at (2.11)-(2.12), described in Example 2.

Optima and equilibria on a network of roads.
Consider a network of roads, with several intersections. We call γ k , k = 1, . . . ,k the arcs corresponding to the various roads, and A 1 , . . . , A ν the nodes corresponding to intersections. It is assumed that, on the k-th road, the flux function has the form f k (ρ) = ρ v k (ρ), with v k a decreasing function of the density. As in the previous sections, traffic flow at each intersection can be modeled in terms of a Riemann Solver, or by means of a buffer.
We consider N groups of drivers with different origins and destinations, and possibly different departure and arrival costs. As shown in Fig. 10: • Drivers in the i-th group depart from the node A d(i) and arrive at the node A a(i) .
• Their cost for departing at time t is ϕ i (t), while their arrival cost is ψ i (t).
• They can use different paths Γ 1 , Γ 2 , . . . to reach destination. Figure 10: A network of roads, with several intersections at nodes A j . Drivers of the i-th group depart from the node A d(i) and arrive to node A a(i) . In this example they can choose two distinct paths to reach destination.
In the following,ū i,p (·) will denote the departure rate of drivers of the i-th group, who choose the path Γ p to reach destination. Calling G i the total number of drivers in the i-th group, we say that the departure ratesū i,p are admissible if, for every i = 1, . . . , N they satisfy the obvious constraintsū Given the departure rates, in principle one can then solve the equation of traffic flow on the whole network and determine the arrival times of the various drivers. We call τ p (t) = arrival time of a driver departing at time t, traveling along the path Γ p .
With these notations, we can introduce Definition 2.1 An admissible family {ū i,p } of departure rates is globally optimal if it minimizes the sum of the total costs of all drivers Definition 2.2 An admissible family {ū k,p } of departure rates is a Nash equilibrium if no driver of any group can lower his own total cost by changing departure time or switching to a different path to reach destination.
From the above definition it follows the existence of constants C 1 , . . . , C N such that As remarked in the Introduction, a similar characterization for the globally optimal solution is much harder to justify.
In the above setting, a natural set of assumptions is (see Fig. 11) Figure 11: A flux function f k , a departure cost function ϕ i , and and arrival cost function ψ i , satisfying the assumptions (A1)-(A2).
(A1) On each road k = 1, . . . ,k, the flux function f k satisfies (A2) For each group of drivers i = 1, . . . , N , the cost functions ϕ i , ψ i satisfy When all intersections are modeled in terms of a buffer as in (2.17)- (2.19), under the assumptions (A1), (A2), the existence of at least one globally optimal solution and at least one Nash equilibrium solution was proved in [11].
3 Optimal solutions: a single road, several groups of drivers Consider a single road, where the traffic density is governed by the conservation law We assume that N groups of drivers are present, of sizes G 1 , . . . , G N , with departure and arrival costs ϕ i , ψ i , i = 1, . . . , N . The flux function will be denoted by Here is the flux of drivers of the i-th group. As in (2.6), we always assume that The incoming flux at the beginning of the road is The global optimization problem can be formulated as follows.
(OP) Given the constants G i > 0, i = 1, . . . , N , find departure ratesū i (t) =θ i (t)ū(t) which provide an optimal solution to the problem minimize: and satisfy the constraints We recall that u i (t, L) = θ i (t, L)u(t, L) is the rate at which the drivers of the i-th group arrive at the end of the road.
Since no intersections are present, the existence of a globally optimal solution follows as a special case of the result in [11]. Here we briefly recall the main argument in the proof.
N ) n≥1 be a minimizing sequence of admissible departure rates. Namelȳ  3. By taking a subsequence, we obtain a weak limit (ū The boundedness of the supports guarantees that these limit departure rates are still admissible (i.e., no mass leaks at infinity).

Call u (n)
i (t, x), u i (t, x) the corresponding solutions. By the genuine nonlinearity of the conservation law (3.1), after taking a subsequence, one obtains the strong convergence u (n) (·, L) → u(·, L) in L 1 (IR), and the weak convergence of the departure and arrival rates Since the cost functional in (3.7) is linear w.r.t. these departure and arrival rates, it is continuous w.r.t. weak convergence. This yields the optimality of the departure rates (ū 1 , . . . ,ū N ).

Optimality conditions.
In the remainder of this section, we seek necessary conditions for a solution to be optimal. As a first step, we derive an explicit representation of the solution.
Following [5,6], it is convenient to switch the roles of the variables t, x, and write the density ρ as a function of the flux u. The boundary value problem (3.1)-(3.6) thus becomes a Cauchy problem for the conservation law describing the flux u = ρv(ρ), namely As shown in Fig. 12, the function u → g(u) = ρ is defined as a partial inverse of the function ρ → ρ v(ρ) = u, assuming that For convenience, we extend g to the entire real line by setting (3.12) The solution to (3.10)-(3.11) can now be expressed by means of the Lax formula [18,24]. Namely, call g * (p) the Legendre transform of g. Notice that g * (p) = + ∞ for p < g (0).
On the other hand, for p ≥ g (0) the strict convexity of g implies that there exists a unique value u = γ(p) ≥ 0 where the maximum in (3.13) is attained, so that g * (p) = p · γ(p) − g(γ(p)). Consider the integrated function

This function
which measures the number of drivers that have crossed the point x along the road before time t. The conservation law (3.10) can be equivalently written as a Hamilton-Jacobi equation The solution to (3.10)-(3.11) is now provided by the Lax formula We observe that the function U = U (t, x) is globally Lipschitz continuous. Its values satisfy Car trajectories t → y(t) are defined to be the solutions to the ODĖ y(t) = v(ρ(t, y(t))).

By (3.15) one has
More generally, consider a car departing at time t 0 . The solution to the Cauchy probleṁ y(t) = v(ρ(t, y(t))), y(t 0 ) = 0 (3.23) can be determined by the formula The arrival time of a driver departing at time t 0 is τ a (t 0 ) = sup t ; U (t , L) < U (t 0 ) or t = t 0 + L v(0) . In order to compute the arrival rates u i = θ i u at the terminal point of the road x = L, we first observe that the map t → U (t) in (3.16) is nondecreasing. Hence we can define an inverse by setting We then introduce the functions Θ i (s) . =θ i (τ (s)) (3.27) By (3.5), the functions θ i = θ i (t, x) are constant along car trajectories. The general solution to (3.5)-(3.6) can thus be written as We shall be mostly interested in the terminal values u(t, L), describing the rate at which cars arrive at the end of the road. Denoting the arrival distribution as U a (t) .
= U (t, L), the total cost can now be written as Then the corresponding solution does not contain shocks. Moreover, there exists constants C 1 , . . . , C N such that, setting

30)
the following holds: (i) For any t ∈ IR, let T (t) be the unique time such that Then, for every point (t , x ) along the segment with endpoints (t, 0) and (T (t), L), one has (3.32) (ii) Calling u i (·, L) the arrival rate of drivers of the i-th group, one has A proof of Theorem 3.1 will be given in the next section.

Proof of the necessary conditions
As a preliminary, we review the basic theory of scalar conservation laws with convex flux [3,18,28]. Notice that in (3.10) the usual role of the variables t, x is reversed, because of the particular meaning of the equations. By a generalized characteristic we mean a function x → t(x) which provides a solution to the differential inclusion d dx t(x) ∈ g (u(t+, x)), g (u(t−, x)) . For any given point (T, L), there exists a minimal and a maximal backward characteristic. As shown in Fig. 13, we denote by (η − (T ), 0) and (η + (T ), 0) the initial points of these characteristics. Calling U the integral function in (3.17), the points η − (T ) and η + (T ) are respectively the minimum and the maximum elements within the set where the function Λ(t) . (ii) The global minimum in (4.2) is attained at multiple points, hence η − (T ) < η + (T ).
In this case the solution contains a shock through the point (T, L). Recalling (3.14), the left and right values across the shock are determined by We observe that characteristics do not cross each other. Indeed, one has the implication From (4.3) it immediately follows that (i) The profile u(·, L) can contain at most countably many shocks. Namely, there can be at most countably many points T i such that η − (T i ) < η + (T i ).
(ii) There can be at most countably many points t i such that for two distinct points T 1 < T 2 .
We recall that, given any function φ ∈ L 1 loc (IR), almost every point t ∈ IR is a Lebesgue point of φ. By definition, this means As proved in [5], if t is a Lebesgue point of the initial datumū(·), then there exists a unique forward characteristic starting at t. In particular, t cannot be the center of a rarefaction wave, and there exists a unique point T such that The next lemma is concerned with the stability of the map T → η ± (T ), w.r.t. small perturbations in the initial datumū.
Lemma 4.1 Let u = u(t, x) be the unique entropy weak solution of (3.10)- (3.11). Assume that t is a Lebesgue point for the initial datumū, and let T be the unique point such that (4.6) holds. Then, for any ε > 0, one can find δ, δ > 0 such that the following holds.
Letū † be a second initial datum, with If we call u † the corresponding solution, and define the maps (η † ) ± accordingly, then Proof. 1. Let ε > 0 be given. By the uniqueness assumption, for the solution u the backward characteristics through the points T − ε and T + ε satisfy Hence we can find δ > 0 such that 2. If the conclusion of the lemma does not hold, we could find a sequence of initial dataū n with ū n −ū L 1 → 0, such that the corresponding maps η ± n satisfy To fix the ideas, assume that the first case holds. Namely, for every n ≥ 1, there exists t n ≥ t − δ such that By possibly taking a subsequence we can assume t n → t * ≥ t − δ . The uniform convergence U n → U now yields Notice that there are several characteristics starting from the point (t, 0), which is the center of a rarefaction wave. Fig. 13, consider a solution u = u(t, x) containing a shock through the point (T, L). Then we can modify the initial data at x = 0 inside the interval [η − (T ), η + (T )] so that the solution perturbed solution u † contains a centered compression wave which breaks exactly at (T, L). In view of (3.14), This is achieved by takinḡ

Remark 4.2 As shown in
This ensures that all characteristics starting at a point (t, 0) with t ∈ [η − (T ), η + (T )] join together at the point (T, L).
Consider the constant Then the corresponding integrated function U † satisfies while the corresponding solutions coincide at x = L, namely The next lemma, analyzing various perturbations to an optimal solution u, provides the key step toward the proof of Theorem 3.1. (ū 1 , . . . ,ū N ) = (θ 1ū , . . . ,θ Nū ) be optimal departure rates. Assume that t 1 , t 2 are Lebesgue points for all functionsū,θ 1 , . . . ,θ N , and

Lemma 4.3 Let
Call τ a (t 1 ), τ a (t 2 ) the arrival times of a driver departing at times t 1 , t 2 , respectively. Moreover, let T (t 1 ), T (t 2 ) be the times where the (unique) generalized forward characteristic starting from t 1 , t 2 reaches the point L. Then ψ j (s)θ j (s, L) ds . (4.16)

Remark 4.4
The left hand side of (4.16) can be interpreted as the cost for inserting an additional i-driver, departing at time t 1 . In this case, an additional driver arrives at time T (t 1 ), but this is not the same one! Indeed, the new driver arrives at time τ a (t 1 ). However, the presence of this additional car slows down all the other cars whose arrival time is T ∈ [τ a (t 1 ), T (t 1 )]. The delay in the arrival time of all these cars causes a further increase in the total cost, accounted by the integral term on the left hand side of (4.16). Similarly, the right hand side is the amount which can be saved by removing an i-driver departing at time t 2 .
Proof of Lemma 4.3. 1. Since t 1 , t 2 are Lebesgue points ofū, they cannot be the center of a rarefaction wave. Hence there exist unique points T 1 = T (t 1 ) and T 2 = T (t 2 ) such that Assuming that (4.16) fails, we shall derive a contradiction. Indeed, we will construct a new initial dataū † i which is slightly smaller thanū i in a neighborhood of t 1 and slightly larger than u i in a neighborhood of t 2 , yielding a lower total cost. Various cases can arise, depending on the relative position of τ a (t i ) and T (t i ). To fix the ideas, in the following we assume that τ a (t 1 ) < T (t 1 ) < τ a (t 2 ) < T (t 2 ), (4.18) as shown in Fig. 14. The other cases are handled in a similar way.
We observe that the above strict inequalities imply that u(·, L) is strictly positive on the intervals [τ a (t 1 ), T (t 1 )] and [τ a (t 2 ), T (t 2 )]. Indeed, the car speed is always ≤ v(0) = 1 g (0) . As shown in Fig. 15 then the car speed would be identically equal to the maximum speed v(0). In this case the car trajectory coincides with a characteristic line, and hence T (t 1 ) = τ a (t 1 ), against the assumption (4.18). Therefore, we must have Since characteristics do not cross each other, for every T ∈ ]τ a (t 2 ), T (t 2 )[ the initial point of a characteristic through (T, L) must satisfy Hence Since g is an increasing function, this yields a lower bound on u(T, L).

2.
Consider a perturbed set of initial data of the form (ū 1 , . . . ,ū † i , . . . ,ū N ), where only the componentū i is modified. The new departure rate for drivers of the i-th group is chosen so that (4.20) Given ε > 0, according to Lemma 4.1, we can choose δ, δ > 0 small enough so that the perturbation in the initial datum affects the values of u(·, L) only in a small neighborhood of the points T (t 1 ), T (t 2 ), namely 3. We now consider a sequence of perturbations of the form (4.20)-(4.21), with ε n , δ n , δ n → 0. Calling τ a n (t) the corresponding arrival times, we claim that the following holds.
(C) Let t be a Lebesgue point forū, withū(t) > 0, and let τ a (t) be a Lebesgue point for u(·, L). Then u(τ a (t), L) > 0 and the following implications hold.
• For those drivers who were reaching destination at a time T ∈ ]τ a (t 2 ), T 2 [ , the arrival time is anticipated by δ n /u(τ a (t), L).
• For all other drivers, the arrival time does not change.
To prove the above claim we first observe that, if u(τ a (t), L) = 0, then u(t , x ) = 0 along the backward characteristic but in this case, this characteristic coincides with a car trajectory. Henceū(t) = u(0, t) = 0 as well, contradicting our first assumption.
To prove (4.23), assume τ a (t 1 ) < τ a (t) < T 1 . Then, for all n large enough, the arrival time τ a n (t) is uniquely determined by the identity U (τ a n (t), L) = U (τ a (t), L) + δ n . (4.26) Observing that the partial derivative is from (4.26) one obtains (4.23). Notice that here the denominator is uniformly positive, as a consequence of (4.19).
The proof of (4.24) is entirely similar, replacing (4.26) with the identity U (τ a n (t), L) = U (τ a (t), L) − δ n . Finally, if the condition on the left hand side of (4.25) holds, then for all n ≥ 1 sufficiently large one has τ a n (t) = τ a (t), and the implication is trivial.

4.
By the properties (4.23) it follows An entirely similar computation can be performed on the interval ]τ a (t 2 ), T 2 [ . Combining these estimates, we thus conclude (4.28) If the inequality (4.16) does not hold, then the right hand side of (4.28) is negative. This yields a contradiction with the optimality of the departure rates (ū 1 , . . . ,ū i , . . . ,ū N ).

5.
The above analysis proves the lemma in the case where (4.18) holds. On the other hand, if T (t 1 ) = τ a (t 1 ), then a small perturbation of the departure rate on the interval [t 1 , t 1 + δ n ] will modify the arrival rate only in a small neighborhood of τ a (t 1 ) (see Fig. 15, right). In this case, one directly proves that the limit (4.28) remains valid, since the integral over the interval [τ a (t 1 ), T (t 1 )] trivially vanishes.

1.
We begin by showing that an optimal solution no shock can occur in the interior of the domain, i.e. for 0 ≤ x < L.
for all i, t. Observing that there exists some i and some t ∈ [η − (T ), η + (T )] where (4.32) is satisfied as a strict inequality, we claim that the total departure cost for the perturbed solution is strictly smaller.
To see this, introduce a variable ξ ∈ [0, G i ] labeling drivers of the i-th group. Define the departure times By the previous definitions it follows with strict inequality holding at least for some index i and some values of ξ ∈ [0, G i ]. We now compute proving our claim.
2. Next, we claim that an optimal departure rate satisfies Indeed, since the characteristic speed satisfies g (u) → +∞ as u → M , ifū(τ ) = M at some point τ then the solution u(·, x) would immediately contain a shock, for every x > 0. By the previous step, this contradicts the optimality assumption.
3. According to Lemma 4.3, by (4.34), the quantity is equal to some constant C i for all t ∈ Supp(ū i ), and is greater or equal to C i for all t ∈ IR.

An algorithm to construct optimal solutions
Here we illustrate how these necessary conditions can be used to construct optimal solutions. For simplicity, we shall assume that the cost functions ψ i are C 2 and satisfy the assumption (A3) For any i = j one has the implication ψ i (t) = ψ j (t) =⇒ ψ (t) = ψ j (t). (5.1) Notice that, by (5.1), for any given constants C 1 , . . . , C N , the set of times consists only of isolated points, hence it has measure zero.
Let now G 1 , . . . , G N be the sizes of the N groups of drivers. In order to construct a globally optimal family of departure rates u 1 (·), . . . , u N (·), we introduce the following algorithm.
(i) Start by guessing N constants C 1 , . . . , C N , and define the cost function ψ as in (3.30).
(iii) Define the sets Notice that, by (A3), for a.e. t ∈ IR the minimum in (5.2) is attained by a unique index k ∈ {1, . . . , N }. And let u = u(t, x) be the solution of (3.10) whose characteristics satisfy (3.31).
(vii) Finally, for T ∈ A i , call η(T ) the departure time of the driver that arrives at time T . This is obtained by solving the ODĖ x(t) = v(t, x(t)) = u(t, x) g(u(t, x)) , (5.5) with terminal condition x(T ) = L . (5.6) The solution t → x(t, T ) of (5.5)-(5.6) yields the trajectory of a car arriving at the end of the road time T . Its departure time η(T ) is defined by the equality x(η(T )) = 0.
We now consider the sets of departure times The departure distributionū then satisfies all the necessary conditions for optimality.
We remark that these conditions are only necessary, not sufficient for optimality. Since an optimal solution exists, and can obtained by the above method, the previous analysis implies that, if the N -tuple ( C 1 , . . . , C N ) which satisfies (5.4) is unique, then this must yield the optimal solution. Example 4. We seek a globally optimal departure rate for two groups of drivers, with sizes G 1 = G 2 = 2.51 on a road with length L = 10. The conservation law governing traffic density is ρ t + [ρv(ρ)] x = 0, v(ρ) = 2 − ρ (5.7) The departure and arrival costs for drivers of the two groups are ϕ(t) = − t ψ 1 (t) = e t−4 ψ 2 (t) = e t−7.6 . (5.8) The optimal solution, found by the algorithm described above, is shown in Fig. 16. The marginal costs for adding one more driver of the first group or of the second group are found to be C 1 = 5.18 and C 2 = 2.10, respectively.