Bipartite graphs serve as a natural model for representing relationships between two different types of entities. When analyzing bipartite graphs, butterfly counting is a fundamental research problem that aims to count the number of butterflies (i.e., 2x2 bicliques) in a given bipartite graph. While this problem has been extensively studied in the literature, existing algorithms usually necessitate access to a large portion of the entire graph, presenting challenges in real scenarios where graphs are extremely large and I/O costs are expensive. In this paper, we study the butterfly counting problem under the query model, where the following query operations are permitted: degree query, neighbor query, and vertex-pair query. We propose TLS, a practical two-level sampling algorithm that can estimate the butterfly count accurately while accessing only a limited graph structure, achieving significantly lower query costs under the standard query model. TLS also incorporates several key techniques to control the variance, including "small-degree-first sampling" and "wedge sampling via small subsets". To ensure theoretical guarantees, we further introduce two novel techniques: "heavy-light partition" and "guess-and-prove", integrated into TLS. With these techniques, we prove that the algorithm can achieve a (1+eps) accuracy for any given approximation parameter 0 < eps < 1 on general bipartite graphs with a promised time and query complexity. In particular, the promised time is sublinear when the input graph is dense enough. Extensive experiments on 15 datasets demonstrate that TLS delivers robust estimates with up to three orders of magnitude lower query costs and runtime compared to existing solutions.
翻译:二分图是表示两类不同实体之间关系的自然模型。在分析二分图时,蝴蝶计数是一个基础性研究问题,旨在统计给定二分图中蝴蝶(即2×2双团)的数量。尽管该问题在文献中已被广泛研究,但现有算法通常需要访问整个图的大部分结构,这在图规模极大且I/O成本高昂的现实场景中面临挑战。本文研究查询模型下的蝴蝶计数问题,该模型允许以下查询操作:度数查询、邻居查询和顶点对查询。我们提出TLS——一种实用的两级采样算法,能够在仅访问有限图结构的情况下准确估计蝴蝶数量,在标准查询模型下实现显著更低的查询成本。TLS还融合了多项关键方差控制技术,包括"小度优先采样"和"基于小子集的楔形采样"。为确保理论保证,我们进一步引入两种新技术:"轻重划分"与"猜测-验证",并将其集成至TLS中。借助这些技术,我们证明该算法能在通用二分图上对任意给定近似参数0<ε<1实现(1+ε)精度,并具有承诺的时间与查询复杂度。特别地,当输入图足够稠密时,承诺的时间复杂度为亚线性。在15个数据集上的大量实验表明,与现有方案相比,TLS在实现稳健估计的同时,查询成本和运行时间均降低达三个数量级。