Implementing first-in-first-out in the cell transmission model for networks

In traffic assignment models with time-varying flows (dynamic network loading or dynamic traffic assignment), overtaking behavior is normally not included in the model and, in that case, it is important that the model at least approximates first-in-first-out (FIFO), to prevent deviations from FIFO that are arbitrary or unrealistic or not physically possible. For the cell transmission model (CTM) it has recently been shown that the usual recommended method for preserving FIFO will ensure FIFO for each cell taken separately but does not fully ensure FIFO in the transition between cells and hence does not fully ensure FIFO for sequences of cells or for links or for routes. As a result, deviations from FIFO can easily occur and cumulate along the links or routes. In view of that, we define and analyse three different levels of satisfaction or approximation of FIFO, together with corresponding methods for achieving them. Two of these are existing methods and one is new. We develop, analyse and compare the three methods and the extent to which each of them adheres to FIFO for sequences of cells and links or routes. Also, for two of the methods we present a more detailed algorithm for applying them within the CTM. The paper is concerned with how to implement FIFO in the CTM and not with testing for FIFO or measuring deviations from FIFO.


Introduction and outline of approach
In macroscopic modelling of time-varying traffic flows on road links or networks, usually referred to as DNL (dynamic network loading) or DTA (dynamic traffic assignment), it is considered desirable that traffic flows behave in a first-in-first-out (FIFO) manner.DTA is here assumed to include DUE (dynamic user equilibrium), DSO (dynamic system optimum) and similar assignment models.In reality, traffic does not adhere strictly to FIFO since overtaking occurs but, in macroscopic modelling, FIFO is considered a better approximation to reality than allowing arbitrary deviations from FIFO.If deviations from FIFO are ignored in these models then their solutions can exhibit deviations from FIFO that are arbitrary, not consistent with any realistic model of traffic behavior or not physically feasible (see for example Carey (1992Carey ( , 2004a, b), b), Zhang and Nie (2005), Blumberg and Bar Gera (2009)).The alternative to ensuring or approximating FIFO in such models would be to include an explicit model of non-FIFO (overtaking) behavior so as to realistically describe, reflect or at least approximate, actual overtaking behavior.However, that is seldom if ever done or attempted in macroscopic models for traffic networks and we therefore assume here that it is not included in the model.
A method often used for dealing with FIFO in the cell transmission model (CTM) is to (a) divide traffic entering a cell into cohorts defined only by route and (b) let these cohorts exit from the cell in each time step in the same proportions as their numbers currently in the cell, ignoring the time order in which they entered the cell.This can allow unlimited deviations from FIFOsee FIFO level 1 in Section 2.1.The usually recommended method for applying FIFO in the CTM is as follows: (a) divide traffic entering a cell into cohorts defined only by route and time of entry to the cell, (b) let these cohorts exit from the cell in the same time order as the order in which they entered the cell, and (c) if one of these time-ordered cohorts can not all exit in a single time step then let the fraction of it that can exit be made up of route types in the same proportions (see FIFO level 2 in Section 2.2).However, Blumberg and Bar Gera (2009) have shown that this method can allow deviations from FIFO and that these can accumulate and increase from cell to cell along each route.They set out a detailed numerical example to illustrate deviations from FIFO that the above method allows over a sequence of consecutive cells.This is also shown by Proposition 1(b) below.
The above deviations from FIFO occur because the proportionality rule in (c) above can conflict with FIFO, as illustrated by the following example.Suppose that the traffic entering cell i in time step  consists only of 10 units of route type r1 and the traffic entering it in the next time step ( +1) consists only of 10 units on route r2.Suppose that these 20 units then exit together from cell i (enter cell i+1) in a single time step and exit from it as 10 units in time step t and 10 units in time step t+1.FIFO implies that the 10 units exiting from cell i+1 in time step t should be of type r1 and the 10 units exiting in time step t+1 should be of type r2.However, the proportionality rule in (c) above means that 5 units of each type would exit from cell i+1 in time step t and 5 units of each type would exit from i+1 in time step t+1.
In this paper we consider FIFO specifically for the cell transmission model (CTM), introduced by Daganzo (1994Daganzo ( , 1995aDaganzo ( , 1995b)).It would seem that much of the discussion would also apply to other exit flow models but we have not explored that in this paper.We consider the CTM because it has been increasingly widely used, and because it handles traffic flow, queues, spill-back, merges and diverges in a simple realistic way and is a discrete approximation to the continuous LWR model (Lighthill and Whitham (1955) and Richards (1956)) which is perhaps the most widely accepted macroscopic model of traffic flow.The CTM is also a particular challenge for FIFO since it disaggregates the network by three spatial levels, namely routes, links and cells, and FIFO has to be considered for each of these.We also consider the CTM for the following reason.
There has been much discussion of FIFO in the literature, particularly for dynamic traffic assignment (DTA) based on link travel-time functions (for example in Carey (1992), Friesz et al. (1993), Xu et al. (1999), Zhu and Marcotte (2000), Carey et al. (2003), Ge and Carey (2004)), but there has been less discussion of FIFO for the CTM.FIFO for the latter has been considered in Daganzo (1995a), Lo and Szeto (2002), Carey (2004a, b) and Blumberg and Bar Gera (2009), but it needs further consideration in the light of the results referred to above from Blumberg and Bar Gera (2009).Several papers mention FIFO in the CTM only in relation to traffic at a diverge junction.They explain that if vehicles are unable to exit to one branch of a diverge then vehicles behind them will be unable to exit to the other branch of the diverge due to a FIFO requirement.
Jin and others (Jin and Jayakrishnan (2005), Jin (2007), Jin, Zhang and Chu (2006), Jin and Li (2007)) focused on measuring deviations from FIFO and introduced various measures of aggregate deviation from FIFO for groups of vehicles for links and paths.They were not concerned with how to implement FIFO, which is the topic of the present paper.Jin (2007) used a FIFO violation function to reformulate the static traffic assignment problem as a dynamical system, with route choice dynamics based on FIFO violation among different routes for each origin-destination pair, but again the paper was not concerned with how to implement cell, link or route FIFO, nor specifically concerned with the CTM.

When is FIFO expected, or not expected, in DNL and DTA?
It is important to note where or when FIFO is, or is not, expected to hold.Basically, we expect traffic to exit from each cell, link, sequence of links, and route in the same order as it entered that cell, link, sequence of links, or route, i.e. in FIFO order.Thus if some traffic type enters a cell, link or route in say time step and exits in time step t while some other traffic type enters after time step and exits before time step t, that is an obvious FIFO violation.But it is also worth remarking on some perhaps less obvious or more complex cases that are, or are not, also considered as FIFO violations, as follows.(a) If congestion is increasing or decreasing over time then the time taken for traffic to pass a given point may expand or contract over time and this does not imply any violation of FIFO.For example, in the cell transmission model, traffic that enters a cell or link in a single time step may exit from it spread over two or more time steps.Conversely, traffic that entered a cell or link over two or more consecutive time steps may exit from it within a single time step.This behavior does not in itself imply any deviation from FIFO.(b) In DNL, for any given origin-destination (OD) pair, the inflows to different routes between the OD pair are taken as given and are not necessarily, or not usually, user equilibrium inflows.
Hence DNL does not seek to ensure that traffic on different utilized routes between an OD pair, or any pair of nodes, will have the same travel times.That is left to travel-time-based DUE, which could be achieved by solving a series of DNL problems while iteratively reallocating the OD flows between routes.In view of that, DNL does not seek to ensure FIFO when comparing alternative spatial routes between any OD pair, or any pair of nodes.(c) Traffic on different routes may start out on different links but at some stage may share a link or sequence of links.In that case strict FIFO requires that traffic exit from the shared links in the same order as it entered the shared links.But that is of course not necessarily the same time order as the traffic embarked on their separate routes.For example, traffic may enter two different routes at the same time but one route may take very much longer than the other to get to the shared links.

FIFO consistency within traffic types and between traffic types.
The first paper that proposed the CTM (Daganzo (1994)) considers a single traffic type on a single link, and does not mention FIFO.In the second paper on the CTM (Daganzo (1995a)) there is no mention of FIFO until later in the paper when two or more traffic types are introduced.It seems that, when there is only a single homogeneous traffic type, the vehicles or components within that traffic are indistinguishable hence there is no need to try to distinguish them.Since the traffic is of a single homogenous type we can assume that it exits from the cell is in the same order as it entered it.This does not mean that FIFO is ignored.The solution obtained is consistent with FIFO.It is also consistent with other non-FIFO possibilities.For example, since we are assuming a single homogeneous traffic type, any two or more vehicles or traffic units could repeatedly swap their sequence order within it and that would not be observable in the CTM solution.
Now consider a cell with two or more route types passing through it.Again let the traffic exit from the cell subject to the CTM, i.e. subject to flow conservation and the CTM exit flow equations.Since there are two or more route types we need to ensure, or at least approximate, FIFO between the route types.To achieve that we need to keep track of the time steps, or time order, in which the various route types enter/ exit cells as they move through the network.In Section 2 we let the traffic exit from each cell in the same time order as it entered the cell (FIFO level 2) or entered the link (FIFO level 3).These are discussed in more detail in Sections 2.2 and 2.3 and in definitions and propositions therein.

Extending FIFO to vehicle types and/or driver types.
In this paper we could also distinguish between different vehicle types and driver types, by giving each vehicle/ driver type a different label and including these in the tracking of traffic and implementing of FIFO.To consider this, we first consider classifications of vehicle or driver types that do not affect the vehicle speeds.For these, there is a much easier way to handle FIFO for these vehicle/ driver types, that does not involve labeling and tracking.We can assume that in the traffic cohorts that enter each route in each time step t , the numbers and proportions of vehicle/ driver types must be known (since these would need to be known to track vehicles through the network).We can also assume that, as each cohort makes its way along its route to its destination, the numbers and proportions of vehicle and/ or driver types in the cohort remain unchanged, since we are assuming that all vehicle/ driver types in the cohort travel at the same speed.In that case, if we ensure FIFO for these cohorts that will also ensure FIFO for the vehicle/ driver types within the cohorts.At the destination we can read off the vehicle and/or driver numbers from the exiting cohorts, as these numbers are the same as when the cohorts first entered the route.If we are using a FIFO implementation method that only approximates full FIFO then the FIFO obtained for vehicle/ driver types will also be only approximate.
In the above paragraph we considered only classifications of vehicle or driver types that do not affect the vehicle speeds.If the differences in driver or vehicle types affect the vehicle speeds then the faster vehicles will exit from a cell, link or route before the slower vehicles.In that case, the FIFO rules considered in this paper may apply within driver/ vehicle types but will not apply between driver/ vehicle types.To adapt the CTM to model the behavior of traffic travelling at different speeds is beyond the scope of this paper, but see for example Wong and Wong (2002), Alecsandru (2006), Boel and Mihaylova (2006), Zhong and Sumalee (2008) Tuerprasert and Aswakul (2010), Sumalee et al. (2011), Szeto et al. (2011), Carey et al. (2013).
In the two paragraphs above we distinguished between driver or vehicle classifications that affect the vehicle speeds and those that do not.It is useful here to give some examples of each of these classifications.
Classification 1: Drivers or vehicles types that are likely to travel at (approximately) the same speed as other types in each cell, link or route.For example, we may wish to distinguish between vehicles that have different levels of access to in-car information systems, or distinguish between drivers who have a different trip purpose such as journey to work, leisure trips, shopping trips, or school runs, or distinguish between drivers who have different values of time and hence different preferences as to when to start their journey to avoid congestion.Classification 2: Driver or vehicle types that are likely to travel faster or slower than other types in the same cell, link or route.For example, we may wish to distinguish between drivers with different levels of impatience, urgency or aggressiveness, or distinguish between cars, busses and lorries/ trucks.These driver/ vehicle types may differ in their free flow speeds and/ or in their speeds in congested traffic.
It may not always be clear whether a particular classification of drivers or vehicles should be in group 1 or in group 2 above.For example, some of the characteristics distinguished in Classification 1 may have some effect on vehicle speeds.In the end, whether they differ sufficiently to require a separate treatment is an empirical question.

Structure of the paper
The rest of the paper is structured as follows.Section 2 defines, discusses and analyses various methods (FIFO levels 0 to 3) for implementing FIFO.Section 3 sets out an algorithm for implementing FIFO for a simple scenario with only a single link and single type of traffic.Sections 4 and 5 extend this algorithm by differentiating traffic by time of entry to the cell (section 4) and link (section 5).Sections 3 to 5 are concerned with FIFO for cells within a link.To extend this properly to networks it is necessary to introduce merges and diverges, which is done in Section 6.A short section 7 extends the results to origin-destination FIFO, that is, to traffic that has a choice of routes between an origin and destination.Section 8 concludes.

FIFO and approximations to FIFO
FIFO is usually defined for traffic treated as a continuous flow or traffic treated as discrete vehicles.
In denote the exit times of the same two vehicles from the same cell, link or route.
In contrast to the above, in the CTM, time is treated as discrete time steps, space as discrete cells and vehicle flows as real or fractional numbers that are unlikely to take integer values.Instead of individual vehicles or infinitesimal elements we have finite traffic "cohorts", sometimes referred to as packets or components.Below we define these cohorts in three different ways, corresponding to FIFO levels 1 to 3. In each of these (FIFO levels 1 to 3), traffic is disaggregated into cohorts labelled by the route that they are on.In FIFO level 2 these route cohorts are further disaggregated by the time step in which they entered the current cell and in FIFO level 3 by the time step in which they entered the current link.When we refer to a traffic cohort the meaning should be clear from the context.The cohorts in FIFO levels 2 and 3 could not satisfy the strict inequality in the preceding paragraph since FIFO levels 2 and 3 allows traffic cohorts that entered in two or more consecutive time steps to exit from a cell in a single time step and, conversely, traffic cohorts that enter in a single time step may exit spread over two or more consecutive time steps.FIFO level 0: Ignore FIFO and let traffic exit from a cell in any random time order.
If traffic is in a free-flow state then, in the CTM, all traffic that enters a cell in one time step exits in the next time step, so there is no question as to which component(s) exit first.In that case, FIFO is not an issue.But if the sending capacity of a cell exceeds the receiving capacity of the next cell then there is a problem in deciding which traffic should exit first, second, etc.If FIFO is ignored when making this decision then, for example, some or all of the traffic that entered a cell in say time step t could be held back in the cell indefinitely or forever while traffic that entered much later is let exit, which does not occur in real traffic.
Below we set out three methods referred to above for implementing FIFO in the CTM.The first two of these (FIFO levels 1 and 2) are the methods currently used and the third (FIFO level 3) is proposed here.

FIFO level 1.
FIFO level 1: Let all traffic types (route types) in a cell exit from the cell in proportion to their numbers currently in the cell (their share of the cell occupancy).The traffic that exits from the cell in time step t become the traffic that enters the next cell in the same time step t, and proceed in this way from cell to cell along each link on each route.
Note that in FIFO level 1 above the route types exit in proportion to their numbers in the cell taking no account of when they entered the cell, or previous cells, or in what order.This method may have been adopted from continuous time models, where setting current flow proportions equal to current occupancy proportions does not cause a FIFO problem.
The above proportionality rule is the simplest method for handling FIFO for the CTM and hence may be the most widely used.It has the following undesirable properties which make it a very inaccurate or inadequate way to handle FIFO for the CTM.Suppose that for some consecutive periods the sending capacity of a cell exceeds the receiving capacity of the next cell, so that not all traffic can exit from the cell in the current time step.In that case, FIFO level 1 implies that, of the traffic that enters the cell in time step t, a proportion will exit in time step t+1 leaving some behind, and a proportion of the latter will exit in time step t+2 leaving some behind, and so on, so that even after many time steps some of the traffic that entered in time step t will always remain.In the meantime, some of the traffic that entered later, in time step t+1, will exit in times steps t+1, t+2, etc., which means that much of it exits before traffic that entered earlier, hence causing multiple violations of FIFO at each cell in each time step.It is also of course unrealistic that traffic that entered a cell in a single time step t should exit from it spread over such a long tail, intermixed with other traffic.FIFO level 1 can be interpreted as assuming that when traffic enters a cell it becomes instantly homogeneously mixed with the traffic already in the cell, which of course does not happen in reality and violates FIFO.
Though FIFO level 1 allows excessive deviations from FIFO, it is "closer" to satisfying FIFO for a cell than is FIFO level 0, in two ways.First, unlike FIFO level 0, it can not leave a traffic cohort completely untouched in a cell, as it will force some of it to exit in each time step.Second, if the discretisation of space and time in the CTM is refined to the continuous limit it becomes the continuous LWR model and the problems with FIFO level 1 go away since the continuous LWR model satisfies exact FIFO.

FIFO level 2.
The second method, which we refer to as FIFO level 2, is based on a method set out in Section 4.1 of Daganzo (1995a) for handling FIFO for flows out of the last cell in a link just before a diverge.It lets traffic to each destination exit from the cell in the order that it entered the cell.It was later adapted to handle flows out of ordinary cells in the CTM and with traffic differentiated by spatial routes instead of by destinations (Lo (1999) and Lo and Szeto (2002)): routes allow traffic to be differentiated by origin as well as destination.They were concerned with routes since they were developing models for dynamic traffic assignment (DTA), a key component of which is the allocation of inflows to spatial routes.Also, tracking traffic by destination does not keep track of traffic streams (routes) that have the same destination but take different routes to it.In the present paper, routes are important for the same reasons as above.
Tracking traffic by routes rather than destinations could cause computational problems since the number of routes in a network can be orders of magnitudes larger than the number of destinations.However, to maintain tractability in dynamic network loading (DNL) the standard method is to consider only a very limited number of spatial routes in each run, taking the inflow to each of these routes in each time step as given.If the user is seeking a dynamic user equilibrium (DUE) solution, then the DNL is solved repeatedly and, after each DNL solution is obtained, some routes may be dropped and others added and the origin-destination inflows then readjusted or redistributed among the routes.
In FIFO levels 2 and 3 defined below we let traffic cohorts exit from the current cell in a specified time order.From the CTM we know the amount of traffic, say x, to exit from a cell in the current time step t.To determine which cohorts in the cell are to exit in time step t, sum the cohorts in the cell sequentially starting from the earliest (to be consistent with FIFO) until the total x is achieved.Normally the number of cohorts summing to x will not be an integer number, but will consist of an integer number of cohorts plus a fraction of the last cohort in the sum, or consist of a single fractional cohort.The fractional cohort may consist of traffic on different routes.In FIFO levels 2 and 3 we let these route types exit from the fractional cohort in proportion to their numbers in the cohort.Details of FIFO levels 2 and 3 and their properties are set out below and more detailed algorithms to implement these are set out in Sections 3 to 5.

FIFO level 2 (see preceding paragraph):
Step 0: Label the traffic in the current cell i in cohorts defined by the route that they are following and the time step  in which they entered the current cell.
Step 1: For each cell i: (a) Let the cohorts in the current cell exit from the cell in the same order as they entered it, i.e. let all of the traffic that entered the cell in time step  exit from it before any of the traffic that entered the cell in time step  +1.
(b) Let the route types that enter the cell in each time step, exit from the cell in later time step(s) in the same proportions as when they entered it.
Step 2: Let the traffic that exits from the cell in time step t become the traffic that enters the next cell in the same time step t, and proceed in this way from cell to cell and link to link along each route.
Remark.If the traffic that enters a cell in a single time step, or in two or more consecutive time steps, all exits from the cell together in a later single time step, then step 1(b) above is automatically satisfied and does not impose any additional restriction.The proportionality rule in step 1(b) is triggered only if a cohort that enters the cell in a single time step can not all exit in a single time step and hence has to exit split over consecutive time steps, say t and t+1.In that case, step 1(b) ensures that within each of these split cohorts the same route-type proportions will be maintained.

Proposition 1:
The following hold for FIFO level 2. (a) Traffic cohorts defined by time of entry to a cell will exit from the cell in the same time order as they entered it.
(b) It is not ensured that traffic cohorts of different route types will exit from a cell in the same time order as they entered any previous cell, or entered the link or route.
Proof: (a).This follows from Step 1(a) of the definition of FIFO level 2. (b).This follows from the fact that the traffic cohorts in FIFO level 2 (see Step 0) are not labelled by the time step, or time order, in which they entered any previous cells.To prove part (b) it is sufficient to give an example where it is not ensured.The following is a general example and a more specific example is given just after the proposition.Suppose that the traffic that enters cell i in a single time step t entered some previous cell spread over two or more consecutive time steps.On entering cell i the traffic is immediately relabeled by t, its time of entry to cell i (each route type is labeled as a separate cohort).Now suppose that, when exiting from cell i, the CTM requires that the traffic has to be split between exiting in time steps t' and t'+1.
We can not ensure that the traffic will exit from cell i in the same order as it entered preceding cells, since traffic cohorts are not labelled by the time steps, or time order, of entry to preceding cells.Part (b) follows immediately.
An example of part (b) of the above proposition, involving two routes, is as follows.In this example we compare: (a) letting route types exit from a cell in strict FIFO order and (b) letting route types exit from a cell in the same proportions as they entered the cell.Consider a scenario in which two cohorts (two traffic types) enter a cell i-1 in successive time steps, enter the next cell i merged together in a single time step and, finally, exit from cell i spread again over two time steps.In the following more specific example of this, we see that applying rules (a) and (b) above will yield two different solutions.Suppose that, say, 30 units of r1 (i.e.traffic on route r1) enters cell i-1 in some time step and 10 units of r2 enters the same cell i-1 in in the next time step.Now suppose that both of these cohorts then exit from cell i-1 (enter cell i) together in a single time step.Further, suppose that, say, 20 units of these (30+10 = 40) units exit from cell i in a later time step t and the remaining 20 units exit from cell i in time step t+1.
Exiting in 'proportion'.If we let this traffic exit from cell i in the same proportions as it entered cell i, i.e. 30/10, then 20 units exiting from cell i in time step t consist of 15 units of r1 and 5 of r2, and the same amounts (15 and 5) exit in time step t+1.That means that 5 units of r2 exit from cell i in time step t before 15 units of r2 exit in time step t+1, even though all of r2 had entered a preceding cell (i-2) after r1.That is a FIFO violation.
Exiting in FIFO order.In contrast, if we let traffic exit from cell i in strict cell FIFO order as it entered the previous cell (i-1) then the 20 units exiting from cell i in time step t consists entirely of r1 and the 20 units exiting in time step t+1 consists of 10 units of r1 and 10 of r2, which are not the same proportions as the proportions in which they entered cell i (i.e. the FIFO assignment is not a proportional assignment).
Note that the above examples of FIFO violations involved traffic that entered a cell in a single time step having to exit from the cell split over more than one time step.Suppose that the traffic that enters a cell in a single time step, or in two or more consecutive time steps, always all exits together in a later single time step.In that case FIFO order would be fully preserved from cell to cell and part (b) of the above proposition would not arise.However, it is very unlikely that that would happen, except when traffic is in an uncongested free-flow state so that the inflows and outflows are the same.The FIFO issue arises when the traffic cohorts that enter a cell in a single time step can not all exit in a single time step and have to exit split over two or more consecutive time steps.
The above examples shows that (a) and (b), i.e. 'proportional outflows' versus 'strict FIFO outflows' from a cell, can yield very different results for the route types in the outflows from the cell.In other words, proportional outflows (which are used in part (b) of FIFO level 2) do not ensure FIFO outflows.So why are proportional outflows used as a way of propagating different route types through a network?Some reasons are as follows.
(i) Proportional outflows yield FIFO outflows in the case described in the preceding paragraph, i.e. if a traffic cohort that enters a cell in a single time step exits from that cell within a single time step, then it does not have to exit split in 'proportions' over two or more consecutive time steps.In that case, the issue of applying 'proportional assignment' to exit flows does not arise.
(ii) To ensure FIFO between route types, when considering the outflows from any cell i, we would need to somehow, explicitly or implicitly, trace backwards along the routes to check the time steps (or the order) in which each component of each cohort had entered each previous cell up to cell i.This could be very costly in computing time and storage space, to the extent that it seems impractical.

FIFO level 3.
The example just after Proposition 1 above shows that FIFO level 2 does not ensure that cohorts of different route types will always exit from each cell in a link in the same order as they entered the link.It can be seen from that example, and the proof of part (b) of Proposition 1, that the underlying reason why FIFO level 2 can violate FIFO when it is applied to two or more consecutive cells is that it does not backtrack to check when, or in what order, cohorts entered previous cells.To partially address that problem we introduce FIFO level 3 below, which is based on retaining cohort link-entrytime labels as the cohorts move from cell to cell along the link.To achieve this, we label the cohorts by their time of entry to the current link, rather than by time of entry to the current cell, and let these cohorts exit from each cell in the order in which they entered the link.This does not require any significant additional computational effort or storage and provides a useful alternative to the widely used FIFO level 2.
FIFO level 3: This is set out below and differs from FIFO level 2 only in that, in steps 0 and 1, the word "cell" has been replaced by "current link" in a few places and these are shown in italic.
Step 0: Label the traffic in the current cell i in cohorts defined by the route that they are following and the time step  in which they entered the current link.
Step 1: For each cell i: (a) Let the cohorts in the current cell exit from the cell in the same order as they entered the current link, i.e. let all of the traffic that entered the current link in time step  exit from the cell before any of the traffic that entered the current link in time step  +1.
(b) Let the route types that enter the cell in each time step, exit from the cell in later time step(s) in the same proportions as when they entered it.
Step 2: Let the traffic that exits from the cell in time step t become the traffic that enters the next cell in the same time step t, and proceed in this way from cell to cell and link to link along each route.
Remark.The remark just after the definition of FIFO level 2 above also applies here.
Proposition 2: The following hold for FIFO level 3. (a) Traffic cohorts defined by time of entry to a link will exit from each cell in the link in the same time order as they entered the link, hence will exit from all cells in the link in the same time order.(b) Traffic cohorts defined by time of entry to a cell will exit from the cell in the same time order as they entered that cell.
(c) It is not ensured that traffic cohorts of different route types will exit from a cell in the current link in the same time order as they entered any previous link or any cell in any previous link.
Proof : (a).Consider the first cell of a link.For the first cell of the link, there is no distinction between the time of entry to the cell and time of entry to the link.Hence, letting traffic cohorts exit from that first cell in the time order in which it entered the link means that they also exit from the first cell in the same time order as they entered the cell, i.e. in cell FIFO order and hence link FIFO order.Now consider traffic cohorts exiting from cell 1 into cell 2, and this is the key difference from FIFO level 2. When traffic cohorts (defined by time of entry to the link) exit from the first cell of the link and enter the second cell, their cohort identities are retained, as defined by their time of entry to the link.These traffic cohorts are let exit from cell 1 in the order in which they entered the link and hence enter cell 2 in that order.
The above paragraph can be repeated sequentially for all cells, 3, 4, …., etc., in the link.It follows that the traffic cohorts enter and exit from each cell in the link in the same time order as they initially entered the link.
(b).To see this, consider the three possible cases, as follows.
Case (i), merging: Cohorts that entered the link in consecutive time steps ( and  +1), enter a later cell of the link in a single time step t.In FIFO level 3 these cohorts will exit from the cell in the order in which they entered the link, which is also consistent with the order in which they entered the cell.
Case (ii), splitting: Cohorts that entered the link in a single time step  , enter a later cell i in the link in consecutive time steps, say t and t+1.
In FIFO level 3 these two cohorts (t and t+1) will not be labelled separately but will be stored as a single homogeneous cohort labelled by its link entry time  .However, when the traffic that entered the cell i in time step t exits from that cell, the exiting traffic can be thought of as the first part of the cohort that is labelled  , and when the traffic that entered the cell i in the next time step, t+1, exits from that cell it can be thought of as the remainder of the cohort that is labelled  .Thus, the order in which the traffic cohorts exit from cell i is consistent with exiting from the cell in the same time order as they entered the cell.
Case (iii), neither merging nor splitting: A cohort that entered the link in a single time step  , enters a later cell of the link in a single time step t.In FIFO level 3 this cohort will exit from the cell in the order in which it entered the link, which in this case is the same as the order in which it enters the cell.Since cases (i)-(iii) are the only possible cases, part (b) of the proposition follows immediately.
(c) This follows for reasons similar to those in the proof of part (b) of Proposition 1 and the example just after that proof.In these examples, let i' denote a cell in a link preceding the current link and i denote a cell in the current link.
Proposition 2(b) is the same as Proposition 1(a) and Proposition 2(c) is similar to Proposition 1(b).Proposition 2(a) has no parallel in Proposition 1. Thus we can think of FIFO level 3 as possessing the desirable properties of FIFO level 2 plus an additional desirable property, namely Proposition 2(a) and a weaker version of Proposition 1(b).Of course, both FIFO level 2 and level 3 will sometimes, or often, yield the same results, for example, if the flows on all links and cells are in an uncongested free-flow state.
Proposition 1(b) states that, in FIFO level 2, FIFO is not ensured between cells within a link, and this is illustrated by an example just after that proposition.Proposition 2(a) shows that this does not apply in FIFO level 3 for cells that are within the same link.To illustrate this, we rework the example from just after Proposition 1, by applying FIFO level 3 instead of level 2, as follows.In that example suppose that cell i-1 is the first cell in a link.The 30 units of r1 and 10 units of r2 would still enter cell i-1 (enter the link) in successive time steps and exit from cell i-1 together in time step  .However since, in FIFO level 3, cohorts entering each cell i are labelled by the time steps in which they entered the link, the 30 units and 10 units that enter cell i together in time step  will have different (successive) time step labels (while in FIFO level 2 they had the same time step label).As a result, they will be let exit from cell i in link FIFO order, i.e. 20 units of r1 in time step t followed by 10 units of r1 and 10 units of r2 in time step t+1.
Since FIFO levels 2 and 3 consist of well-defined, deterministic steps to determine the order in which traffic cohorts exit from each cell, link and route, they define unique solutions.

Implementing FIFO in a link carrying a single traffic type on a single route
The simplest scenario in which to consider FIFO is for a cell carrying a single traffic type on a single route.In that case there is actually no need to consider FIFO since the flows and occupancies are undifferentiated homogeneous quantities hence we can simply assume that they are in FIFO order (see Section 1.2 above).Nevertheless, we here formally set out how to ensure FIFO in this case, as a starting point for extending this to allow multiple routes in the following sections, 4 and 5.In the present case the above definitions of FIFO levels 2 and 3 reduce to simply: let traffic cohorts exit from the cell in the order as they entered it, which can be fully implemented as follows.At the current time step t and cell i, let t i u 1  denote the amount of traffic exiting from cell i to i+1 in time step t and let t i x  denote the amount of traffic that entered cell i in time step and is still in the cell at the beginning of time step t.
At the current time step t we take the current cohorts t i x  occupying cell i and the current total outflow t i u 1  from cell i as given.The task then is to use these to compute the values of these variables for the next time step t+1, while ensuring cell FIFO.This can be done as follows.
Use the cell-transmission model (CTM) to compute the outflows t i u 1  from cell i in time step t.The CTM flow function can be written as, are as defined in Daganzo (1995b), that is, is the increasing (or nondecreasing) part of the flow-occupancy function continued to the right as a horizontal straight line and is the decreasing (or nonincreasing) part of the flowoccupancy function continued to the left as a horizontal straight line.

Given the total outflow t i u 1
 from (1.1), the next step is to find which of the = …, t, cohorts t i x  in cell i in time step t will exit to achieve this outflow in time step t.To do that, first find the latest cohort ( *) that will exit, by summing the candidate cohorts up to the known total x  , = 0, …, *-1, exit from the cell in time step t, plus a part of cohort t i x *  exits, the part being x .That means that in the next time step t+1 these cohorts are reduced to 1 ,  t i x  = 0, for = 0, …, *-1, and .3.4)This completes the updating of the cohorts t i x  and outflows 1 1   t i u to the next time step.
To ensure link FIFO for this simple scenario, repeat the above steps for all cells i = 1, …, I, along the link for all time steps t = 1,…, T.
Before considering further how to implement FIFO levels 2 and 3, recall that in the CTM the flows from cell to cell are computed by "min" function in (1.1) above, which computes the aggregate outflow based on the aggregate occupancy of the current cell and of the next downstream cell.It is only after this aggregate outflow is determined and computed that we consider the disaggregation of this outflow by route and by time of entry and exit and this disaggregation is performed by applying FIFO rules.Hence in the discussion of FIFO below we will assume that the aggregate inflows to the cell and outflows from the cell are already computed and known.

Implementing FIFO level 2
The origins of this FIFO method are outlined briefly in the first paragraph in Section 2.2 above.Here we present an algorithm to implement FIFO level 2 and also some elucidation and explanation of the process.These could be separated, to present the formal algorithm separately, but we present them 5 At several points in the algorithms in Sections 3, 4 and 5 we sum over sets such as { t i x  , = 0, …, *-1} or { t ir x * e  , e = 0, …, 1 e *  r } though in many of these cases only the last few elements in the set may be non-zero and it would more efficient to sum only over the latter non-zero elements.That can be done by letting say i  denote the first element in the set = 0, 1, …, that is non-zero and then sum over = i  , …, *-1, instead of = 0, …, *-1.Similarly, at other points there is no need to keep rechecking the values of variable with subscripts say < i  or e < i e .We have omitted these refinements in this paper to simplify the presentation, but they can be introduced in any computer implementation of the methods.They are discussed in some detail in the papers by Daganzo referred to above and by Cayford, Lin and Daganzo (1997).
together to reduce repetition.The algorithm below consists of the above (Section 3) algorithm extended to cope with more than one route type in each cell.FIFO level 2 can be implemented as follows for a link.Let t r i u , 1  denote the traffic on route r exiting from cell i to i+1 in time step t denote the aggregate traffic exiting from cell i to i+1 in time step t t ir x  denote the traffic on route r that entered cell i in time step and is still in the cell at the beginning of time step t t i x  =  R r t ir x  denote the aggregate traffic that entered cell i in time step and is still in the cell at the beginning of time step t.The algorithm below is bracketed by a nested loop "For each time step t = 1, …, T," and "for each cell i = 1,…, I".The text within the nested loop is the FIFO level 2 algorithm for a cell i at time step t and the loop applies this sequentially over all the cells in the link for all time steps.
For each time step t = 1, …, T, for each cell i = 1, …, I : At time step t take the current cohorts t ir x  occupying cell i as given for all R r  .The task then is to use these values to compute the values of the same variables for the next time step t+1, while ensuring FIFO level 2 for the cell.This can be done as follows.
As in (1.1) in Section 3, use the CTM to compute the aggregate outflow (2.1) (i).Decompose the outflow t i u 1  from cell i in time step t by route type R r  (by extending the method of Section 3) Consider the cohorts t i x  in cell i in time step t, which are labeled by = …, t, their time of entry to the cell.To determine which of these cohorts will exit from the cell in time step t, note that the exiting cohorts must sum to t i u 1  hence sum the candidate cohorts up to the known total outflow t i u 1  given by (2.1), i.e.
Thus the integer (whole) cohorts that exit from the cell in time step t are t i x  , = 0, …, *-1 and the components of these are t ir x  , for all rR, = 0, …, *-1.So that the exiting cohorts sum to Applying this fraction F to each of the rR, components of Combining the above results from the possible integer cohorts and possible fractional cohort, means that the known total outflow t i u 1  from cell i in time step t can now be decomposed into its sub components t r i u , 1  in terms of the decomposed occupancy cohorts from above, thus (2.2.3) and, by construction, . The purpose of computing the quantities t ir x  and t r i u , 1  , that exit from cell i in time step t, is to use them in (ii) below to update the cohorts t ir x  in the cell to the next time step t+1.
(ii).Update the cohorts t i x  and their components t ir x  in cell i to the next time step, t+ 1.
Since the cohorts t i x  , = 0, …, *-1, all exit from the cell in time step t we reset these variables, and their components, to zero for the next time step t+1, thus, x  for = 0 to *-1, for all rR. (2.3.1) Since the fractional amounts of (2.3.2) The remaining cohorts in cell i at time step t, namely t ir x  , = *+1, …, t-1, do not exit in time step t hence will remain there in the next time step, thus, x  for all rR and = 0, …, t. end i end t.

Implementing FIFO level 3
The simplest way to construct an algorithm for FIFO level 3 is by making minor changes in the algorithm for FIFO level 2 which is set out in Section 4. The only change needed there is to redefine the superscript to mean "time of entry to the current link" instead of "time of entry to the current cell".More specifically, in the definitions of t ir x  and t i x  in the first paragraph in Section 4 change the phrase "entered cell i in time step " to "entered the current link in time step ".Also, when referring to t i x  in the line just after the heading "(i)" in Section 4, change "labelled by = …, t, their time of entry to the cell" to "labelled by = …, t, their time of entry to the link".The rest of the algorithm remains the same, though the number of cohorts in each cell may now be different, since defining cohorts by their time of entry to the link may yield more, or fewer, cohorts in the cell than defining them by time of entry to the cell.

Extending FIFO from single links to networks
The CTM was initially stated for a single link (Daganzo (1994)) with a single traffic type (i.e.without multiple routes, etc.) hence FIFO was not an issue.The CTM was later extended to a network by introducing link merges and diverges (Daganzo (1995a)).FIFO did not arise as a separate issue for merges and arose as an issue for diverges only for the cell pointing into a diverge and that was handled by a method similar to what we refer to in this paper as FIFO level 2. In this section we recall how FIFO level 2 is ensured for diverges in Daganzo (1995a) and extend this to FIFO level 3. We then outline how FIFO (levels 2 and 3) are implemented at merges and note that the method is just the same as already set out in Sections 2 and 5 above.
Ensuring FIFO levels 2 and 3 for route flows into diverges A procedure for ensuring FIFO (level 2) for traffic flowing through a diverge is set out in Section 4 of Daganzo (1995a).He considers a diverge where link A points into links B and C and the traffic in link A is disaggregated (labeled) by destination type (B or C) and by time of entry to the final cell in link A (actually by the dwell time in that cell).But no record is kept of the times of entry to the link, which would be needed to implement FIFO level 3.The procedure thus ensures that traffic exits from link A (enters B or C) satisfying FIFO level 2. This can be extended to FIFO level 3 (for traffic exiting from link A) in exactly the same way as FIFO level 2 was extended to FIFO level 3 for single links in earlier Sections 2.3 and 5.
To help further explain the above, and for reference and completeness, we here very briefly summarize the Daganzo (1995a) method for handling flows through a diverge for traffic with known routes.Consider a diverge where link A feeds directly into links B and C. Compute the sending capacity of the final cell of A and the receiving capacities of the first cells of B and C respectively in the usual way for the CTM and hence state the following three constraints: (i) Flow A to B + flow A to C ≤ sending capacity of A (ii) Flow A to B ≤ receiving capacity of B (iii) Flow A to C ≤ receiving capacity of C Now start from the earliest cohort currently present in the final cell of link A and consider each cohort in turn in ascending order of its entry time to that cell.Each such cohort consists of two components, namely route types B and C. From each cohort, add the component type B to the left-hand-side of constraints (i) and (ii) above and add the component type C to the left-hand-side of constraints (i) and (iii) above.Stop when any one of the constraints (i)-(iii) is violated or becomes binding.At that point, either the sending capacity of link A is exhausted (case (i)) or the receiving capacity of links B or C is exhausted (cases (ii) or (iii)).
Note that if some traffic of route type B can not currently exit from link A (because of constraint (ii)) then traffic of route type C may not be able to exit either, even if (iii) is not binding.Traffic of type C will be 'stuck' behind traffic of type B, unless the traffic cohorts to exit next consist entirely of type C. The same problem can of course occur the other way round, with type C blocking the exit of type B. This phenomenon is well-known in real traffic and is not caused by the CTM.It was noted in the context of the CTM by Daganzo (1995a) and later authors.
Ensuring FIFO levels 2 and 3 for cell flows leading into merges Handling FIFO for merging traffic is somewhat simpler than for diverging traffic, because the issues raised in the last few sentences above do not arise.(That is, traffic is exiting to a single branch hence can not be held back because of being mixed with traffic for another branch that is blocked.)Consider a simple merge consisting of two links A and B with outflows A-C and B-C merging into a single link C. The process for computing the flows A-C and B-C, and ensuring that they satisfy FIFO levels 2 and 3, can be set out in the following two steps.1. Compute the flows A-C and B-C for time step t, as set out in for example Daganzo (2005a).2. Take the computed flow A-C and process its components out of link A in FIFO order (FIFO level 2 and 3 as desired) in exactly the same way as already set out in Sections 2 to 5 for cells within a single link.Then do the same for the computed flow B-C and we are done.It does not matter whether A-C or B-C is processed first, since the only interaction between them is on entry to link C and step 1 has already determined the total quantities of each that are to enter C, and hence are feasible to enter link C in time step t.
For reference and completeness, Step 1 above can be expanded and summarized as follows.Compute the sending capacities of the final cells of A and B and the receiving capacity of the first cell of C in the usual way and hence state the following three constraints: (i) Flow A to C + flow B to C ≤ receiving capacity of C (ii) Flow A to C ≤ sending capacity of A (iii) Flow B to C ≤ sending capacity of B For merging traffic there will usually also be some additional relationship between the merging flows A-C and B-C.For example, as in Daganzo (1995b), we may assume that these flows filter into link C in fixed proportions, up until one of the sending links has no more to send, i.e. up until (ii) or (iii) become violated or binding.The flows A-C and B-C are computed as the maximum flows that can be achieved, subject to the above proportionality constraint and the constraints (i)-(iii).These computed flows A-C and B-C will be unique.
The results from the above paragraphs can be summarized as follows.For cells pointing out of a diverge and cells pointing into or out of a merge, the method for implementing FIFO is the same as for ordinary cells, already set out in Sections 2 to 5. For cells pointing into diverges, the method for implementing FIFO set out in Daganzo (1995a) and elsewhere and summarised above, ensures FIFO level 2. This can be adapted to handle FIFO level 3 in the exactly same way that, for ordinary cells, FIFO level 2 was adapted to give FIFO level 3 in Sections 2.3 and 5.

Origin-destination FIFO
The CTM has usually been applied with the inflows to each spatial route at each time step taken as given, as in dynamic network loading (DNL).In that case, for any given origin-destination (OD) pair the route travel times, or costs, will in general not be equal.However, the CTM has also been used as the DNL component in traffic assignment models for dynamic user equilibrium (DUE), initially by Lo (1999) and Lo and Szeto (2002).In a user equilibrium, by definition, for each OD pair the travel costs on all utilized routes linking the OD pair will be equal, and will be less than or equal to the travel costs for any unutilised routes.For DUE it is usual to take costs as equal to travel times and we follow that here, so will refer to time-based DUE.To achieve a time-based DUE the spatial route inflows in the CTM are iteratively adjusted until the DNL yields a time-based DUE, i.e., yields equal travel times on all utilized routes for each OD pair.In that case, we would expect that FIFO should hold for all routes linking a given OD pair, as well as for each route taken separately.OD FIFO and dynamic user equilibrium can be defined as follows.
Origin-destination FIFO: For traffic between an OD pair, the time order of arrival at the destination is the same as the time order of departure from the origin, regardless of the route taken.
Dynamic user equilibrium (DUE): If there are two or more routes between any OD pair then, for traffic setting out on these routes at the same point in time, the travel times on the utilized routes will be the same and will be less than or equal to the travel times on any unutilized routes.Proposition 3. Let DUE hold for traffic between an OD pair.Then, if FIFO holds for any one utilized route between the OD pair, it holds for all the utilised routes between the OD pair, hence OD FIFO holds for the OD pair.
Proof.Consider a single OD pair.In a user equilibrium, traffic setting out at time t on each utilized route will arrive at the destination at the same time and, similarly, traffic setting out at time t+1 on each utilized route will arrive at the destination at the same time, and so on.Hence if the cohorts setting out on any one utilised route at times t, t+1, …, arrive at the destination in FIFO order, then the traffic on all other utilized routes must arrive at the destination in the same time order, hence in FIFO order.

Concluding remarks
This paper considers FIFO for cells, links and routes in the cell-transmission model for DNL or DTA.It defines different levels of approximating FIFO (levels 0, 1, 2 and 3).Level 0 refers to ignoring FIFO and letting traffic exit from each cell in an arbitrary order, which can cause unlimited deviations from FIFO.Some mechanism or method for ensuring or approximating FIFO is essential and the simplest method, referred to here as FIFO level 1, is a proportionality method that is often used.However, this method does not take account of the time order in which the traffic entered the cell, link or route hence can provide a very poor approximation to FIFO.The usually recommended method, which we refer to here as FIFO level 2, ensures that traffic exits from each cell in the same time order as it entered the cell.It is shown in Proposition 1(b) that FIFO level 2 allows violations of FIFO to occur over any sequences of two or more cells.We introduced FIFO level 3, which extends FIFO level 2 to ensure that FIFO is maintained for all sequences of cells within each link.However, it does not ensure FIFO between links along a route.
Keeping track of the times at which cohorts enter the cell (as in FIFO level 2) or link (as in FIFO level 3) is thus not sufficient to fully ensure FIFO.To fully ensure FIFO for traffic cohorts exiting from each cell it may be necessary to keep track of the time steps, or time order, in which each of these cohorts entered or exited from all previous cells on their routes.However, implementing that in practice for a network may be prohibitively costly in computing time and memory space, and may undermine the simplicity of the CTM which is one of its main attractions.
An argument for relaxing the FIFO requirement is that Daganzo (1994Daganzo ( , 1995aDaganzo ( , 1995b) ) showed that, as the discretisation in the CTM is refined to the continuous limit, the CTM converges to the continuous LWR model, and in the continuous limit there are no FIFO violations.However, it is not clear how FIFO violations behave or decrease as the step sizes decrease towards the continuous limit.If we take no steps to ensure FIFO (as in FIFO level 0), or adopt FIFO level 1, then we can construct examples in which the time deviations from a FIFO order are arbitrarily large even as the step sizes approach the continuous limit.
There is a further, related, reason for concern with more accurate application of FIFO, as follows.For tractability in applying the CTM, the cells and time steps are often made relatively "large" to avoid the method becoming too computationally slow or costly.That is particularly so for larger scale network applications and for applications that involve repeated runs of the CTM, for example when the CTM is used in stochastic simulations or used for the dynamic network loading (DNL) step in algorithms for dynamic traffic assignment.As time step sizes are made larger it is likely, though not certain, that FIFO violations will become larger.More accurate application of FIFO will help avoid this.The currently recommended method of choice is FIFO level 2. FIFO level 3 has similar computing and storage requirements as FIFO level 2.
An additional reason for seeking to implement FIFO is that it is needed to obtain accurate or reliable estimates of link or route travel times.The CTM is stated entirely in terms of cell flows and occupancies but travel times for cells, links and routes can be computed from the solution of the CTM, as outlined in Appendix 1.The accuracy or reliability of these travel times depend on FIFO being adhered to.If there are FIFO violations then, for example, traffic that enters the same route in the same time step will tend to exit at the destination spread over a range of exit times that are due to deviations from FIFO rather than modelling of traffic behaviour.
As noted in Appendix 1, we can take the solution obtained using FIFO levels 2 or 3 and use this to construct cumulative inflow and outflow curves for each route.We can then use these curves to find the exit time, or time step(s), t for traffic that entered the route at each time, or time step, tau.In this way, we can (appear to) order the traffic exiting from each route in the same time order as it entered the route, that is, in route FIFO order.However, we have to be careful how we interpret route FIFO order that is obtained in this way.We saw in Proposition 1(b) and 2(c) that FIFO levels 2 and 3 do not ensure FIFO across sequences of cells or links, and hence do not ensure route FIFO.The route FIFO obtained above from the cumulative curves is useful in obtaining estimates of route travel times but, as noted in Appendix 1 below, the estimates are accurate only to the extent that FIFO levels 2 or 3 actually achieve FIFO.


exiting (from cell i to i+1 in time step *) are t ir x *  F, for all rR.
in the cell in the next time step t+1 are both cases only a single vehicle, or an infinitesimal element of traffic, can enter or exit at any time instant t.In both cases, FIFO is said to hold if and only if