An asymptotically optimal algorithm for generating bin cardinalities

Abstract

In the balls-into-bins setting, n balls are thrown uniformly at random into n bins. The na\"ive way to generate the final load vector takes (n) time. However, it is well-known that this load vector has with high probability bin cardinalities of size ( n n). Here, we present an algorithm in the RAM model that generates the bin cardinalities of the final load vector in the optimal ( n n) time in expectation and with high probability. Further, the algorithm that we present is still optimal for any m ∈ [n, n n] balls and can also be used as a building block to efficiently simulate more involved load balancing algorithms. In particular, for the Two-Choice algorithm, which samples two bins in each step and allocates to the least-loaded of the two, we obtain roughly a quadratic speed-up over the na\"ive simulation.

0

Turn this paper into a full lesson

ArcXiv compiles a staged curriculum from this paper: 8-12 lessons across beginner → advanced, synthesised section guides, visuals, flashcards, a quiz, exercises, and on-demand deep dives per section. Grounded in the abstract, never invented.

Discussion (0)

Sign in to join the discussion.

Loading comments…