Searcharxiv⌕ Search

arXiv · 2610.29776

Fully Dynamic Triangle and 4-Vertex Subgraph Counting: From Theory to Practice and Back Again

Abstract

Counting small patterns is a core primitive in large-scale graph analytics, with numerous applications in data management and network analysis. As modern graphs are massive and continuously evolving, maintaining such counts efficiently under updates is essential. Although specialized dynamic algorithms for patterns with up to four vertices exist, they remain largely theoretical; practitioners instead rely on general-purpose or approximate methods. We present an in-depth study of two dynamic approaches by Eppstein et al. and Hanauer et al. for maintaining counts of triangles and all connected four-vertex subgraph patterns, both based on variants of heavy-light vertex partitioning. We introduce theoretical and practical optimizations and develop hybrid variants that combine complementary strengths of both approaches. Experiments on 56 large real-world and synthetic dynamic graphs show that our optimized algorithms outperform the original methods and strong static and dynamic baselines on nearly all instances, both in total running time and worst-case update time, with speedups of up to several orders of magnitude. We further provide practical guidelines for algorithm selection and tuning. To the best of our knowledge, this is the first comprehensive empirical study of heavy-light partitioning for dynamic subgraph counting, and our findings may inform other algorithms based on this technique.

Explore related subjects

Keep this discovery

Explore connections, maps & timelines

BibTeXRIS

Kathrin Hanauer, Sophia Heck, Monika Henzinger, Leonhard Sidl. 2026-10-21. Fully Dynamic Triangle and 4-Vertex Subgraph Counting: From Theory to Practice and Back Again. https://arxiv.org/abs/2610.29776

Cite the original work for its findings. Save a collection to share your selection of sources.

KEEP EXPLORING

Related papers

Disjoint Stable Matchings in Linear Time

We show that given a SM instance G as input we can find a largest collection of pairwise edge-disjoint stable matchings of G in time linear in the input size. This extends two classical results: 1. The Gale-Shapley algorithm, which can find at most two ("extreme") pairwise edge-disjoint stable matchings of G in linear time, and 2. The polynomial-time algorithm for finding a largest collection of pairwise edge-disjoint perfect matchings (without the stability requirement) in a bipartite graph, obtained by combining König's characterization with Tutte's f-factor algorithm. Moreover, we also give an algorithm to enumerate all maximum-length chains of disjoint stable matchings in the lattice of stable matchings of a given instance. This algorithm takes time polynomial in the input size for enumerating each chain. We also derive the expected number of such chains in a random instance of Stable Matching. For the Stable Roomates problem, we show that determining if a given instance admits at most two disjoint stable matchings or three disjoint stable matchings is NP-complete.

cs.DS↗

The Binary Tree Mechanism is Optimal for Differentially Private Continual Counting

Private continual counting is a fundamental problem in differential privacy: given a binary stream of length $n$, where each $1$ corresponds to the contribution of one individual, the goal is to release all running counts while protecting the privacy of each individual. For fixed privacy parameters, the standard binary tree mechanism achieves expected $\ell_\infty$ error $O(\log^{3/2} n)$ under approximate differential privacy and $O(\log^2 n)$ under pure differential privacy. Whether these dependences on the stream length are necessary has remained a central open problem. For fixed $\varepsilon\in(0,1)$, we prove a lower bound of $Ω(\log^{3/2} n)$ under approximate DP with sufficiently small fixed $δ>0$, and a lower bound of $Ω(\log^2 n)$ under pure DP. These bounds establish the optimality of the binary tree mechanism in both settings. The bounds hold for arbitrary mechanisms, even when the entire stream is available in advance. Both proofs use the same decomposition and accumulation of residual noise along a tree. As a consequence of the approximate-DP bound, we also obtain a largest-possible separation between hereditary discrepancy and private $\ell_\infty$ error for linear queries, showing that the known general upper bound in terms of hereditary discrepancy has the optimal dependence on the number of queries.

cs.DS↗

On the Assadi Liu Tarjan Auction Algorithm for Bipartite Matching: Simplification, Alternative Analysis, and Hard Instance

Assadi, Liu, and Tarjan [SOSA'21] gave an auction algorithm that outputs a $(1-ε)$-approximation to Maximum Matching in bipartite graphs. Their algorithm computes a sequence of $O(\frac{1}{ε^2})$ maximal matchings in subgraphs of the input graph and can be implemented in the multi-pass streaming setting with $O(\frac{1}{ε^2})$ passes in a straightforward manner, which constitutes the state-of-the-art pass/approximation trade-off result in the multi-pass streaming setting. Their analysis uses tools from combinatorial auctions and, at its heart, relies on a clever potential function argument. Their proof, however, provides only limited insight into the inner workings of the algorithm. In this paper, we revisit the ALT-algorithm and present the following contributions. Simplification: The ALT-algorithm is built upon a freezing mechanism where vertices on one side of the bipartition that have already been rematched $Θ(\frac{1}ε)$ times over the course of the algorithm remain matched to their current partner forever. We show that this mechanism is in fact unnecessary, i.e., no special treatment of such vertices is needed. Alternative Analysis: We give an alternative analysis of the algorithm that is based on augmenting paths. Our analysis allows for a reinterpretation as one that follows the traditional approach of searching for and eliminating augmenting paths. Our analysis also copes with the removal of the freezing mechanism in a natural way, whereas the analysis of Assadi et al. strictly depends on its use. Hard Instance: We provide the first hard instance on which the algorithm requires $Ω(\frac{1}{ε^2})$ iterations/maximal matching computations. The instance is a simple path graph, where we exhibit a cyclic behaviour that prevents fast progress.

cs.DS↗