🤖 AI Summary
We address the problem of efficiently approximating the size of 2-hop neighborhoods of vertices under continuous edge insertions in dynamic graphs. We propose the first lazy-update algorithm with theoretically optimal time–accuracy trade-off. Our method integrates probabilistic analysis, graph girth theory, and standard sketching techniques; we prove that worst-case performance degradation occurs only when the graph girth is at most four and the input is highly adversarial—thereby revealing strong practical robustness. Experiments on real-world low-girth social networks show amortized O(1/ε) update time per edge insertion, with approximation error strictly bounded by ε—significantly outperforming existing approaches. This work is the first to systematically incorporate girth properties into dynamic graph neighborhood estimation, providing an efficient, provably accurate foundation for downstream tasks such as Jaccard similarity computation.
📝 Abstract
In this work, we propose, analyze and empirically validate a lazy-update approach to maintain accurate approximations of the $2$-hop neighborhoods of dynamic graphs resulting from sequences of edge insertions. We first show that under random input sequences, our algorithm exhibits an optimal trade-off between accuracy and insertion cost: it only performs $O(frac{1}{varepsilon})$ (amortized) updates per edge insertion, while the estimated size of any vertex's $2$-hop neighborhood is at most a factor $varepsilon$ away from its true value in most cases, regardless of the underlying graph topology and for any $varepsilon>0$. As a further theoretical contribution, we explore adversarial scenarios that can force our approach into a worst-case behavior at any given time $t$ of interest. We show that while worst-case input sequences do exist, a necessary condition for them to occur is that the girth of the graph released up to time $t$ be at most $4$. Finally, we conduct extensive experiments on a collection of real, incremental social networks of different sizes, which typically have low girth. Empirical results are consistent with and typically better than our theoretical analysis anticipates. This further supports the robustness of our theoretical findings: forcing our algorithm into a worst-case behavior not only requires topologies characterized by a low girth, but also carefully crafted input sequences that are unlikely to occur in practice. Combined with standard sketching techniques, our lazy approach proves an effective and efficient tool to support key neighborhood queries on large, incremental graphs, including neighborhood size, Jaccard similarity between neighborhoods and, in general, functions of the union and/or intersection of $2$-hop neighborhoods.