In graph theory, Depth-First Search (DFS) and Breadth-First Search (BFS) are fundamental building blocks for algorithm design, used for pathfinding, connectivity checks, and structural analysis. However, these classical algorithms falter when applied to temporal graphs—networks where edges exist only at specific points in time. In "Temporal Graph Traversals: Definitions, Algorithms, and Applications," Silu Huang, James Cheng, and Huanhuan Wu argue that traditional graph traversal methods are fundamentally inadequate for time-varying data and propose a new, efficient framework for the temporal era.
The Challenge of Temporal Reachability
Most network analysis simplifies dynamic data by "flattening" it into static snapshots. This approach ignores the "arrow of time," leading to significant inaccuracies. In a static graph, if edges exist between nodes A and B, and B and C, then A can reach C. In a temporal context, reachability is conditional: A can only reach C if the interaction between A and B occurs before the interaction between B and C.
Existing research often relied on algorithms with $O(|E|^2)$ complexity, which are impractical for modern datasets containing millions of edges. The authors demonstrate that static representations can overestimate reachability by up to 10x compared to time-respecting paths.
Redefining DFS and BFS for Temporal Graphs
The core of the proposed framework is the Time Constraint on Traversal, which mandates that a valid path must have a non-decreasing sequence of edge timestamps. Based on this constraint, the authors developed linear-time algorithms ($O(|E| + |V|)$) for both DFS and BFS.
Temporal DFS: v1 and v2
The paper introduces two variants of temporal DFS:
- v1 (Chronological): This version traverses edges in the order they occur, making it ideal for finding "foremost paths"—the earliest possible arrival time at a destination.
- v2 (Reverse Chronological): This counter-intuitive approach traverses edges backward in time. It is the key to solving the "fastest path" problem, which aims to minimize the total duration of a journey within a given time interval.
Temporal BFS
Unlike its static counterpart, a temporal BFS tree may include a vertex multiple times at different levels. This is necessary because a path with more "hops" might arrive earlier in time, or a path with fewer hops might arrive later. Managing this vertex multiplicity while maintaining linear complexity is a primary technical contribution of the paper.
Experimental Results and Scalability
The algorithms were evaluated on seven large-scale, real-world datasets, including Wikipedia edit histories (266M edges) and social communication networks. The results highlight two major advantages:
- Efficiency: The proposed algorithms are orders of magnitude faster than previous state-of-the-art methods. For instance, on the Wikipedia dataset, the "Fastest Path" algorithm completed in 0.22 seconds, compared to over 27 seconds for the baseline.
- Optimality: The DFS and BFS trees generated contain all necessary information to extract foremost, fastest, and shortest temporal paths in a single pass.
Conclusion and Future Directions
By formalizing temporal traversals and achieving $O(|E| + |V|)$ complexity, this work provides the necessary tools for analyzing massive dynamic networks. While the current point-in-time model is robust, future extensions could incorporate edge durations (e.g., travel times) and support streaming updates for real-time graph analysis. These traversals serve as essential building blocks for higher-level metrics such as temporal centrality and community detection in evolving systems.
Reference: Huang, S., Cheng, J., & Wu, H. (2014). Temporal Graph Traversals: Definitions, Algorithms, and Applications. arXiv:1401.1919v1 [cs.DS].
Summary updated