Estimating multi-class dynamic origin-destination demand through a forward-backward algorithm on computational graphs

03/12/2019
by   Wei Ma, et al.
Carnegie Mellon University
0

Transportation networks are unprecedentedly complex with heterogeneous vehicular flow. Conventionally, vehicle classes are considered by vehicle classifications (such as standard passenger cars and trucks). However, vehicle flow heterogeneity stems from many other aspects in general, e.g., ride-sourcing vehicles versus personal vehicles, human driven vehicles versus connected and automated vehicles. Provided with some observations of vehicular flow for each class in a large-scale transportation network, how to estimate the multi-class spatio-temporal vehicular flow, in terms of time-varying Origin-Destination (OD) demand and path/link flow, remains a big challenge. This paper presents a solution framework for multi-class dynamic OD demand estimation (MCDODE) in large-scale networks. The proposed framework is built on a computational graph with tensor representations of spatio-temporal flow and all intermediate features involved in the MCDODE formulation. A forward-backward algorithm is proposed to efficiently solve the MCDODE formulation on computational graphs. In addition, we propose a novel concept of tree-based cumulative curves to estimate the gradient of OD demand. A Growing Tree algorithm is developed to construct tree-based cumulative curves. The proposed framework is examined on a small network as well as a real-world large-scale network. The experiment results indicate that the proposed framework is compelling, satisfactory and computationally plausible.

READ FULL TEXT VIEW PDF
POST COMMENT

Comments

There are no comments yet.

Authors

page 21

page 22

page 23

10/15/2019

Background Segmentation for Vehicle Re-Identification

Vehicle re-identification (Re-ID) is very important in intelligent trans...
10/17/2019

Predicting origin-destination ride-sourcing demand with a spatio-temporal encoder-decoder residual multi-graph convolutional network

With the rapid development of mobile-internet technologies, on-demand ri...
02/21/2022

Data-Driven Traffic Assignment: A Novel Approach for Learning Traffic Flow Patterns Using a Graph Convolutional Neural Network

We present a novel data-driven approach of learning traffic flow pattern...
01/26/2019

Estimating multi-year 24/7 origin-destination demand using high-granular multi-source traffic data

Dynamic origin-destination (OD) demand is central to transportation syst...
03/13/2021

Spatio-temporal Modeling for Large-scale Vehicular Networks Using Graph Convolutional Networks

The effective deployment of connected vehicular networks is contingent u...
01/29/2019

Statistical inference of probabilistic origin-destination demand using day-to-day traffic data

Recent transportation network studies on uncertainty and reliability cal...
06/17/2020

A two-dimensional multi-class traffic flow model

The aim of this work is to introduce a two-dimensional macroscopic traff...
This week in AI

Get the week's most popular data science and artificial intelligence research sent straight to your inbox every Saturday.

1 Introduction

Transportation networks are unprecedentedly complex with heterogeneous vehicular flow. Conventionally, vehicle heterogeneity are considered by vehicle classifications (such as standard passenger cars and trucks). However, vehicle flow heterogeneity stems from many other aspects in general, e.g., ride-sourcing vehicles versus personal vehicles, human driven vehicles versus connected and automated vehicles. How to effectively manage the multi-class vehicles in a complex transportation system so as to improve the network efficiency presents a big challenge. As an indispensable component of dynamic transportation network models with heterogeneous traffic, the multi-class dynamic origin-destination (OD) demand plays a key role in transportation planning and management to understand spatio-temporal vehicular flow and its travel behavior. To our best knowledge, there is a lack of studies to understand and estimate the dynamic OD demand of multiple vehicle classes using sparse and partial flow observations. In view of this, this paper presents a data-driven framework for multi-class dynamic OD demand estimation (MCDODE) in large-scale networks. The MCDODE formulation is represented on a computational graph, and a novel forward-backward algorithm is proposed to estimate the OD demand efficiently and effectively. The proposed MCDODE framework is examined in a small networks as well as a real-world large-scale network to demonstrate the estimation accuracy and the computational efficiency.

The multi-class dynamic OD demand (MCDOD) represents the number of vehicles in each of the vehicle classes (e.g. personal cars, trucks, ride-sourcing vehicles) departing from an origin and heading to a destination in a particular time interval. The definition of “classes” is very general, by vehicle sizes, specifications, and nature of trips. The MCDOD reveals the fine-gained traffic demand information for different vehicle classes and the overall spatio-temporal mobility patterns can be inferred from the OD demand and its resultant path/link flows. Policymakers can understand the departure/arrival patterns of multi-class vehicles through the MCDOD. The MCDOD also helps the policymakers understand the impact of each vehicle class on the roads, and hence each class of vehicles can be managed separately. In addition, most of Advanced Traveler Information Systems/Advanced Traffic Management Systems (ATIS/ATMS) would require accurate MCDOD as the model input [huang2007multiclass].

The dynamic OD estimation (DODE) has been extensively studied over the past few decades. A generalized least square (GLS) formulation is proposed for estimating dynamic OD demand with exogenous route choice model [cascetta1993dynamic]. The GLS formulation is further extended to a bi-level optimization problem, and the bi-level formulation solves for the DODE with endogenous route choice model [tavana2001internally]. Advantages and disadvantages of the bi-level formulation are discussed in [nguyen1977estimating, leblanc1982selection, fisk1989trip, yang1992estimation, florian1995coordinate, jha2004development]. The Stochastic Perturbation Simultaneous Approximation (SPSA) methods have also been adopted to solve the bi-level formulation in many studies [balakrishna2008time, cipriani2011gradient, lee2009new, vaze2009calibration, ben2012dynamic, lu2015enhanced, tympakianaki2015c, antoniou2015w]. zhang2017efficient, osorio2019dynamic proposed an instantaneous approximation for the dynamic traffic assignment models, and the DODE problem is cast into a convex optimization which can be solved efficiently. The bi-level formulation can also be relaxed to a single-level problem and solved by updating the OD demand using gradient-based methods [nie2008variational, lu2013dynamic].

The DODE problem can be viewed as a statistical estimation problem. For example, a statistical inference framework using Markov Chain Monte Carlo algorithm was proposed to estimate the probabilistic OD demand

[hazelton2008statistical]. zhou2003dynamic proposed a DODE framework with multi-day data and established a hypothesis testing framework to identify the demand evolution within a week. In addition to the off-line DODE methods, the DODE formulation can also be solved with real-time data streams for ATIS/ATMS applications. bierlaire2004efficient extended the GLS formulation on large-scale networks and solved the formulation efficiently on a real-time basis. The state-space models are also used to estimate the dynamic OD of each time interval sequentially [zhou2007structural, ashok2000alternative].

The DODE methods often encapsulate the dynamic traffic assignment (DTA) models within the bi-level formulation. Various DTA models can be adopted to model the network dynamics and travelers’ behaviors. For example, Dynamic Network Loading (DNL) models [ma2008polymorphic] simulate the vehicle trajectories and traffic conditions given determined the origin-destination (O-D) demand and fixed routes; Dynamic User Equilibrium (DUE) models [mahmassani1984dynamic, nie2010solving] search for the equilibrated travelers’ route choices to achieve user optima; Dynamic System Optimal (DSO) models [shen2007path, qian2012system, ma2014continuous] explore the optimal conditions under which the total network costs are minimized.

The multi-class traffic assignment models and OD estimation models can be built by extending the single-class models. However, the main challenges are how to estimate MCDOD in such a way to match multi-source spatio-temporal data in a large-scale transportation network. A number of studies [gundaliya2008heterogeneous, venkatesan2008development, qian2017modeling] investigate the multi-class traffic flows in general networks. The multi-class DTA models are studied by dafermos1972traffic, yang2004multi, huang2007multiclass without the real-world data validation. There are studies estimating the static OD demand for multiple vehicle classes [wong2005estimation, raothanachonkun2006estimation, noriega2007multi, zhao2018multiclass]. In particular, shao2015estimation estimated the probabilistic distribution of the multi-class OD using traffic counts. The research gap lies in estimating MCDOD in large-scale networks that are consistent with real-world multi-source traffic data.

In this paper, we develop a data-driven framework that estimates the multi-class dynamic OD demand using traffic counts and travel time data that are partially observed in general networks. The proposed framework formulates the MCDODE problem and represents it with a computational graph. The MCDODE is solved with a novel forward-backward algorithm on the computational graph. The MCDODE framework can be solved using multi-core CPUs or Graphics Processing Units (GPUs), and hence the proposed method can be computational efficient and applied to the large-scale networks and multi-day data. The closest work to this paper is that of wu2018hierarchical, which constructs a layered computational graph for the single-class static OD estimation problem. This paper extends the computational graph approach to the case of multi-class dynamic OD demand by tackling additional challenges on the incorporating flow dynamics and characteristics across both classes and time of day. We also build a novel framework to evaluate the gradients of multi-class OD demand for simulation-based traffic assignment models. The main contributions of this paper are summarized as follows:

  1. [label=0)]

  2. We propose a theoretical formulation for estimating multi-class dynamic OD demand. The formulation is represented on a computational graph such that the MCDODE can be solved for large-scale networks with large-scale traffic data. The proposed MCDODE formulation can handle any form of traffic data, such as flow, speed or trip cost.

  3. We propose a novel forward-backward algorithm to solve for the MCDODE formulation on the constructed computational graph with simulation-based traffic assignment models.

  4. We use a tree-based cumulative curves to evaluate the gradient of multi-class dynamic OD demand in the forward-backward algorithm, and a Growing Tree algorithm is proposed to construct the tree-based cumulative curves during the traffic simulation.

  5. We examine the proposed MCDODE framework on a large-scale network to demonstrate its effectiveness and computational efficiency of the solution algorithm.

The remainder of this paper is organized as follows. Section 2 presents the formulation details of MCDODE. Section 3 describes the solution pipeline and discusses practical issues for MCDODE framework. In section 4, a small network is used to demonstrate the accuracy, efficiency and robustness of the MCDODE framework. In addition, we demonstrate the scalability and computational efficiency of the proposed framework using real-world data in a large-scale network. At last, conclusions are drawn in section 5.

2 Formulation

In this section, we discuss the multi-class dynamic origin-destination estimation (MCDODE) framework. We first present the notations used in this paper, and then the multi-class dynamic network flow is modeled. Secondly, the MCDODE problem is formulated and represented on a computational graph. We then solve the MCDODE through a novel forward-backward algorithm.

2.1 Notations

Notations are summarized in Table 1.

The set of all links
The set of all OD pairs
The set of all paths between OD pair
The set of indices of the observed flow
The set of indices of the observed travel time
The set of all time intervals
The set of vehicle classes
Variables as scalars
The index of departure time interval of path flow or OD flow
The index of arrival time interval at the tail of link
index of vehicle class
The flow arriving at the tail of link in time interval for vehicle class
The link travel time of link in time interval for vehicle class
The flow of OD pair in time interval for vehicle class
The th path flow for OD pair in time interval for vehicle class
The route choice portion of choosing path in all paths between OD pair in time interval for vehicle class
The path travel time of th path for OD pair in time interval for vehicle class
The observation/link incidence for link in time interval and observed flow for vehicle class
The weight of travel time for in the observed travel time
The portion of the th path flow departing within time interval between OD pair which arrives at link within time interval for vehicle class (namely, an entry of the DAR matrix)
The th observed flow, which might be a linear combination of link flow across vehicle classes, road segments and over time intervals
The th observed travel time, which might be a linear combination of link travel time across vehicle classes, road segments and over time intervals
Variables as tensors

The vector of the observed flow

The vector of the observed travel time
The vector of link flow for vehicle class
The vector of link travel time for vehicle class
The vector of path flow for vehicle class
The vector of path travel time for vehicle class
The observation/link incidences matrix for vehicle class
The travel time weight matrix for vehicle class
The matrix of route choice portions for vehicle class
The dynamic assignment ratio (DAR) matrix for vehicle class
Table 1: List of notations

2.2 Modeling multi-class dynamic network flow

In this section, we first formulate a general network model for multi-class traffic flow in discrete time. We denote the path flow as the number of class- vehicles departing from th path for OD pair in time interval and link flow as the number of class- vehicles arriving at the tail of link in time interval . The relationship between path flow and link flow is presented in Equation 1.

(1)

where is the set of all OD pairs, and is the path set for OD pair . is the set of all possible time intervals during study period. To avoid confusion, we denote departure time interval of path flow or OD flow as , and the arrival time interval at the tail of link as , respectively. The dynamic assignment ratio (DAR) denotes the portion of the th path flow departing within time interval for OD pair which arrives at link within time interval for vehicle class [ma2018estimating]. For each OD pair , there are paths for travelers to choose from, and the portion of choosing path in time interval for vehicle class is denoted as . The OD flow and path flow for vehicle class can be represented by Equation 2.

(2)

where OD demand represents the number of class- vehicles for OD pair in time interval . The link travel time, path travel time and DAR can be obtained from the dynamic network loading (DNL) models, as presented in Equation 3.

(3)

where represents the multi-class dynamic network loading models. The travel time can be generalized to any form of the disutility as long as it can be simulated by . The generalized travel time can include roads tolls, left turn penalty, travelers’ preferences and so on. The DNL function takes the multi-class path flow as input and outputs the spatio-temporal network conditions and the DAR matrix . Though there exists analytical solutions in small networks, is usually represented by simulation-based models in large-scale networks. Many existing models including, but are not limited to, DynaMIT [ben1998dynamit], DYNASMART [mahmassani1992dynamic], DTALite [zhou2014dtalite] and MAC-POSTS [qian2016dynamic, CARTRUCK], can be potentially used as function .

The route choice portion is obtained from a generalized route choice function, as presented in Equation 4.

(4)
(5)
(6)

where is a generalized route choice model that takes in the path travel time and link travel time before time interval and computes the route choice portion for travelers in th path of OD for vehicle class . We further denote as the travel time of link in time interval for vehicle class , and as the travel time of path flow in OD pair departing in time interval . Most of the state-of-art route choice models [prashker2004route, zhou2012c]

, including Logit and Probit models, satisfy Equation 

4. The Logit and Probit models have been adopted in many studies and achieved great success in real-world applications [maher2001bi]. Combining Equation 1 and 2, we present the relation of link flow and OD flow in Equation 7.

(7)

2.3 Modeling the observed flow and observed travel time

In this section, we describe the concept of the observed flow and observed travel time. The motivation for the definition of the observed flow and travel time lies in the indirect and aggregated observations of traffic networks. For example, loop detectors measure the traffic counts in each time interval, but the vehicle classes cannot be differentiated. The Department of Transportation regularly hire individuals to count the vehicles on road segments for both directions and different vehicle classes. In this case, the observation of traffic flow does not differentiate road directions.

To accommodate different kinds of flow observations, we propose the concept of observed flow, denoted by , as a linear combination of link flow across vehicle classes, road segments and time intervals. The formulation of the observed flow is presented in Equation 8.

(8)

where is the index of observed flow and is the set of indices of observed flow. The unit of is the same as . For example, if there are two loop detectors recording the traffic counts in each interval, then we have . By formulation 8, the observed flow can be the traffic count observations in various forms, including traffic counts of a single-class vehicles, aggregated traffic counts of all vehicles, aggregated traffic counts of a road for both directions, and aggregated traffic counts of multiple links. The link/observation incidence represents how the observed flow is aggregated. is if link flow is observed in the observed flow and otherwise, and a similar definition can be found in yang2018stochastic.

Similarly, we may also observe the travel time across multiple links, vehicle classes and time intervals. For example, we may observe the total travel time of a highway which consists of multiple consecutive links, or we may observe the average travel time of car and trucks in a single link. To accommodate different kinds of travel time observations, we assume the observed travel time can be represented by a linear combination of all link travel time, as presented in Equation 9.

(9)

where represents the weight of travel time for in the observed travel time . The unit of is the same as . is the index of observed travel time and is the set of indices of observed travel time. The formulation 9 is also general enough to accommodate various types of travel time observations. For example, the observed travel time includes link travel time of a single-class vehicles, path travel time of single-class vehicles, average travel time of all vehicle classes. We note that since we may observe the average travel time of multiple links, while because traffic flow is usually observed in an aggregated manner.

Example 1.

To illustrate the formulation of the observed flow and observed travel time, we consider a two-link network presented in Figure 1. We only consider one time interval, hence . We assume vehicle class represents cars, and vehicle class represents trucks.

Figure 1: A two-link network

Suppose we observe cars passing link and vehicles (trucks and cars) passing link , then we have

Therefore

Similarly, if we observe the travel time for traversing link and link is for cars, and the average travel time of link is for cars and trucks.

Then we have

We note the “average travel time for cars and trucks” means the “average” of car travel time and truck travel time, respectively. It is also possible to consider the weighted average of travel time by car and truck flow together, which will be discussed in section 2.6.

2.4 MCDODE formulation

The formulation for multi-class dynamic origin-destination estimation (MCDODE) is presented in Equation 10.

(10)

where and are the observed flow and travel time data collected from real-world. The link/path travel time can be computed through tracking cumulative curves in the DNL model [lu2013dynamic], and the computation for DAR will be discussed in section 3.2. The parameters and are the weight for each objective, respectively.

Equation 10 is a bi-level optimization problem with upper level minimizing the norm between observed and estimated flow and travel time, and the lower level solves the traffic assignment problem denoted by function and . When represents the Dynamic User Equilibrium (DUE) conditions, Equation 10 is a Mathematical Program with Equilibrium Constraints (MPEC) problem. In contrast, when represents the Logit-model, Equation 10 can be formulated as either a bi-level optimization problem or a single-level non-linear optimization problem [davis1994exact, ma2018generalized].

Additional data sources, such as the historical OD demand and survey data, can also be used in the demand estimation. The DODE methods with these data have been extensively studied [zhang2008estimating, wu2018hierarchical]. This paper focuses on the computational graph approach with observed traffic flow and travel time data, while other data can be potentially incorporated into the proposed framework.

The solution algorithm for the bi-level problem has been extensively studied over the past few decades. Various heuristic methods have been developed to solve the bi-level problem efficiently. For example, heuristic iterative algorithms between lower and upper problem are widely used in traffic applications

[yang1995heuristic]. Sensitivity analysis of the traffic assignment problem has been adopted to evaluate the gradients of bi-level problem. lu2013dynamic estimated the gradient of path flow using the dynamic network loading models, and balakrishna2008time approximated the gradient of OD demand through stochastic perturbations. osorio2019dynamic approximate the gradient by linearizing the dynamic traffic assignment models. All the studies mentioned above aim at finding the gradients of the OD demand for the bi-level formulation. In this paper, we propose to evaluate the gradient of OD demand analytically through the forward-backward algorithm on a computational graph, and details will be described in section 2.6.

2.5 Vectorizing the MCDODE formulation

First of all, the variables involved in the MCDODE formulation are vectorized, and the vectorization is performed for each vehicle class separately. We set and denote the total number path as , . The vectorized variables are presented in Table 2.

Variable Scalar Vector Dimension Type Description
OD flow Dense is place at entry
Path flow Dense is placed at entry
Link flow Dense is placed at entry
Link travel time Dense is placed at entry
Path travel time Dense is placed at entry
Observed flow Dense is placed at entry
Observed travel time Dense is placed at entry
DAR matrix Sparse is placed at entry
Route choice matrix Sparse is placed at entry
Observation/link incidence matrix Sparse is placed at entry
Link travel time portion matrix Sparse is placed at entry
Table 2: MCDODE framework variable vectorization

With the vectorized variables, Equations 7, 8 and 9 can be rewritten in Equation 11.

(11)

Multiplications between sparse matrix and sparse matrix, sparse matrix and dense vector are very efficient, especially on multi-core CPUs and Graphics Processing Units (GPUs). Therefore, Equation 11 can be evaluated efficiently. The MCDODE formulation in Equation 10 can be cast into the vectorized form presented in Equation 12.

(12)

where is the vectorized route choice function for vehicle class . We further substitute the path flow and link flow to the objective function, as presented in Equation 13.

(13)

2.6 A computational graph for MCDODE

In order to solve the MCDODE problem, our goal is to obtain the gradient of OD demand for formulation 13. In this section, we propose a novel approach to obtain the gradient of OD demand through the forward-backward algorithm on a computational graph. First we cast equation 13 into a computational graph representation, and Figure 2 describes the structure of the computational graph for MCDODE. The forward-backward algorithm runs on the computational graph, and algorithm consists of two processes: the forward iteration and the backward iteration.

In general, the forward iteration assumes that OD demand is fixed and it solves for the network conditions, while the backward iteration assumes the network conditions are fixed and it updates the OD demand. The whole process of forward-backward algorithm resembles some heuristic methods that solve the upper level and lower level problem iteratively [yang1995heuristic]. However, the proposed algorithm can evaluate the instantaneous gradient of OD demand analytically in the backward iteration.

Forward iteration: Forward iteration takes multi-class OD demand as the input and solves the traffic assignment problem presented in Equation 14.

(14)

The forward iteration includes the multi-class dynamic network loading models and route choice models . The output of the forward iteration is route choice portion , DAR matrix and link/path travel time . We omit the solution method for traffic assignment problem, as it has been extensively studied in many literature [peeta2001foundations]. After solving the dynamic traffic assignment models, the forward iteration compute the objective function (loss) in formulation 13, which can be represented by a series of equations in Equation 15 and 16.

(15)
(16)

where is the observed flow and is the reproduction of the observed flow estimated from the traffic assignment model. Similarly, is the observed travel time and is the reproduction of the observed travel time estimated from the traffic assignment model. We use to represent a part of the function , and takes dynamic link flow as input and outputs the link travel time . Precisely, represents the dynamic link models [zhang2013modelling, jin2012link].

Backward iteration: The backward iteration searches for the gradient of OD demand for formulation 17 with the route choice portion , DAR matrix and travel time known from the forward iteration.

(17)

When the gradient of OD demand is known, a projected gradient descent method can be used to solve Equation 17. The reason we call the solution process for Equation 17 a “backward iteration” is that, the gradient of OD demand for Equation 17

can be evaluated through the backpropagation (BP) method. Taking the derivative of the objective function step by step, we have a series of equations presented in Equation 

18

(18)

Combining the equations in 18, the gradient of OD demand is presented in Equation 19.

(19)

The forward-backward algorithm is illustrated in Figure 2. The solid arrow represents the forward iteration and the dashed arrow represents the backward iteration. We omit the forward and backward iterations for historical OD data, while the other processes are described above. The forward and backward iterations for historical OD data are straightforward by adding to the MCDODE formulation 13 [zhang2008estimating].

Figure 2: An illustration of the forward-backward algorithm.

To solve the MCDODE formulation in Equation 12, we run the forward-backward algorithm to compute the gradient of OD demand. Then the projected gradient descent method is used to update the OD demand. There is a family of gradient-based methods that can be used, and we will discuss them in section 3.4. Comparisons among different methods will also be conducted in the numerical experiments.

Our computational graph approach shares many similarities with the deep learning models: 1) both models contain high dimensional parameters; 2) multi-core CPU and GPU can be used to speed up the solution process; 3) many advanced variants of gradient-based method can be used to solve the models; 4) Backpropagation method can be used to evaluate the gradient layer by layer

[rumelhart1985learning, wu2018hierarchical]. Potentially, all the techniques used in the training for deep learning can be used for the proposed computational graph. In this paper, we will test the advanced gradient-based method and multi-processing, while leaving other techniques, such as dropout [gal2016dropout]

, transfer learning

[pan2010survey] and regularization [neyshabur2014search] for future research.

There are many flexible ways to incorporate observed data in the backward-forward algorithm. For example, it is possible to view the vehicle trajectories as samples from path flow and incorporate the trajectory data into the computational graph. We can also compute the weighted average speed for cars and trucks to reproduce the “average link travel time” since the network conditions (flow, travel time) are fixed in the backward iterations. Hence the question left in Example 1 is answered.

As for the stopping criteria, we first claim Proposition 1 holds by the definition of the forward-backward algorithm.

Proposition 1.

In the proposed forward-backward algorithm, the DAR matrix, route choice portions and link/path travel time do not change if and only if during the forward and backward iterations.

Proposition 1 indicates that the forward-backward algorithm converges when either of the following two conditions hold: 1) in the forward iteration, the DAR matrix, route choice portions and link/path travel time do not change; 2) in the backward iteration, . During the forward-backward algorithm, we can either monitor the change of DAR matrix, route choice portions and link/path or the change of the gradient of OD demand. We can also see that the forward-backward algorithm converges to the local minimum for formulation 13 in Proposition 2.

Proposition 2.

When the forward-backward algorithm converges, the estimated OD demand is a local minimum for formulation 13.

Proof.

When the forward-backward algorithm converges, we know by Proposition 1. Since formulation 17 is convex, . Therefore, is the local minimum solution. ∎

3 Solution Algorithms

In this section, we first discuss several practical issues to complete the MCDODE framework with the forward-backward algorithm. We develop a multi-class traffic simulation package called MAC-POSTS for the network loading function , and a Growing Tree algorithm is proposed to obtain the DAR matrix. Secondly, we discuss how to evaluate the derivative of link travel time in dynamic networks. Thirdly, we present how to incorporate multi-day observation data in the proposed MCDODE framework with multiprocessing. Lastly, the whole framework for MCDODE is presented.

3.1 Multi-class traffic simulation

The dynamic network loading function is fulfilled with the mesoscopic multi-class traffic simulation package Mobility Data Analytics Center - Prediction, Optimization, and Simulation toolkit for Transportation Systems (MAC-POSTS) developed by the Mobility Data Analytics Center at Carnegie Mellon University. To simulate heterogeneous traffic with multi-class vehicles like cars and trucks, the simulation package captures flow dynamics and outputs the traffic metrics for multi-class vehicles. The flow metrics include the traffic volumes, traffic speed and travel time. Due to the page limitation, more details about the mesoscopic multi-class traffic simulation model in MAC-POSTS is presented in [qian2017modeling, CARTRUCK].

With the multi-class dynamic OD demand known, the mesoscopic multi-class traffic simulation model performs the following steps orderly in every loading interval (e.g. five seconds):

  1. Vehicle generation: multi-class vehicles are generated at origins according to the traffic demand.

  2. Routing: the route choice behaviors of all vehicles are updated, according to the route choice models.

  3. Node evolution: cars and trucks are moved through intersections following the intersection flow model.

  4. Link evolution: cars and trucks are moved on links following the link flow model.

  5. Network flow statistics: the model records link flow counts, link speeds, travel time and other network performance statistics.

We note the loading interval is different from the interval defined in this paper, since loading interval is usually much shorter. After running the simulation, the route choice portion and link/route travel time for each vehicle class can be obtained based on the simulation results. The DAR matrix for each vehicle class can also be obtained by constructing the tree-based cumulative curves during the simulation process, and details are presented in section 3.2.

3.2 Tree-based cumulative curve

In this section, we develop a novel method to compute the DAR matrix during the traffic simulation. Computing the DAR matrix during the simulation is more efficient than obtaining the DAR matrix after the simulation. However, computing the dynamic assignment ratio (DAR) during the traffic simulation is challenging. A naive method to obtain the DAR matrix is by recording the trajectories of all simulated vehicles in the DNL process. This method iterates across all paths and links over all time intervals, and in each iteration the method computes the number of vehicles arriving at a specific link from a specific path. Since the dimension of DAR matrix increases exponentially with respect to the size of network and the number of time intervals, the naive method is computational implausible for large-scale networks. In this section, we propose a novel method to compute the DAR matrix through the tree-based cumulative curves, and the proposed method is efficient in both computational time (time complexity) and memory (space complexity).

We define as the tree-based cumulative curve of link for class- vehicles departing from path in OD pair in time interval . takes the time as input and outputs the total number of vehicles departing in time interval from path and arriving at link before time . Then the DAR can be computed by Equation 20.

(20)

where is the beginning of time interval and is the end of time interval .

We note that records the cumulative curves for each path flow and departing time interval separately, and hence it requires more memory and computational power than the standard link-based cumulative curve [lu2013dynamic]. However, only a very small fraction of vehicles pass a specific link during the simulation. There are only a small fraction of paths containing a specific link, and hence the is sparse in terms of path indices and time indices . Using this intuition, we develop a Growing Tree algorithm to build the tree-based cumulative curve for each link . Since the algorithm is tree-based, so we refer as the tree-based cumulative curves.

The process of the Growing Tree algorithm is presented in Algorithm 1.

1 GrowingTree ;
Input : Traffic simulator , number of loading intervals
Output : Tree-based cumulative curves
2 Initialize an empty dictionary ;
3 for   do
4       Run the simulator for one loading interval;
5       for  do
6             Initialize an empty dictionary ;
7             Extract the set of vehicles going in link   and denote it as ;
8             for  do
9                   Suppose vehicle follows path in OD pair and departs in time interval and the vehicle class is ;
10                   if  is not the key of dictionary  then
11                         Initialize with an empty dictionary;
12                        
13                   end if
14                  if  is not the key of dictionary  then
15                         Initialize with an empty dictionary;
16                        
17                   end if
18                  if  is not the key of dictionary  then
19                         Initialize with an empty cumulative curve;
20                        
21                   end if
22                  Add record to the cumulative curve ;
23                  
24             end for
25            
26       end for
27      
28 end for
Algorithm 1 Growing Tree algorithm for constructing

In the algorithm, a record means one vehicle arriving at the link at time . is constructed as a tree, as presented in Figure 3. During the construction, when a vehicle transverses a link, a leaf containing a standard cumulative curve is either created or updated to record the location of that vehicle. The tree is unbalanced, so a hashmap-based tree is more memory efficient. In Algorithm 1, a dictionary refers to a key-value mapping implemented by hashmap, and readers can view the dictionary as one of the following data structures: dictionary in Python, HashMap in Java, or unordered_map in C++.

Figure 3: An illustration of the Growing Tree algorithm.

3.3 Derivatives of link travel time

In the backward iteration described in section 2.6, we need to compute the derivatives of link travel time . The function represents the link flow models which include, but is not limited to, point queue, spatial queue, cell transmission model, link transmission model and link queue model [jin2012link, zhang2013modelling]. There is no closed-form for link flow models, hence the derivatives of function can be challenging to evaluate analytically. In contrast, there exists methods to approximate the link travel time derivatives for the simulation-based models, and the basic idea of this kind of methods is to examine the extra link travel time induced by a marginal vehicle added to the link. Readers are refereed to qian2012system, lu2013dynamic for the implementation details. In this paper, we adopt the approximation approach discussed in lu2013dynamic to evaluate .

3.4 Incorporating multi-day observations with multiprocessing

From formulation 13, the multi-class demand is estimated with one data sample . In real world applications, we may observe the flow and travel time on multiple days. Suppose we collect data samples for days and we let denote the observed flow and travel time on day , then the MCDODE problem 13 can be extended to accommodate multi-day observations in formulation 21