Constructing the fundamental diagrams of traffic flow from large-scale vehicle trajectory data

He, Zhengbing, Cathy WuarXiv 2025 · DOI · arXiv

Abstract

For decades, researchers and practitioners typically measure macroscopic traffic flow variables, i.e., density, flow, and speed, using time or space cuts, and then construct the fundamental diagrams of traffic flow. With the advent of large-scale vehicle trajectory datasets, often capturing 100 % of vehicle dynamics, Edie's generalized definitions have become widely recognized as the most appropriate framework for measuring these variables. However, while Edie's formulation explicitly requires the traffic state within the measurement region to be both stationary and homogeneous, there is little guidance on how to systematically identify such qualified regions and construct the corresponding fundamental diagrams. To address this gap, this paper proposes an Edie's definition-based method for measuring traffic variables and constructing the fundamental diagrams of traffic flow by automatically identifying stationary traffic states using parallelogram-shaped aggregation regions. An open-source tool is developed and released to support both researchers and practitioners.

Introduction

In traffic flow theory, the Fundamental Diagram (FD) is the foundational model describing the equilibrium relationship between density, flow, and speed. For decades, these diagrams were constructed using "point" data from loop detectors or simple rectangular "cuts" in time-space diagrams. While Edie’s generalized definitions provide a robust framework for calculating these variables from high-resolution vehicle trajectories, they come with a strict theoretical requirement: the traffic state within the measurement area must be stationary (constant over time) and homogeneous (uniform across space).

Generalized measurement of traffic variables in a time-space region.

As illustrated in Figure 4, traditional measurement regions are often arbitrary. Most researchers use simple rectangular cells that "smear" different traffic states together, particularly during transitions between free-flow and congestion. This results in noisy FDs that struggle to clearly define the "congestion branch"—the part of the diagram where traffic breaks down and disturbances propagate.

Methodology: Parallelogram-Shaped Aggregation

The core innovation of this research is an automated method that identifies "qualified" regions of traffic to build an FD by replacing traditional rectangular windows with optimized parallelogram-shaped aggregation regions.

The proposed parallelogram-shaped aggregation region for stationary state identification.

As shown in Figure 5, the geometry of the measurement region is aligned with the physical properties of traffic:

  1. Geometry Alignment: Two sides of the parallelogram align with the wave speed ($\omega$)—the speed at which traffic disturbances move backward—while the other two sides align with a target traffic speed ($v^*$).
  2. Stationarity Scoring: To ensure the data is truly stationary, the method calculates a "Score" for each candidate parallelogram based on the Coefficient of Variation (CV) of observed speeds and the Normalized Absolute Error (NAE) relative to the target speed $v^*$.
  3. Optimization: The tool spans speeds from jam density to free-flow, generating thousands of candidate parallelograms and selecting the top $M$ non-overlapping regions with the lowest (best) scores.

To support the community, the authors have released an open-source tool available at https://github.com/gotrafficgo/construct_fundamental_diagram.

Datasets and Validation

The method was validated using two high-fidelity, real-world trajectory datasets:

  • ZenTraffic (Japan): Data from a 2 km stretch of the Hanshin Expressway in Osaka, captured via high-mounted cameras at 0.1-second intervals.
  • NGSIM (USA): The US-101 dataset from Los Angeles, focusing on a congested merging area.

Key Results and Insights

The proposed method reveals a much clearer and more theoretically consistent relationship between flow, density, and speed than traditional "virtual loop detector" baselines.

  • Congestion Branch Clarity: By enforcing stationarity through the scoring system, the method reveals a distinct, linear congestion branch. The identified wave speeds (slopes) of approximately -15 km/h to -16 km/h match visually measured propagation speeds in raw time-space diagrams.
  • Physical Alignment: Traffic dynamics naturally move along "slants" in time and space. Using a parallelogram that aligns with vehicle paths and shockwaves filters out noise from changing traffic states.
  • Quasi-Stationarity: While "perfectly" stationary states are rare, the weighted scoring system allows for the extraction of "locally quasi-stationary" regions that are sufficient for high-quality theoretical modeling.

Conclusion and Future Work

This paper introduces an automated tool capable of generating fundamental diagrams directly from any large-scale time-space diagram of vehicle trajectories. While the method currently requires user input for wave speed and region size, it significantly improves the precision of traffic state measurement. Future work will focus on automating parameter selection and refining the model to account for vehicle heterogeneity, such as the differing dynamics of cars and trucks. This tool opens new avenues for investigating complex patterns like traffic hysteresis and regime transitions.

Summary updated

Abstract

For decades, researchers and practitioners typically measure macroscopic traffic flow variables, i.e., density, flow, and speed, using time or space cuts, and then construct the fundamental diagrams of traffic flow. With the advent of large-scale vehicle trajectory datasets, often capturing 100 % of vehicle dynamics, Edie's generalized definitions have become widely recognized as the most appropriate framework for measuring these variables. However, while Edie's formulation explicitly requires the traffic state within the measurement region to be both stationary and homogeneous, there is little guidance on how to systematically identify such qualified regions and construct the corresponding fundamental diagrams. To address this gap, this paper proposes an Edie's definition-based method for measuring traffic variables and constructing the fundamental diagrams of traffic flow by automatically identifying stationary traffic states using parallelogram-shaped aggregation regions. An open-source tool is developed and released to support both researchers and practitioners. From now on, we have an automated tool that can generate fundamental diagrams directly from any large-scale time-space diagram of vehicle trajectories, either collected from the real world or generated by simulation (such as testing car-following models).
BibTeX
@misc{zhengbing2025constructing,
  author = {He, Zhengbing and Cathy Wu},
  title = {{Constructing the fundamental diagrams of traffic flow from large-scale vehicle trajectory data}},
  year = {2025},
  eprint = {2507.09648},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2507.09648},
  howpublished = {arXiv},
}
Figure