English

Using Colors and Sketches to Count Subgraphs in a Streaming Graph

Data Structures and Algorithms 2023-02-24 v1

Abstract

Suppose we wish to estimate #H\#H, the number of copies of some small graph HH in a large streaming graph GG. There are many algorithms for this task when HH is a triangle, but just a few that apply to arbitrary HH. Here we focus on one such algorithm, which was introduced by Kane, Mehlhorn, Sauerwald, and Sun. The storage and update time per edge for their algorithm are both O(mk/(#H)2)O(m^k/(\#H)^2), where mm is the number of edges in GG, and kk is the number of edges in HH. Here, we propose three modifications to their algorithm that can dramatically reduce both the storage and update time. Suppose that HH has no leaves and that GG has maximum degree m1/2α\leq m^{1/2 - \alpha}, where α>0\alpha > 0. Define C=min(m2α,m1/3)C = \min(m^{2\alpha},m^{1/3}). Then in our version of the algorithm, the update time per edge is O(1)O(1), and the storage is approximately reduced by a factor of C2kt2C^{2k-t-2}, where tt is the number of vertices in HH; in particular, the storage is O(C2+mk/(C2kt2(#H)2))O(C^2 + m^k/(C^{2k-t-2} (\#H)^2)).

Keywords

Cite

@article{arxiv.2302.12210,
  title  = {Using Colors and Sketches to Count Subgraphs in a Streaming Graph},
  author = {Shirin Handjani and Douglas Jungreis and Mark Tiefenbruck},
  journal= {arXiv preprint arXiv:2302.12210},
  year   = {2023}
}
R2 v1 2026-06-28T08:48:11.882Z