Abstract
Estimating user similarity in real-time is straightforward in growth-only scenarios, but becomes mathematically complex in fully dynamic graph streams where deletions (e.g., "unfollowing") occur. Traditional sketching methods like MinHash suffer from sampling bias when handling deletions. We introduce Virtual Odd Sketch (VOS), a novel method that supports insertions and deletions with $O(1)$ update time. By leveraging XOR operations and a shared bit array, VOS provides significantly higher accuracy and memory efficiency than industry standards.
Introduction
In social networks and recommendation systems, calculating Jaccard similarity—the overlap between two sets—is a core task. Compact data summaries, or "sketches," are typically used to estimate this similarity without storing entire edge lists. However, most existing methods were designed for static or insertion-only streams. In real-world dynamic graphs, users frequently unsubscribe or unfollow. Deletions in traditional sampling-based sketches lead to "sampling bias," as they cannot easily remove an item without a full history re-scan. This results in compounding estimation errors over time.
Methodology: Virtual Odd Sketch (VOS)
VOS addresses the deletion problem through two primary innovations: the use of "odd sketches" and a "virtual" shared memory architecture.
The Odd Sketch Foundation
VOS utilizes an "odd sketch," a bit array where each bit represents the parity of items mapped to it via a hash function. Because the XOR operation is its own inverse, deleting an item is equivalent to re-inserting it; the XOR operation simply toggles the bit back to its previous state. This makes the sketch order-independent and perfectly suited for deletions.
Virtual Shared Bit Array
To optimize memory, VOS avoids assigning large, fixed-size sketches to every user. Instead, it employs a single, large shared bit array. Each user’s "virtual" sketch is mapped into this shared space using independent hash functions. This "statistical multiplexing" allows the system to support millions of users with varying activity levels without pre-allocating memory for inactive ones.
Experimental Evaluation
The performance of VOS was evaluated using four large-scale social network datasets: YouTube, Flickr, Orkut, and LiveJournal. To simulate a fully dynamic environment, static graphs were transformed into streams where 50% of edges were eventually deleted, mimicking massive waves of unsubscribes.
Key Results
VOS demonstrates superior performance across three critical dimensions: speed, accuracy, and robustness.
- Efficiency: VOS achieves $O(1)$ time complexity for updates, matching the speed of One Permutation Hashing (OPH) and outperforming standard MinHash, which scales linearly with the number of hash functions.
- Accuracy: Across all tested datasets, VOS consistently showed lower Average Root Mean Square Error (ARMSE) compared to MinHash, OPH, and Random Pairing (RP).
- Robustness: While the accuracy of OPH and MinHash degrades as deletions accumulate, VOS remains stable. Traditional methods are fundamentally biased in dynamic streams because they cannot maintain a uniform sample of remaining items after deletions.
Conclusion
VOS provides a robust solution for similarity mining in fully dynamic graph streams. By combining the deletion-friendly properties of XOR with an efficient virtual shared memory model, it offers a high-performance alternative to traditional sketching methods. Future work may involve extending VOS to weighted graphs and exploring the physical limits of hash collisions in the shared bit array.
Summary updated