A Fast Sketch Method for Mining User Similarities over Fully Dynamic Graph Streams

Peng Jia, Pinghui Wang, Jing Tao, Xiaohong Guan

TL;DR

Traditional similarity estimation methods like MinHash fail on fully dynamic graph streams because edge deletions introduce severe sampling bias. This paper introduces Virtual Odd Sketch (VOS), a fast and accurate sketching method that processes stream updates in $O(1)$ time and uses a shared memory architecture to track user similarities with high accuracy and low memory overhead.

What Problem Does This Paper Address?

Many real-world networks—such as Twitter followers or YouTube channel subscriptions—are highly dynamic, characterized by a continuous stream of edge insertions (subscribing) and deletions (unsubscribing). Tracking the similarity between users over time in these streams is crucial for real-time recommendation systems and collaborative filtering.

While algorithms like MinHash and One Permutation Hashing (OPH) work well for static graphs or insertion-only streams, they break down when deletions occur. Because they are fundamentally sampling-based methods, deleting an element introduces a historical bias that depends on the order of operations. Reverting a sketch after a deletion typically requires expensive recomputation or tracking the entire stream history, which is unfeasible for high-speed data streams.

Methods

The authors propose Virtual Odd Sketch (VOS) to handle fully dynamic streams efficiently. VOS relies on two core ideas:

  1. Odd Sketching via XOR: An odd sketch tracks the parity (odd/even count) of items hashed into a bit array. Because it uses the exclusive-or ($\oplus$) operation, an insertion sets a bit to 1, and a subsequent deletion flips it back to 0. This algebraic property completely eliminates the deletion bias without needing historical data.
  2. Virtual Shared Memory: Allocating a dedicated sketch for every single user is highly inefficient, especially in power-law networks where most users have only a few connections. Instead, VOS maintains a single, global, shared bit array $A$ of length $m$. Each user's sketch is "virtually" mapped to $k$ random positions in this shared array using independent hash functions.
Overview of the VOS method showing how individual user sketches are embedded into and rebuilt from a shared bit array.

When estimating similarity, the algorithm "rebuilds" the virtual sketches from the shared array. Since multiple users share the same memory space, some bits will inevitably collide (become "contaminated"). The authors provide a rigorous theoretical framework to track the global fraction of 1-bits ($\beta$) and mathematically filter out this noise during the Jaccard coefficient estimation phase.

Datasets

The method was evaluated using four large-scale, publicly available real-world network datasets:

  • YouTube
  • Flickr
  • Orkut
  • LiveJournal

To simulate a fully dynamic environment, the authors injected massive deletions into these datasets, removing an expected 50% of edges every 2,000,000 stream operations.

Key Insights and Ideas

  • Deletions as Bit Flips: The choice of the XOR operator means that insertions and deletions are treated symmetrically. This elegant mathematical property makes odd sketches uniquely suited for fully dynamic streams compared to min-wise hashing methods.
  • Mitigating Power-Law Waste: In social networks, a tiny fraction of users have thousands of interactions, while the vast majority have very few. By utilizing a shared global bit array, VOS dynamically shares memory capacity among all users, drastically reducing the overall memory footprint.
  • Inverting the Noise: While sharing memory introduces collisions, the authors proved that as long as you keep a single global counter to track the density of the shared array ($\beta$), you can statistically invert the contamination effect to get an unbiased estimate of user similarity.

Key Results

The authors compared VOS against three baselines: MinHash, OPH, and Random Pairing (RP) under identical memory constraints ($m = 32k|U|$ bits).

  • Speed: VOS achieves a time complexity of $O(1)$ per edge update, matching the speed of OPH and running orders of magnitude faster than traditional MinHash or Random Pairing methods.
  • Accuracy: VOS significantly outperformed all three baselines across all datasets. It dramatically reduced both the Average Absolute Percentage Error (AAPE) for common item estimation and the Average Root Mean Square Error (ARMSE) for Jaccard similarity.
Accuracy comparison (AAPE and ARMSE) of VOS against MinHash, OPH, and RP across different datasets.

Limitations and Future Work

The paper primarily focuses on bipartite graphs (e.g., users interacting with items), though the authors note that the method can be extended to regular graphs. Additionally, determining the optimal virtual sketch size ($k$) currently requires manual enumeration or prior knowledge of the graph's maximum cardinality. A promising direction for future work would be an adaptive mechanism that dynamically tunes $k$ on the fly based on stream characteristics.

Summary updated

BibTeX
@inproceedings{jia2019fast,
  author = {Peng Jia and Pinghui Wang and Jing Tao and Xiaohong Guan},
  title = {{A Fast Sketch Method for Mining User Similarities over Fully Dynamic Graph Streams}},
  booktitle = {ICDE},
  year = {2019},
  doi = {10.1109/icde.2019.00172},
}
Figure