Introduction
In the modern era of social networks and massive web crawls, data often arrives as a continuous sequence of edges known as a graph stream. Due to the sheer volume and high speed of these streams, storing them in their entirety is often infeasible. Consequently, researchers rely on "sketches"—compact, probabilistic data structures that summarize the stream to answer queries, such as estimating the frequency of specific edges.
Problem Statement: The Limitations of Standard Sketching
The industry standard for frequency estimation is the CountMin sketch. This technique uses multiple hash functions to map items into a fixed-size matrix, as illustrated in Figure 1.
While effective for general data streams, standard sketches struggle with the unique structural properties of graphs. Graphs are notoriously "skewed": a small number of "celebrity" nodes possess millions of connections, while the vast majority have very few. In a global CountMin sketch, these high-frequency "heavy hitters" frequently collide with rare edges in the hash tables. These collisions lead to significant overestimation errors for rare items, as the "noise" from heavy hitters overwhelms the true signal of infrequent edges.
Methodology: The gSketch Framework
The core innovation of gSketch is the replacement of a single global sketch with a collection of smaller, partitioned localized sketches. By understanding the graph's structure, gSketch minimizes damaging collisions.
Vertex-Based Partitioning
Instead of hashing edges blindly, gSketch groups edges based on their source vertices. It utilizes a partitioning tree to divide the vertex set into groups that exhibit "frequency uniformity." This approach leverages two key observations:
- Local Similarity: Edges emanating from the same vertex often share similar frequency behaviors.
- Skewness Management: By partitioning, gSketch ensures that "heavy" vertices do not share sketch space with "light" vertices, effectively isolating high-variance areas.
Operational Robustness
gSketch handles different scenarios through specialized mechanisms:
- Data and Workload Sampling: The system can build its initial partitioning using a reservoir sample of the stream or a sample of expected queries to optimize for specific user needs.
- Outlier Sketch: To address the "cold start" problem where new vertices appear post-partitioning, gSketch maintains a dedicated outlier sketch, ensuring the system remains robust as the graph evolves.
Experimental Evaluation
The authors evaluated gSketch against the standard Global CountMin sketch using three datasets: DBLP (co-authorship graph), IP Attack Network (network traffic), and GTGraph (a synthetic 1-billion-edge graph).
Key Results
- Accuracy: gSketch consistently outperformed the Global Sketch. In memory-constrained environments (e.g., <2MB of RAM), gSketch demonstrated 2 to 8 times better accuracy.
- Scalability: On the 1-billion-edge GTGraph dataset, the Global Sketch failed to provide effective queries at low memory levels, whereas gSketch remained robust.
- Performance: Despite the partitioning logic, gSketch maintains high throughput. Sketch construction for massive graphs takes only tens of seconds, and individual queries are resolved in under 0.2 seconds.
Conclusion
gSketch demonstrates that graph structure is a feature that can be leveraged for better data summarization. By moving from global to localized sketching via vertex-based partitioning, it significantly reduces the impact of frequency skewness. Future work may extend this framework to more complex structural queries, such as triangle counting or shortest path estimation in dynamic streams.
Summary updated