Vertex Priority Based Butterfly Counting for Large-scale Bipartite Networks

Kai Wang, Xuemin Lin, Lu Qin, Wenjie Zhang, Ying Zhang

Introduction

Bipartite networks are ubiquitous in modeling relationships between two distinct sets of entities, such as users and products, or authors and papers. Analyzing these networks often involves identifying recurring sub-structures known as motifs. The most fundamental non-trivial motif in a bipartite graph is the butterfly—a complete $2 \times 2$ biclique.

The Butterfly Motif and the Hub Bottleneck

A butterfly represents a scenario where two nodes from one set are both connected to the same two nodes in the other set. For instance, in a user-item network, a butterfly consists of two users who have both purchased the same two items.

Figure 1: Illustration of a bipartite network where a butterfly motif represents two users (e.g., Adam and Mark) who have both interacted with the same two items (e.g., Balm and Doll).

Counting these motifs is critical for calculating bipartite clustering coefficients and uncovering community structures. However, as networks scale to billions of edges, traditional counting methods struggle. The standard approach involves enumerating "wedges" (two-hop paths), but in networks with "hub" vertices—nodes with extremely high degrees—the number of wedges to process grows exponentially. Existing "layer-priority" algorithms attempt to mitigate this by starting from the "thinner" side of the bipartite graph, but they remain inefficient when hubs exist in both layers.

The BFC-VP Algorithm: A Vertex-Priority Approach

To address these scalability issues, researchers developed BFC-VP (Vertex Priority Based Butterfly Counting). Unlike previous methods that prioritize entire layers, BFC-VP assigns a unique priority to every individual vertex based on its degree, using vertex IDs to break ties.

Figure 6: Different vertex priority assignments ($p_1$ to $p_4$) in a bipartite subgraph. BFC-VP uses these priorities to determine the direction of traversal, minimizing the search space.

When the algorithm traverses an edge $(u, v)$, it always treats the higher-priority vertex as the "start" and the lower-priority vertex as the "middle" of a wedge. This granular approach ensures that the algorithm explores the minimum possible number of wedges, effectively "neutralizing" the impact of high-degree hubs. The time complexity is reduced to $O(\sum_{(u,v) \in E} \min\{deg(u), deg(v)\})$, which is mathematically guaranteed to be more efficient than layer-based methods.

Cache-Aware Optimization (BFC-VP++)

Beyond algorithmic complexity, the researchers identified memory latency as a primary bottleneck. They introduced BFC-VP++, a cache-aware version that reorders wedge processing and employs Graph Projection. By relabeling vertex IDs based on priority, the algorithm ensures that frequently accessed data (high-priority vertices) remains in the CPU cache. On the massive Tracker dataset, this optimization flipped memory access patterns from 79% scattered "misses" to 81% cached "hits."

Experimental Evaluation

The BFC-VP++ algorithm was tested against 12 real-world datasets, including social networks (Twitter, Orkut) and e-commerce graphs (Amazon). The results were transformative:

  • Speed: On the Tracker dataset (140M edges), BFC-VP++ was nearly 200x faster than the previous state-of-the-art, finishing in 50 seconds compared to 9,000 seconds.
  • Scalability: The algorithm successfully processed billion-edge networks (e.g., Bi-uk with 1.3B edges) in under 15 minutes, whereas previous methods failed to complete within a 10-hour window.
  • Parallelism: A multi-core version demonstrated near-linear scaling, thanks to a dynamic scheduling strategy that maintains load balance across CPU threads.

Conclusion

BFC-VP represents a significant leap in network analysis, enabling the study of motifs in billion-scale bipartite graphs on commodity hardware. While currently optimized for static, single-machine environments, future work aims to extend this vertex-priority logic to distributed systems and real-time streaming data.

Summary updated

BibTeX
@article{wang2019vertex,
  author = {Kai Wang and Xuemin Lin and Lu Qin and Wenjie Zhang and Ying Zhang},
  title = {{Vertex Priority Based Butterfly Counting for Large-scale Bipartite Networks}},
  journal = {Proc. VLDB Endow.},
  year = {2019},
  doi = {10.14778/3339490.3339497},
}
Figure