Abstract
Researchers from Renmin University of China have introduced ODSS (Optimal Dynamic Subset Sampling), the first algorithm to achieve theoretical optimality for sampling independent events in a changing environment. ODSS achieves an expected query time of $O(1 + \mu)$, where $\mu$ is the expected number of samples, and a constant update time of $O(1)$. This performance makes it a powerful engine for scaling applications such as social media influence analysis and epidemic modeling on evolving networks.
Introduction
Subset sampling involves selecting a subset of $n$ independent events, each occurring with a specific probability. A naive approach flips a biased coin for every event, resulting in $O(n)$ time complexity. For large-scale systems, such as social networks with billions of users, this is inefficient if only a small number of events are expected to occur. Ideally, the complexity should be output-sensitive, proportional to the number of sampled events rather than the total population.
While static algorithms can achieve output-sensitive query times, they often fail in dynamic environments where probabilities change frequently. Existing dynamic methods either require $O(n)$ updates or complex $O(\log^2 n)$ index rebuilds. ODSS addresses this gap by providing a structure that supports both rapid queries and instant updates.
Methods: The ODSS Architecture
ODSS utilizes a hierarchical strategy to manage probabilities efficiently across three main components:
- Group Partitioning: Elements are categorized into $O(\log n)$ groups based on their probability ranges (e.g., $G_k = \{x_i \mid p(x_i) \in (2^{-k}, 2^{-k+1}] \}$).
- Hierarchical Sampling: Sampling occurs first at the group level. If a group is selected, individual elements within it are sampled using rejection sampling.
- Table Lookup Mechanism: To maintain $O(1)$ query time at the highest levels of the hierarchy where the number of groups is small, ODSS uses a precomputed lookup table. This avoids deep recursion and ensures constant-time performance at the top level.
- Constant-Time Updates: The structure allows for $O(1)$ updates because changing a probability or adding an element only requires local modifications to pointers and counters within the hierarchy.
Experimental Evaluation
The researchers evaluated ODSS against synthetic distributions (Normal, Half-normal, Exponential, and Log-normal) and real-world social network datasets, including Orkut-Links (~3M nodes) and Twitter (~41M nodes).
Key Results
ODSS consistently outperformed existing methods in both query and update efficiency. In tests with $10^5$ elements, ODSS was approximately 1000x faster than the naive method. Crucially, while competitors like BringmannSS exhibited significant update delays, ODSS maintained constant-time updates, outperforming them by factors of $10^2$ to $10^4$.
In real-world applications like Influence Maximization (IM) on the Twitter graph, an ODSS-integrated tool was 10x faster than the naive version and handled edge updates in under 4 microseconds.
Discussion and Future Work
ODSS proves that theoretical optimality—matching the lower bounds of $O(1+\mu)$ queries and $O(1)$ updates—is achievable for dynamic subset sampling. By treating subset sampling as a weighted sampling problem at the group level, ODSS bypasses traditional performance trade-offs.
While ODSS introduces some memory overhead due to its hierarchical structure and lookup table, its speed advantages are significant for big data applications. Future research may extend ODSS to Graph Neural Network (GNN) proximity queries and large-scale epidemiological simulations.
Summary updated