Abstract
In this paper, we study new batch-dynamic algorithms for the $k$-clique counting problem, which are dynamic algorithms where the updates are batches of edge insertions and deletions. We study this problem in the parallel setting, where the goal is to obtain algorithms with low (polylogarithmic) depth. Our first result is a new parallel batch-dynamic triangle counting algorithm with $O(\Delta\sqrt{\Delta+m})$ amortized work and $O(\log^* (\Delta+m))$ depth with high probability, and $O(\Delta+m)$ space for a batch of $\Delta$ edge insertions or deletions. Our second result is an algebraic algorithm based on parallel fast matrix multiplication. Assuming that a parallel fast matrix multiplication algorithm exists with parallel matrix multiplication constant $\omega_p$, the same algorithm solves dynamic $k$-clique counting with $O\left(\min\left(\Delta m^{\frac{(2k - 1)\omega_p}{3(\omega_p + 1)}}, (\Delta+m)^{\frac{2(k + 1)\omega_p}{3(\omega_p + 1)}}\right)\right)$ amortized work and $O(\log (\Delta+m))$ depth with high probability, and $O\left((\Delta+m)^{\frac{2(k + 1)\omega_p}{3(\omega_p + 1)}}\right)$ space. Using a recently developed parallel $k$-clique counting algorithm, we also obtain a simple batch-dynamic algorithm for $k$-clique counting on graphs with arboricity $\alpha$ running in $O(\Delta(m+\Delta)\alpha^{k-4})$ expected work and $O(\log^{k-2} n)$ depth with high probability, and $O(m + \Delta)$ space. Finally, we present a multicore CPU implementation of our parallel batch-dynamic triangle counting algorithm. On a 72-core machine with two-way hyper-threading, our implementation achieves 36.54--74.73x parallel speedup, and in certain cases achieves significant speedups over existing parallel algorithms for the problem, which are not theoretically-efficient.
Introduction
In the world of big data, graphs are living, breathing entities. Social networks gain and lose connections every second, and financial transaction webs evolve in real-time. Analyzing these structures often requires counting $k$-cliques—subgraphs where every vertex is connected to every other vertex (e.g., a triangle for $k=3$). While counting cliques is a cornerstone of network science, doing it efficiently as the graph changes is a massive challenge.
Most traditional dynamic graph algorithms are "single-update," processing one edge insertion or deletion at a time. However, in high-velocity data streams, updates arrive in massive bursts. Processing these one-by-one is a bottleneck that fails to utilize modern multi-core processors. This paper introduces a suite of parallel, batch-dynamic algorithms that can process thousands of edge updates simultaneously, offering a significant leap in performance for real-time graph analysis.
Algorithmic Approaches
The paper introduces three main algorithmic approaches to handle the complexities of batching and parallelism:
Parallel Batch-Dynamic Triangle Counting ($k=3$)
This algorithm uses degree-based thresholding. Vertices are classified as "low-degree" or "high-degree" based on a threshold ($t \approx \sqrt{m}$).
- Low-degree updates: Handled by enumerating neighbors to identify new or removed triangles.
- High-degree updates: Use an auxiliary "wedge-store" ($T$) that tracks 2-paths, allowing for $O(1)$ triangle detection.
- Parallel Rebalancing: The authors parallelized the rebalancing logic, ensuring that as vertices change status (low to high degree), the data structures are updated with low depth.
Algebraic $k$-Clique Counting
For larger cliques ($k > 3$), the authors use an algebraic approach based on Parallel Fast Matrix Multiplication (FMM). They construct an auxiliary graph where vertices represent smaller cliques and use FMM to find how they combine into larger ones. Notably, they provide the first proof that tensor-based FMM algorithms can be parallelized with logarithmic depth for this problem.
Arboricity-based Counting
A simpler, combinatorial approach designed for sparse graphs (graphs with low "arboricity" or density). It works by listing smaller cliques and intersecting them with the updated edges in the batch.
Experimental Evaluation
The researchers evaluated their triangle counting implementation on a 72-core machine with two-way hyper-threading (144 threads) using several large-scale graphs, including com-Orkut (~234M edges) and a massive Twitter graph (~2.4B edges).
Key Results
- Scalability: The implementation achieved 36.54x to 74.73x parallel speedup, demonstrating excellent utilization of multi-core resources.
- Throughput: The algorithm processed between 1 million and 32 million edge updates per second, depending on the graph density.
- Superiority over State-of-the-Art: On the Twitter graph, the implementation was consistently up to an order of magnitude faster than previous parallel implementations. It was particularly dominant on small-to-medium batch sizes where synchronization overhead usually degrades performance.
Conclusion
This work provides the first parallel batch-dynamic algorithms for $k$-clique counting with provable theoretical guarantees. By combining work-efficient logic with low-depth parallel operations, the proposed methods keep pace with rapidly changing graphs. Future directions include exploring whether the dependence on the total number of edges ($m$) can be further reduced and optimizing the memory overhead required for auxiliary data structures.
Reference: Dhulipala, L., Liu, Q. C., Shun, J., & Yu, S. (2020). Parallel Batch-Dynamic k-Clique Counting. arXiv:2003.13585v2 [cs.DS].
Summary updated