ALGORITHM FOR
BALLS AND BINS
Nitesh Bhargava
Mentor: Prof. C. Pandu Rangan
Indian Institute Of Technology, Madras
June 18, 2014
1
Outline
Introduction
Background and review of related work
Proper Allocation Algorithm/ Local Search Insertion
Extended local search allocation (ELSA)
Load balancing ELSA
Experimental Results
Applications
2
HyperGraph
Let X = (x1, x2, ..., xn) be a finite set. A hypergraph on X is a family H
= (E1,E2, ...,Em) of subsets of X such that
L-orientability of Hypergraphs
For any integers k >= 2 and L >= 1, a k-uniform hypergraph is called Lorientable, if for each edge we can select one of its vertices, so that
all vertices are selected at most L times.
Result: A critical quantity c*k,l exists such that with probability 1 o(1) the graph Hn,cn,k has an L-orientation if c < c*k,l , but fails doing
so if c*k,l.
6
Previous Work
No Bound on maximum Load
Random Allocation for m = n, maximum load =
log n
log log n
Azar showed that: if each ball is placed into bin which is least loaded then
log log n
maximum load = log 2
Maximum Load = 1 (find the free bin from the allocation graph)
BFS linear time only in expectation.
Random Walk insertion select uniformly at random a bin from the available
bins -> polylogarithmic bound (with high probability) on maximum allocation
time, but doesn't guarantee on total allocation time (might run forever).
8
10
=
Vertex
Bins
Free Vertex
Occupied Vertex/bin
11
Modeling
For vertices u, v V directed
edge (with ball y) e = (u, v) exists
iff u and v are one of choices of
ball y and u is occupied by y.
Label of vertex = shortest
distance from set of free vertex.
Directed Edge
Label = 3
12
14
15
17
This reduces our problem to LSA algorithm where number of bins is equal to
L*n.
19
20
21
Choose a bin with minimum load and allocate the ball in that bin.
We set the label of that bin one more than the minimum of the k-1 choices of the ball.
22
Remove the ball from the bin which has a free section from its other k1 choices.
Replace the ball and apply LBELSA algorithm for the replaced ball.
We simply allocate a section to the ball and increment the load of the
concerned bin.
23
Continued
24
25
26
27
Conclusion
ELSA algorithm successfully allocates m balls into n bins, under the given conditions.
ELSA and Load Balancing ELSA performs about 10 times better than the random walk
method.
Our algorithm finds maximum matchings in large sparse k-regular random bipartite
graphs in linear time with high probability.
28
Future Work
29
Applications
Load balancing
m = identical jobs and n machines, each job may choose randomly among k different
machines.
Efficient Dictionaries
m = items (balls) and n locations (bins). Each item chooses its preferred k locations by using
k random hash functions. Our aim is to assign each item to one of its chosen locations such
that all items are assigned and no location receives more than 1 item.
30
Any Questions??
31
References
M. Khosla. Balls into bins
Computer Science. Springer, 2013.
made
faster.
In ESA,
Lecture
Notes
in
32