Abstract
Many important societal problems are naturally modeled as algorithms over temporal graphs. To date, however, most graph processing systems remain inefficient as they rely on distributed processing even for graphs that fit well within a commodity server's available storage. In this paper, we introduce Kairos, a temporal graph analytics system that provides application developers a framework for efficiently implementing and executing algorithms over temporal graphs on a single machine. Specifically, Kairos relies on fork-join parallelism and a highly optimized parallel data structure as core primitives to maximize performance of graph processing tasks needed for temporal graph analytics. Furthermore, we introduce the notion of selective indexing and show how it can be used with an efficient index to speedup temporal queries. Our experiments on a 24-core server show that our algorithms obtain good parallel speedups, and are significantly faster than equivalent algorithms in existing temporal graph processing systems: up to 60x against a shared-memory approach, and several orders of magnitude when compared with distributed processing of graphs that fit within a single server.
Introduction
Graphs are a natural way to model complex relationships, from social networks to biological systems. However, most real-world relationships are dynamic rather than static. Temporal graphs capture this evolution by associating edges with time intervals (e.g., "User A was friends with User B from 2015 to 2018").
Analyzing these graphs is computationally expensive. Traditional graph engines are often ill-equipped for time-based filtering, frequently resorting to slow full-graph scans. Conversely, distributed temporal graph systems introduce massive message-passing overhead that is often unnecessary when the graph can fit into the memory of a single modern server. Kairos addresses this gap by exploiting multi-core parallelism and specialized indexing to handle temporal data efficiently on a single machine.
System Architecture
Kairos is built on top of the Ligra shared-memory framework. Its architecture is designed to balance the speed of linear scans with the precision of tree-based indexing.
The system's "secret sauce" is its Selective Indexing strategy. Indexing every vertex is memory-intensive and often counterproductive. Kairos only builds indexes for high-degree vertices. At runtime, a cardinality estimator (based on 2D density histograms) decides whether to use a specialized index or perform a parallel linear scan. If a query is "unselective" (returning most edges), a scan is often faster due to hardware-level optimizations and cache locality.
Data Structures: T-CSR and TGER
Kairos utilizes two primary data structures to manage temporal data efficiently:
- T-CSR (Temporal Compressed Sparse Row): This is an extension of the standard CSR format. It adds dedicated arrays for start and end times, maintaining the cache-friendly nature of CSR while allowing for rapid temporal filtering during scans.
- TGER (Temporal Graph Edge Registry): A specialized "time-first" index based on Priority Search Trees. TGER allows the system to answer 3-sided interval queries (e.g., "find all edges starting before $t_1$ and ending after $t_2$") in $O(\log m + k)$ time.
Key Insights
The Indexing Paradox
In graph processing, more indexing isn't always better. Because modern CPUs are incredibly fast at linear scans, the overhead of traversing a tree index only pays off when the query is highly selective—meaning it filters out a large majority of the data. Kairos exploits this by only paying the indexing cost for "super-nodes" (heavy-hitters) where the performance gains are most significant.
Time as a First-Class Citizen
By integrating Allen’s Interval Algebra (concepts like Succeeds, Strictly Succeeds, and Overlaps) directly into the programming primitives, Kairos allows developers to write complex temporal algorithms, such as "Earliest Arrival Path," with minimal code and high performance.
Evaluation and Results
The researchers evaluated Kairos using a mix of real-world datasets (Bitcoin, Reddit, Twitter cache traces) and synthetic graphs with up to 500 million edges.
- Massive Speedups: Kairos is up to 60x faster than TeGraph (the previous state-of-the-art shared-memory system) and several orders of magnitude faster than distributed systems like Tink and ICM for single-server workloads.
- Parallel Scalability: On a 24-core machine, the system achieved a mean parallel speedup of 8.7x compared to its own single-threaded execution.
- Decision Accuracy: The cost model's cardinality estimator chose the optimal access method (index vs. scan) with over 95% accuracy for most query windows.
Conclusion
Kairos demonstrates that for many practical temporal graph workloads, a highly optimized single-machine system can outperform distributed clusters. By combining T-CSR for efficient scans and TGER for selective indexing, Kairos provides a powerful framework for modern temporal graph analytics. Future work includes extending the system to handle high-frequency streaming updates and developing self-tuning thresholds for indexing.
Summary updated