Algorithms and Lower Bounds for the Worker-Task Assignment Problem
Aaron Berger, William Kuszmaul, Adam Polak, Jonathan Tidor, Nicole Wein
aa r X i v : . [ c s . D S ] A ug Algorithms and Lower Bounds for the Worker-Task AssignmentProblem
Aaron Berger ∗ MIT William Kuszmaul † MIT Adam Polak ‡ Jagiellonian University Jonathan Tidor § MITNicole Wein ¶ MIT
Abstract
We study the problem of assigning workers to tasks where each task has demand for a particularnumber of workers, and the demands are dynamically changing over time. Specifically, a worker-taskassignment function φ takes a multiset of w tasks T ⊆ [ t ] and produces an assignment φ ( T ) from theworkers 1 , , . . . , w to the tasks T . The assignment function φ is said to have switching cost at most k if, for all task multisets T , changing the contents of T by one task changes φ ( T ) by at most k workerassignments. The goal of the worker-task assignment problem is to produce an assignment function φ with the minimum possible switching cost.Prior work on this problem (SSS’17, ICALP’20) observed a simple assignment function φ withswitching cost min ( w , t − ) , but there has been no success in constructing φ with sublinear switchingcost. We construct the first assignment function φ with sublinear, and in fact polylogarithmic, switchingcost. We give a probabilistic construction for φ that achieves switching cost O ( log w log ( wt )) and anexplicit construction that achieves switching cost polylog ( wt ) .From the lower bounds side, prior work has used involved arguments to prove constant lower boundson switching cost, but no super-constant lower bounds are known. We prove the first super-constantlower bound on switching cost. In particular, we show that for any value of w there exists a value of t for which the optimal switching cost is w . That is, when w ≪ t , the trivial bound on switching cost isoptimal.We also consider an application of the worker-task assignment problem to a metric embeddingsproblem. In particular, we use our results to give the first low-distortion embedding from sparse binaryvectors into low-dimensional Hamming space. ∗ supported by NSF Graduate Research Fellowship Program DGE-1122374 † supported by an NSF GRFP fellowship and a Fannie and John Hertz Fellowship. Research was partially sponsored by theUnited States Air Force Research Laboratory and was accomplished under Cooperative Agreement Number FA8750-19-2-1000.The views and conclusions contained in this document are those of the authors and should not be interpreted as representing theofficial policies, either expressed or implied, of the United States Air Force or the U.S. Government. The U.S. Government isauthorized to reproduce and distribute reprints for Government purposes notwithstanding any copyright notation herein. ‡ supported by the National Science Center of Poland grant 2017/27/N/ST6/01334 § supported by NSF Graduate Research Fellowship Program DGE-1122374 ¶ supported by NSF Grant CCF-1514339 Introduction
Consider a group of workers performing together a number of tasks . Each task has a demand – a non-negative integer indicating the number of workers that should be working on the task – and each workercan work on at most one task at a time. Furthermore, the demands are changing over time: at any pointthe demands may increase by one for one task and decrease by one for some other, so the total demandremains constant. Whenever the demands change, we want to reassign as few workers as possible so thateach task has a number of assigned workers matching its new demand. The assignment of workers to tasksmust be a function only of the current demands, however, and not a function of the past history. Does thereexist a worker-to-task assignment function that reassigns only a small number of workers when the demandschange? This problem can be formalized as follows.In the worker-task assignment problem, there are w workers 1 , , . . . , w and t tasks 1 , , . . . , t . A worker-task assignment function f is a function that takes as input a multiset T of w tasks, and produces anassignment of workers to tasks such that the number of workers assigned to a given task τ ∈ T is equal tothe multiplicity of τ in T .Two task multisets T , T of size w are said to be adjacent if they differ by exactly one task; that is, | T \ T | = | T \ T | =
1. The switching cost between two adjacent task multisets T , T of size w is definedas the number of workers whose assignment changes between f ( T ) and f ( T ) . The switching cost of f is defined to be the maximum switching cost over all pairs of adjacent task multisets. The goal of theworker-task assignment problem is to design a worker-task assignment function with the minimum possibleswitching cost.When thinking about the task multiset T as changing dynamically over time, the goal of the worker-taskassignment function is to change the set of worker-task assignments by as little as possible whenever T changes by one. What makes this problem combinatorially interesting is that the worker-task assignmentfunction must be determined entirely by the current value of T , and is not permitted to adapt based on thehistory of how T dynamically changes.The worker-task assignment problem was first formulated in the context of ant colonies, and specificallyhow the ants divide themselves up among tasks as the demand for these tasks changes over time [24].More generally, worker-task assignment is applicable for analyzing the combinatorial aspects of dynamictask allocation in any distributed system with certain properties; in particular, if the distributed agents are memoryless and lack the ability to communicate with one another [25]. The requirement that agents arememoryless can be important to applications such as swarm robotics, where an agent may abruptly fail andbe replaced with a new substitute agent; the substitute agent has access to T , but does not necessarily haveaccess to the history of T or to the current worker-task assignment. See the introduction of [25] for furthermotivation for these requirements, as well as more general background on task allocation in distributedsystems. Prior work.
The worker-task assignment problem has been studied in two previous works [24, 25]. Whenever the multiset of tasks changes to an adjacent multiset, at least one worker must switch tasks,and at worst all w workers will switch, so the optimal switching cost lies somewhere in the range [ , w ] .However, improving either of these bounds substantially has proven difficult.Su, Su, Dornhaus, and Lynch [24] initiated the study of the worker-task assignment problem. Theyobserved that assigning the workers to tasks in numerical order achieves a switching cost of t −
1, whichbeats the trivial upper bound on switching cost when there are more workers than tasks. They also showthat the switching cost is 2 for two workers and three tasks; simple casework shows that there is no way to These works did not explicitly name the problem, instead referring to it as a problem under the umbrella of dynamic distributedtask allocation . { , } , { , } , { , } and maintain a switching cost of 1. They alsoprovide constructions showing that a switching cost of 2 is achievable when w ≤ t ≤
4. In ICALP’20Su and Wein [25] proved that this is optimal in terms of t by showing that for t ≥ w ≥
3, any worker-task assignment function has switching cost at least 3. Additionally, they proved that any worker-taskassignment function has switching cost at least 4 for the case where t is sufficiently large in terms of w (atower of height w − Our results.
We prove a polylogarithmic upper bound for switching cost, which is an exponential improve-ment over the previously known upper bounds, which are linear.
Theorem 1.
There exists a worker-task assignment function that achieves switching cost O ( log w log ( wt )) .Theorem 1 is non-constructive. We show that one can explicitly construct a worker-task assignmentfunction at the cost of an extra polylog factor in switching cost. Theorem 2.
Thereisanexplicitworker-taskassignmentfunctionthatachievesswitchingcost O ( polylog ( wt )) .Both Theorems 1 and 2 continue to hold in the more general setting where the size of T changes overtime. That is, T is permitted to be any multiset of [ t ] of size w or smaller. Two task multisets T , T ofdifferent sizes are considered adjacent if they satisfy (cid:12)(cid:12) | T | − | T | (cid:12)(cid:12) = | ( T ∪ T ) \ ( T ∩ T ) | =
1. If | T | < w , then our worker-task assignment function assign workers 1 , . . . , | T | to tasks, and leaves workers | T | + , . . . , w unassigned.From the lower bounds side, we prove a super-constant lower bound for worker-task assignment. Theorem 3.
Forevery w and t ≥ tow ( Ω ( w )) ,every worker-task assignment function has switching cost w .Here tow ( n ) is defined to be a tower of twos of height n (the inverse of the log ∗ function).Theorem 3 says that if t is sufficiently larger than w , any worker-task assignment function must move all of the workers for some pair of adjacent task multisets. In particular, for every t there is some w for whichany worker-task assignment function has switching cost at least Ω ( log ∗ ( t )) . Therefore our bounds leave agap between log ∗ and polylog in terms of dependence on t . An application to metric embeddings: Densification into Hamming space.
The problem of embeddingone metric space M into another metric space M with small distortion has been widely studied in manycontexts and has found many algorithmic applications [1–9, 13, 18–20, 23].Bourgain [4] initiated the study of metric embeddings (into normed spaces) by showing that O ( log | M | ) -distortion embeddings into ℓ are possible for any space M . Much of the subsequent work has focusedeither on embeddings between exponentially large metric spaces [2, 3, 6–9, 13, 23], or on embeddings withsub-logarithmic distortion [3, 9, 18, 20].One natural question is that of densification : can one embed sparse vectors from a high-dimensional ℓ -space into a low-dimensional ℓ -space? That is, if V kn is the set of n -dimensional vectors with k non-zero entries, what is the smallest m for which V kn can be embedded into m -dimensional ℓ -space with lowdistortion? Charikar and Sahai [9] were the first to consider this problem, and showed how to achieve anoutput dimension of m = O (( k / ε ) log n ) with distortion 1 + ε . They also showed how to apply densificationto the related problem of embedding arbitrary tree metrics into low-dimensional ℓ -space [9]. Subsequently,Berinde et al. [3] used expander graphs in order to achieve m = O ( k log ( n / k ) / ε ) with distortion 1 + ε . Theythen used their densification embedding as a tool to perform sparse signal recovery [3, 15–17]. Both of theknown densification algorithms [3, 9] rely on linear sketches, in which each vector ~ x ∈ V kn is mapped to avector of the form ∑ i x i ~ b i for some set of vectors ~ b , . . . , ~ b n .The prior work on densification [3,9] has focused on embedding into ℓ -space. In Section 6, we consider3he same problem over Hamming space, where the distance between two vectors ~ x ,~ y is given by Ham ( ~ x ,~ y ) = |{ i | x i = y i }| . Densification over Hamming space requires new techniques due to the fact that summationsof vectors (and thus linear sketches) do not behave well in Hamming space.Let H kn denote the set of n -dimensional binary vectors with k ones. Let H k ( n ) denote the set of k -dimensional vectors with entries from [ n ] . We show that H kn can be embedded into H k ( n ) with distortion O ( log n log k ) . Theorem 4.
There exists amap φ : H kn → H k ( n ) such that, forevery ~ x ,~ y ∈ H kn ,Ham ( ~ x ,~ y ) / ≤ Ham ( φ ( ~ x ) , φ ( ~ y )) ≤ O ( log n log k ) Ham ( ~ x ,~ y ) . The densification embedding is a simple application of the worker-task assignment problem. In order toembed a vector ~ x ∈ H kn into H k ( n ) , we simply assign the workers { , , . . . , k } to the task set T = { i | ~ x i = } ,and then we construct the vector ~ y whose i -th coordinate denotes the task in T to which worker i is assigned.This map transforms the switching cost in the worker-task assignment problem into the distortion of themetric embedding.The densification embedding is optimal in two senses. First, the target space of the embedding musthave Ω ( k ) coordinates simply in order to allow for distances of Ω ( k ) . Second, when k ≪ n , any embeddingof H kn to k -dimensional Hamming space must use Ω ( log n ) bits per coordinate, simply in order so that theembedding is an injection. It is not clear whether the distortion achieved by our embedding is optimal,however, and it remains open whether smaller distortion can be achieved by allowing for a larger target-space dimension. This section gives an overview of the main technical ideas in the paper. For simplicity, the section will treatthe task multiset T ⊆ [ t ] as always being a set (rather than a multiset). In fact, one can formally reduce fromthe multiset case to the set case, as is discussed in Section 3, at the cost of t being replaced with t ′ = wt . We begin by describing a simple assignment function that we call the random-permutation algorithm .The random-permutation algorithm does not necessarily achieve small switching cost, but it does have theproperty that for any two adjacent task sets T , T ⊆ [ t ] , the switching cost between T and T is O ( log w ) with high probability in w . The algorithm.
The random-permutation algorithm assigns to each worker i ∈ [ w ] a random permutation σ i = h σ i ( ) , σ i ( ) , . . . , σ i ( t ) i of the numbers [ t ] . We think of worker i as preferring task σ i ( j ) over task σ i ( j + ) for all j ∈ [ t − ] .Suppose we wish to assign workers to tasks T . The random-permutation algorithm assigns the workers1 , , . . . , w to tasks τ , τ , . . . , τ w ∈ T one by one, assigning worker i to task τ i : = { min j σ i ( j ) | j ∈ T \ { τ , . . . , τ i − }} . That is, we assign worker i to the task that it most prefers out of the tasks in T that have not yet been assigneda worker. 4or each i ∈ [ w ] , we define the i -remainder tasks to be the tasks T \ { τ , . . . , τ i } . That is, the i -remaindertasks are the tasks that remain after the first i workers are assigned. This means that worker i + i -remainder task that it most prefers. Analyzing expected switching cost.
Let T , T ⊆ [ t ] be adjacent task sets of size w . We begin by showingthat the expected switching cost from T to T is O ( log w ) .Let r and s be such that T = ( T ∪ r ) \ { s } . Let ψ and ψ denote the assignments produced by therandom permutation algorithm for T and T , respectively. Let A i and B i denote the set of i -remainder tasksduring the constructions of ψ and ψ , respectively.The key to analyzing the random-permutation algorithm is to compare the i -remainder sets A i and B i for each i ∈ [ w ] . We claim that | A i \ B i | ≤ i ∈ [ w ] . We prove this by induction on i : suppose that A i − = ( B i − ∪ { a } ) \ { b } , and suppose for contradiction that | A i \ B i | ≥
2. If either ψ assigns worker i totask a , or ψ assigns worker i to task b , then we would be guaranteed that | A i \ B i | ≤
1, a contradiction. Thus ψ and ψ must each assign worker i to a task in A i − ∩ B i − . But this means that, in both assignments,worker i is assigned to the task in A i − ∩ B i − that worker i most prefers. Thus ψ and ψ assign worker i tothe same task, again contradicting that | A i \ B i | ≥ ψ and ψ differing in their assignment of worker i . Since A i containsat most one element a not in B i , the probability that worker i prefers a over all elements in B i is at most1 / | B i | = / ( w − i + ) . Similarly, since B i contains at most one element b not in A i , the probability thatworker i prefers b over all elements in A i is at most 1 / | A i | = / ( w − i + ) . By the union bound, it followsthat the probability of ψ and ψ assigning worker i to different tasks is at most 2 / ( w − i + ) .By linearity of expectation, the expected switching cost between T and T is at most w ∑ i = w − i + = O ( log w ) . Why a union bound fails for worst-case switching cost.
By using Chernoff-style bounds, one canmodify the above analysis of the random-permutation algorithm to show that, with high probability in w (i.e., probability 1 − / poly w ), the switching cost between T and T is O ( log w ) .On the other hand, if a switching cost of O ( log w ) is to be achieved for all pairs ( T , T ) of adjacent tasksets, then there are (cid:0) w + (cid:1)(cid:0) tw + (cid:1) such pairs that must be considered. When w = t /
2, the number of distinctpairs ( T , T ) of adjacent task sets exceeds 2 t ≥ w .Thus the probability bounds achieved by the random-permutation algorithm are nowhere near highenough to enable a union bound over all adjacent worker-set pairs. We call this the union-bound mag-nitude issue . We now describe a randomized assignment algorithm A that, with high probability in t , achieves switchingcost O ( log w log t ) on all adjacent task-sets T , T ⊆ [ t ] of size w . That is, with high probability, A producesan assignment function satisfying the requirements of Theorem 1. The algorithm A is called the multi-roundballs-to-bins algorithm .The multi-round balls-to-bins algorithm essentially flips the approach taken by the random-permutationalgorithm. One can think of the random-permutation algorithm as consisting of w phases in which eachphase deterministically assigns exactly one worker to a task, and then the phases probablistically incursmall switching cost. In contrast, the multi-round balls-to-bins algorithm consists of O ( log w ) phases, whereeach phase probabilistically assigns some number of workers to tasks, and each phase deterministically Structure of the multi-round balls-to-bins algorithm.
We begin with a succinct description of thealgorithm A . For each i from 1 to log . w , repeat the following hashing procedure c log t many times.Initialize a hash table consisting of w / ( . ) i bins and randomly hash each unassigned worker and eachunassigned task into this table. For each bin that contains at least one worker and one task, assign theminimum worker in that bin to the minimum task in that bin.In more detail, the algorithm A is the composition of O ( log w ) sub-algorithms A , A , . . . . Each of A , A , . . . are partial-assignment algorithms, meaning that A i assigns some subset of the workers to somesubset of the tasks in T , possibly leaving workers and tasks unassigned. Note that the input to algorithm A i is the set of workers/tasks that remain unassigned by A , . . . , A i − . Thus one can think of the input to A i asbeing a pair ( W , T ) where W ⊆ [ w ] is a set of workers, T ⊆ [ t ] is a set of tasks, and | W | = | T | .The algorithm A ’s responsibility is to assign enough workers to tasks so that at most t / . A is then executed on the remaining (i.e., not-yet-assigned) workers andtasks, and is responsible for assigning enough workers to tasks so that at most t / ( . ) workers remainunassigned. Continuing like this, algorithm A i is executed on the workers/tasks that remain unassignedby all of A , . . . , A i − , and is responsible for assigning enough workers to tasks that at most r i = t / ( . ) i workers in W remain unassigned.Each of the A i ’s are randomized algorithms, meaning that they have some probability of failure. Thefailure mode for A i is not high-switching cost, however. In fact, as we shall see later, each A i deterministi-cally contributes at most O ( log w ) to the switching cost. Instead, the way in which A i can fail is that it mayleave more than r i workers unassigned. This means that the failure mode for the full algorithm A is that itmay fail to assign all of the workers in W to tasks in T . Applying the probabilistic method to A , A , . . . . Before describing the partial-assignment algorithms A i in detail, we first describe how our analysis of algorithm A overcomes the union-bound magnitude issue.Recall that each algorithm A i is responsible for reducing the number of remaining workers to r i = t / ( . ) i . We will later see that each A i has a failure probability p i that is a function of r i and t , namely, p i = t Ω ( r i ) . As i grows, the failure probability p i of A i becomes larger, making it impossible to union-bound overexponentially many pairs of task sets T , T .An important insight is that, if all of A , . . . , A i − succeed (i.e., they each assign the number of workersthat they are responsible for assigning) then the number of workers and tasks that A i − is executed on isonly O ( r i ) . That is, if we think of the inputs to A i as being pairs ( W , T ) where W ⊆ [ w ] is a set of workersand T ⊆ [ t ] is a set of tasks, the set of inputs ( W , T ) that algorithm A i − must succeed on is only the inputsfor which | W | = | T | ≤ O ( r i ) . The number of such inputs is at most t O ( r i ) . In other words, even though thefailure probability p i of algorithm A i increases with i , the number of inputs over which we must apply aunion bound decreases. By a union bound, we can deduce that A i has a high probability in t of succeedingon all relevant inputs ( W , T ) . Combining this analysis over all of the partial-assigning algorithms A , A , . . . ,we get that the full assignment algorithm A also succeeds with high probability in t . In particular, we haveproven that there exists a deterministic assignment function with the desired switching cost, and that such afunction can be obtained with high probability by the randomized algorithm A .6 esigning each A i . Each algorithm A i is a composition of Θ ( log t ) algorithms A i , , A i , , A i , , . . . , each ofwhich individually is a partial assignment algorithm.Each algorithm A i , j takes a simple balls-in-bins approach to assigning some subset of the remainingworkers to some subset of the remaining tasks.In particular, A i , j places the workers into bins 1 , , . . . , r i by hashing each worker to a bin (using a randomfunction from [ w ] to [ r i ] ). Similarly, the tasks are placed into bins 1 , , . . . , r i by hashing each task to a bin.If a bin b contains both at least one worker and at least one task, then the smallest-numbered worker in bin b is assigned to the smallest-number task in bin b .Note that each of the algorithms A i , , A i , , A i , , . . . are identical copies of one-another, except usingdifferent random bits. Also note all of the A i ’s are defined in the same way as each other, except the numberof bins hashed to decreases as i increases. As we shall see shortly, the reason for having A i consist of Θ ( log t ) sub-algorithms is to enable probability amplification later in the analysis. Bounding the switching cost.
The partial assignment algorithms A i , j are designed to satisfy two essentialproperties, which can then be combined to bound the switching cost of the full algorithm A . These twoproperties are: • Compatibility:
Let I = ( W , T ) and I = ( W , T ) be inputs to A i , j . Suppose I and I are unitdistance , meaning that | W \ W | + | W \ W | + | T \ T | + | T \ T | ≤ . Let I ′ = ( W ′ , T ′ ) and I ′ = ( W ′ , T ′ ) be the workers and tasks that remain unassigned when A i , j isexecuted on each of I and I , respectively. Then I ′ and I ′ are guaranteed to also be unit-distance. • Low Switching Cost:
The switching cost of A i , j is O ( ) . That is, if I = ( W , T ) and I = ( W , T ) are inputs to A i , j , and I and I are unit-distance, then the worker-task assignments made by A i , j oneach of I and I differ by at most O ( ) assignments.Consider two adjacent task sets T and T . When we execute A on T and T , respectively, we use I i , j and I i , j , respectively, to denote the worker/task input that are given to partial-assignment algorithm A i , j .The Compatibility property of the A i , j ’s guarantees by induction that, for each A i , j the worker/task inputs I i , j and I i , j are unit-distance (or zero-distance). The Low-Switching-Cost property then guarantees that each A i , j contributes at most O ( ) to the switching cost of A . Since there are O ( log t log w ) A i , j ’s, this bounds thetotal switching cost of A by O ( log t log w ) . Deriving the success probabilities.
Next we analyze the probability of A i failing on a given worker/taskinput ( W , T ) . Recall that the only way in which A i might fail is if more than r i workers remain unassignedafter A i finishes. Additionally, since we need only consider cases where A i − succeeds, we can assume that r i ≤ | W | , | T | ≤ . r i .Let q denote the number of workers that A i , assigns to tasks. Given that r i ≤ | W | , | T | ≤ . r i , a simpleanalysis of A i , shows that E [ q ] ≥ r i /
5. On the other hand, using McDiarmid’s inequality, one can performa balls-in-bins style analysis in order to show that Pr [ E [ q ] − q > r i / ] ≤ − Ω ( r i ) . This means that A i , hasprobability at most 2 − Ω ( r i ) of leaving more than r i workers unassigned.In order for A i to fail (i.e., A leaves more than r i workers unassigned), all of sub-algorithms A i , , A i , , . . . would have to individually fail. Since there are Θ ( log t ) sub-algorithms, the probability of them all failing is p i = − Ω ( log tr i ) = t − Ω ( r i ) . This allows us to apply the probabilistic method to the A i ’s in order to bound the probability of any A i failingon any input, as desired. 7 n explicit construction with polylogarithmic switching cost. The multi-round balls-to-bins algorithmgives a non-explicit approach to constructing an assignment function with low switching cost. The approachis non-explicit because it relies on the probabilistic method.We also show how to obtain an explicit algorithm with switching cost O ( polylog wt ) . The basic ideais to replace random hash functions, used to place workers and tasks into bins, with functions obtainedfrom pseudorandom objects called strong dispersers. Instead of trying a number of random hash functionswithin the A i , j ’s, we instead iterate over all of the hash functions from a small family given by a strongdisperser [22]. Define s w , t to be the optimal switching cost for assignment functions that assign workers 1 , , . . . , w to mul-tisets of w tasks from the universe [ t ] . The upper bounds in this paper establish that s w , t ≤ O ( log w log ( wt )) .It is natural to wonder whether smaller bounds can be achieved, and in particular, whether a small switchingcost that depends only on w can be achieved.It trivially holds that s w , t ≤ w . We show that when t is sufficiently large relative to w , there is a matchinglower bound of s w , t ≥ w . In fact, our lower bound only uses the evaluation of the assignment function onsets (as opposed to multisets).Consider an assignment function f that, given a multiset T of tasks with elements from [ t ] of w tasks,produces an assignment of workers [ w ] to tasks T . Our goal will be to find tasks τ < τ < · · · < τ w + suchthat if f ( { τ , . . . , τ w } ) assigns worker i to task τ π ( i ) for some permutation π of [ w ] , then f ( { τ , . . . , τ w + } ) assigns worker i to task τ π ( i )+ . The existence of such a configuration immediately implies that f hasswitching cost w .We use an application of the hypergraph Ramsey theorem to show that, when t is large enough, aconfiguration of the type described in the above paragraph must exist. Let K ( w ) t denote the complete w -uniform hypergraph on t vertices. This is just the set of w -element subsets of [ t ] , which correspond to setsof tasks. For each hyperedge T = { τ , . . . , τ w } , where 1 ≤ τ < · · · < τ w ≤ t , we color the hyperedge T bya color π where τ π ( i ) is the task assigned to worker i . This gives a coloring of the hyperedges of K ( w ) t by w !colors, each color being a permutation of [ w ] . By the hypergraph Ramsey theorem, if t is large enough interms of w , there must exist w + τ , . . . , τ w + so all the hyperedges formed by the vertices have thesame color π . By examining the hyperedges { τ , . . . , τ w } and { τ , . . . , τ w + } , it follows that f ( { τ , . . . , τ w } ) assigns each worker i to task τ π ( i ) and that f ( { τ , . . . , τ w + } ) assigns each worker i to task τ π ( i )+ , as desired. O ( log w log ( wt )) In this section, we prove the following theorem.
Theorem 1.
There exists aworker-task assignment function that achieves switching cost O ( log w log ( wt )) .We demonstrate the existence of such a function via the probabilistic method, showing that there is arandomized construction that produces a low-switching cost worker-task assignment function with nonzeroprobability. We will also also show how to derandomize the construction in Section 4, at the cost of a fewextra log factors. From multisets to sets.
We begin by showing that, without loss of generality, we can restrict our attentionto task multisets T that are sets (rather than multisets). We reduce from the multiset version of the problemwith w workers and t tasks to the set version of the problem with w workers and wt tasks. Lemma 5.
Define n = wt . Let f be a worker-task assignment function that assigns workers [ w ] to task sets T ⊆ [ n ] (note that f is defined only on task sets T , and not on multisets). Let s be the switching cost of8 (considering only pairs of adjacent subsets of [ n ] , rather than adjacent sub-multisets). Then there existsa worker-task assignment function f ′ assigning workers [ w ] to task multisets T ⊆ [ t ] , such that f ′ also hasswitching cost s . Proof.
When discussing the assignment function f , we think of its input task-set T as consisting of elementsfrom [ t ] × [ w ] rather than elements of [ tw ] .With this in mind, we construct f ′ as follows. Given a task multiset T ⊆ [ t ] , define the set S ( T ) ⊂ [ t ] × [ w ] to be S ti = (cid:8) ( i , ) , . . . , ( i , m T ( i )) (cid:9) , where m T ( i ) is the multiplicity of i in T . The worker-task assignment f produces some bijection φ S ( T ) : [ w ] → S ( T ) . Similarly, f ′ should produce some bijection ψ T : [ w ] → T . Thisbijection is defined naturally by projection: if φ S ( T ) assigns worker j to task ( i , x ) , let ψ T assign worker j totask i .We now compute the switching cost of f ′ . Let T and T ′ be two adjacent task multisets, so T ′ = T ∪{ a } \ { b } for some a , b ∈ [ t ] . Then S ( T ′ ) = S ( T ) ∪ { ( a , m T ( a ) + ) } \ { ( b , m T ( b )) } , and so S ( T ′ ) is adjacentto S ( T ) . Since f has switching cost s , φ S ( T ) and φ S ( T ′ ) agree on w − s workers. By construction, ψ T and ψ T ′ must agree on these w − s workers as well, and so it too has switching cost at most s .In the remainder of the section, we will make the assumption that T is a subset of [ n ] , and we will showhow to design an assignment function with switching cost O ( log w log n ) on all pairs of adjacent subsets of [ n ] . By Lemma 5, setting n = wt then implies Theorem 1. Designing an assignment function as an algorithm.
It will be helpful to think of the function we constructfor assigning workers to tasks as an algorithm A , which we call the multi-round balls-to-bins algorithm .The algorithm A takes as input a set T ⊂ [ n ] of tasks with | T | = w and must produce a bijection from theworkers [ w ] to T .The algorithm constructs this bijection in stages. Each stage is what we call a partial assignmentalgorithm , which takes as input the current sets of workers and tasks that have yet to be matched andassigns some subset of these workers to some subset of the tasks. Formally, we define a partial assignmentalgorithm to be any function ψ which accepts as input any pair of sets T ⊂ [ n ] , W ⊂ [ w ] with | T | = | W | andproduces a matching between some subset of T and some subset of W . After applying ψ to ( T , W ) , theremay remain some unmatched elements T ′ ⊂ T , W ′ ⊂ W . We call ( T , W ) the worker-task input to ψ and ( T ′ , W ′ ) the worker-task output . Since a matching must remove exactly as many elements from T as it doesfrom W , we must also have | W ′ | = | T ′ | . Consequently, there is a natural notion of the composition of twopartial assignment algorithms: the composition ψ ′ ◦ ψ applies ψ and then ψ ′ , letting the worker-task outputof ψ be the worker-task input to ψ ′ . The algorithm.
We recall the description of the algorithm A . For each i from 1 to c log w , repeat thefollowing hashing procedure c log n many times. Initialize a hash table consisting of w / ( . ) i bins andrandomly hash each unassigned worker and each unassigned task into this table. For each bin that containsat least one worker and one task, assign the minimum worker in that bin to the minimum task in that bin.In more detail, our algorithm A is the composition of log . w partial-assignment algorithms, A = A ◦ A ◦ · · · ◦ A log . w . Let c be a large positive constant. Each A i is itself the composition of c log n partial-assignment algorithms, A i = A i , ◦ A i , ◦ · · · ◦ A i , c log n . Designing the parts.
Each A i , j assigns workers to tasks using what we call a w / ( . ) i -bin hash , which wedefine as follows. 9or a given parameter k , a k -bin hash selects functions h : [ w ] → [ k ] and h : [ n ] → [ k ] independently anduniformly at random. For each worker ω ∈ [ w ] , we say that ω is assigned to bin h ( ω ) . Similarly, for each τ ∈ [ n ] we say τ is assigned to h ( τ ) . These functions are then used to construct a partial assignment. Givena worker-task input ( W , T ) , we restrict our attention to only the assignments of workers in W and tasks in T . In each bin κ ∈ [ k ] with at least one worker and one task assigned, match the smallest such worker tothe smallest such task. Importantly, once h and h are fixed, the algorithm A i , j uses this same pair of hashfunctions for every worker-task input, which (as we will see later) is what allows it to make very similarassignments for similar inputs and achieve low switching cost.We set each A i , j to be an independent random instance of the k -bin hash, where k = w / ( . ) i . Formally,this means that the algorithm A = A , ◦ · · · ◦ A log . w , c log n is a random variable whose value is a partial-assignment function. Our task is thus to prove that, with non-zero probability, A fully assigns all workers totasks and has small switching cost. Analyzing the algorithm.
In Section 3.2, we show that A deterministically has switching cost O ( log w log n ) .Although A always has small switching cost, the algorithm is not always a legal worker-task assignmentfunction. This is because the algorithm may sometimes act as a partial worker-task assignment function,leaving some workers and tasks unassigned.In Section 3.1, we show that with probability greater than 0 (and, in fact, with probability 1 − / poly n ),the algorithm A succeeds at fully assigning workers to tasks for all worker-task inputs ( W , T ) . Theorem 1follows by the probabilistic method. Call a partial-assignment algorithm ψ fully-assigning if for every worker/task input ( W , T ) , ψ assigns all ofthe workers in W to tasks in T . That is, ψ never leaves workers unassigned. Proposition 6.
Themulti-roundballs-to-binsalgorithm A isfully-assigning withhighprobabilityin n . Thatis,for anypolynomial p ( n ) , ifthe constant c used todefine A issufficiently large, then A is fully-assigningwithprobability atleast 1 − O ( / p ( n )) .Proposition 6 tells us that with high probability in n , A succeeds at assigning all workers on all inputs.We remark that this is a much stronger statement than saying that A succeeds with high probability in n ona given input ( W , T ) .The key to proving Proposition 6 is to show that each A i performs what we call (cid:0) w / ( . ) i (cid:1) -halving . Apartial-assignment function ψ is said to perform k -halving if for every worker/task input ( W , T ) of size atmost 1 . k , the worker-task output ( W ′ , T ′ ) for ψ ( W , T ) has size at most k .If every A i performs w / ( . ) i -halving, then it follows that A ◦ · · · ◦ A log . w is a fully-assigning algorithm. Thus our task is to show that each A i performs w / ( . ) i -halving with highprobability in n .We begin by analyzing the k -bin hash on a given worker/task input ( W , T ) . Lemma 7.
Let ψ arandomly selected k -bin hash. Let ( W , T ) beaworker/task input satisfying | W | = | T | ≤ . k ,andlet ( W ′ , T ′ ) betheworker/task outputof ψ ( W , T ) . Theprobability that ( W ′ , T ′ ) hassize k orlargeris 2 − Ω ( k ) . Proof.
Let X be the random variable denoting the number of worker/task assignments made by ψ ( W , T ) .Equivalently, X counts the number of bins to which at least one worker is assigned and at least one task isassigned—call these the active bins . We will show that Pr [ X < k ] ≤ − Ω ( k ) . Since | W | = | T | ≤ . k , this10mmediately implies that | W ′ | = | T ′ | ≤ . k − . k ≤ k with probability 1 − − Ω ( k ) , as desired.We begin by computing E [ X ] . For each bin j ∈ [ k ] , the probability no workers are assigned to bin j is ( − / k ) | W | ≤ ( − / k ) k ≤ / e . Similarly, the probability that no tasks are assigned to bin j is at most ( − / k ) | T | ≤ / e . The probability of bin j being active is therefore at least 1 − / e ≥ /
4. By linearity ofexpectation, E [ X ] ≥ k / X is tightly concentrated around its mean. Because the binsthat are active are not independent of one-another, we cannot apply a Chernoff bound. Instead, we employMcDiarmid’s inequality: Theorem 8 (McDiarmid ’89 [21]) . Let A , . . . , A m beindependent random variables over anarbitrary prob-ability space. Let F beafunction mapping ( A , . . . , A m ) to R ,and suppose F satisfies,sup a , a ,..., a m , a i | F ( a , a , . . . , a i − , a i , a i + , . . . , a m ) − F ( a , a , . . . , a i − , a i , a i + , . . . , a m ) | ≤ R , for all 1 ≤ i ≤ m . That is, if A , A , . . . , A i − , A i + , . . . , A m are fixed, then the value of A i can affect the valueof F ( A , . . . , A m ) by atmost R . Thenfor all S > [ | F ( A , . . . , A m ) − E [ F ( A , . . . , A m )] | ≥ R · S ] ≤ e − S / m . The number of active bins X is a function of at most 2 . · k independent random variables (namely, thehashes h ( ω ) for each ω ∈ W and the hashes h ( τ ) for each τ ∈ T ). Each of these random variables canindividually change the number of active bins by at most one. It follows that we can apply McDiarmid’sinequality with R = m = . k . Taking S = k /
8, we obtainPr [ | X − E [ X ] | ≥ k / ] ≤ e − Ω ( k ) . Since E [ X ] ≥ k /
4, we have that Pr [ X < k / ] ≤ e − Ω ( k ) , which completes the proof of the lemma.Our next lemma shows that each A i is k -halving with high probability in n , where k = w / ( . ) i . Lemma 9.
Let ψ , . . . , ψ c log n beindependent random k -bin hashes, and let ψ = ψ ◦ · · · ◦ ψ c log n . Withhighprobability in n , ψ is k -halving. Thatis,every worker-task input ( W , T ) with | W | = | T | ≤ . k has aworkertask output ( W ′ , T ′ ) with | W ′ | = | T ′ | ≤ k . Proof.
Fix an arbitrary worker-task input ( W , T ) with | W | = | T | ≤ . k . Let ( W i , T i ) denote the worker-taskoutput after applying the first i rounds, ψ ◦ · · · ◦ ψ i . Let p i denote the probability that | W i | = | T i | > k .First, we observe that p i ≤ e − Ω ( k ) p i − for all i >
1. Indeed, for | W i | = | T i | > k , we must necessarily have | W i − | = | T i − | > k , which occurs with probability p i − , but in this situation, the probability that ψ i producesa worker-task output of size greater than k is a further e − Ω ( k ) by Lemma 7.The probability that ψ fails to reduce the size of ( W , T ) to k or smaller is thus at most p c log n ≤ e − Ω ( ck log n ) ≤ n − Ω ( ck ) , (1)where c is treated as a parameter.On the other hand, the number of possibilities for input pairs ( W , T ) satisfying | W | = | T | ≤ . k is . k ∑ j = (cid:18) wj (cid:19)(cid:18) nj (cid:19) ≤ . k · w . k n . k ≤ n O ( k ) . (2)Combining (1) and (2), the probability that there exists any pair ( W , T ) of size 1 . k or smaller which fails tohave its size reduced to k or smaller is at most n O ( k ) − c Ω ( k ) . If c is selected to be a sufficiently large constant,then it follows that ψ performs k -halving with probability at least 1 − n − Ω ( k ) .11e now prove Proposition 6. Proof of Proposition 6.
By Lemma 9, each algorithm A i is (cid:0) w / ( . ) i (cid:1) -halving with high probability in n .By a union bound, it follows that all of A i ∈ { A , . . . , A log . w } are (cid:0) w / ( . ) i (cid:1) -halving with high probabilityin n . If this occurs, then A = A ◦ · · · ◦ A log . w is fully-assigning, as desired. Recall that two worker/task inputs ( W , T ) and ( W , T ) are said to be unit distance if | W \ W | + | W \ W | + | T \ T | + | T \ T | ≤ . A partial-assignment algorithm ψ is s -switching-cost bounded if for all unit-distance pairs of worker/taskinputs ( W , T ) and ( W , T ) , the set of assignments made by ψ ( W , T ) deterministically differs from the setof assignments made by ψ ( W , T ) by at most s .In this section, we prove the following proposition. Proposition 10.
Themulti-round balls-to-bins algorithm is O ( log w log n ) -switching-cost bounded.We begin by showing that each of the algorithms A i , j are O ( ) -switching-cost bounded. Lemma 11.
Forany k ,the k -bin hash algorithm is O ( ) -switching-cost bounded. Proof.
Let ψ denote the k -bin hash algorithm. Consider unit-distance pairs of worker/task inputs ( W , T ) and ( W , T ) . Changing W to W can change the assignments made by ψ for at most a constant number ofbins. Similarly changing T to T can change the assignments made by ψ for at most a constant number ofbins. Thus ψ ( W , T ) differs from ψ ( W , T ) by at most O ( ) assignments.Recall that A is the composition of the O ( log w log n ) partial-assignment algorithms A i , j ’s. The fact thateach A i , j is O ( ) -switching-cost bounded does not directly imply that A is O ( log w log n ) -switching-costbounded, however, because switching cost does not necessarily interact well with composition. In order toanalyze A , we show that each A i , j satisfies an additional property that we call being composition-friendly.A partial-assignment algorithm ψ is composition-friendly , if for all unit-distance pairs of worker/taskinputs ( W , T ) and ( W , T ) , the corresponding worker/task outputs ( W ′ , T ′ ) and ( W ′ , T ′ ) are also unit-distance.Lemma 12 shows that each A i , j is composition-friendly. Lemma 12.
Forany k ,the k -bin hash iscomposition-friendly. Proof.
Although the algorithm ψ is formally only defined on input ( W , T ) for which | W | = | T | , we willabuse notation here and consider ψ even on worker/task input ( W , T ) satisfying | W | 6 = | T | . Define the difference-score of a pair of worker/task inputs I = ( W , T ) , I = ( W , T ) to be the quantity d ( I , I ) = | W \ W | + | W \ W | + | T \ T | + | T \ T | . We will show the stronger statement that the difference-score d ( O , O ) of the corresponding worker/taskoutputs O = ( W ′ , T ′ ) , O = ( W ′ , T ′ ) satisfies d ( O , O ) ≤ d ( I , I ) . (3) Indeed, the definition of the k -bin hash does not require a worker-task input with | W | = | T | . The only reason we require thisequality in general is to simplify calculations, as in practice the algorithm will only be run on worker-task inputs of equal size.
12t suffices to consider only two special cases: the case in which W = W ∪ { ω } for some worker ω and T = T ; and the case in which T = T ∪ { τ } for some task τ and W = W . Iteratively applying these twocases to transform I into I implies inequality 3.For this purpose, the roles of W and T are identical, so suppose without loss of generality that W = W ∪ { ω } for some worker ω and T = T . Recall that the assignment of workers and tasks to buckets isdetermined by some hash functions h , h and in particular is the same whether we input W or W . Wefirst assign (only) the elements of W and T to their respective buckets, and then look at how including theassignment of ω changes the worker-task output. If h assigns ω to either a bin with no tasks or a bin whichalready has some lexicographically smaller worker, then we will have W ′ = W ′ ∪ { w } and T ′ = T ′ . If h assigns worker ω to a bin with no other workers and at least one task, we let the smallest such task be τ and see W ′ = W ′ and T ′ = T ′ \ { τ } . Finally, if h assigns ω to a bin with only larger workers and at leastone task, we let the minimal such worker be γ , and we see W ′ = W ′ ∪ { γ } and T ′ = T ′ . In all three cases, d ( O , O ) =
1, as desired.Next, we will show that composing composition-friendly algorithms has the effect of summing switchingcosts.
Lemma 13.
Suppose that partial-assignment algorithms ψ , ψ , . . . , ψ k are all composition-friendly, andthat each ψ i is s i -switching-cost bounded. Then ψ ◦ ψ ◦ · · · ◦ ψ k is composition-friendly and is ( ∑ i s i ) -switching-cost-bounded. Proof.
By induction, it suffices to prove the lemma for k =
2. Let I = ( W , T ) and I = ( W , T ) be unit-distance worker/task inputs.For i ∈ { , } , let I ′ i = ( W ′ i , T ′ i ) be the worker/task output for ψ ( W i , T i ) , and let I ′′ i = ( W ′′ i , T ′′ i ) be theworker/task output for ψ ( W ′ i , T ′ i ) .Since ψ is composition friendly, its outputs I ′ and I ′ are unit distance. Since I ′ and I ′ are unit distance,and since ψ is composition friendly, the outputs I ′′ and I ′′ of ψ are also unit distance. Thus ψ ◦ ψ iscomposition friendly.Since the inputs I and I to ψ are unit-distance, ψ ( I ) and ψ ( I ) differ in at most s worker-taskassignments. Since the inputs I ′ and I ′ to ψ are also unit distance, ψ ( I ′ ) and ψ ( I ′ ) differ in at most s worker-task assignments. Thus the composition ψ ◦ ψ is ( s + s ) -switching-cost bounded, as desired.We can now prove Proposition 10. Proof of Proposition 10.
By Lemma 11, each A i , j is O ( ) -switching-cost bounded. By Lemma 12, each A i , j is composition friendly. Since A is the composition of the O ( log w log n ) different A i , j ’s, it follows byLemma 13 that A is O ( log w log n ) -switching-cost bounded. In this section, we derandomize the multi-round balls-to-bins algorithm to prove the following theorem.
Theorem 2.
Thereisanexplicitworker-taskassignmentfunctionthatachievesswitchingcost O ( polylog ( wt )) .To this end we use pseudorandom objects called strong dispersers . Intuitively, a disperser is a functionsuch that the image of any not-too-small subset of its large domain (e.g. workers or tasks) is a dense subsetof its small co-domain (e.g. bins). Since this requirement is hard to satisfy directly, dispersers are definedwith a second argument, called the seed. For a strong disperser, the density requirement is satisfied onlyin expectation over the seed. The standard way to define strong dipsersers (Definition 14 below) is in thelanguage of random variables. We follow with an equivalent alternative Definition 15, more convenient forour purposes. 13 efinition 14 (Strong dispersers) . For k ∈ N , ε ∈ R + ,a ( k , ε ) -strong disperser isafunction Disp : { , } n ×{ , } d → { , } m such that forany random variable X over { , } n with min-entropy atleast k wehave | Supp (( Disp ( X , U d ) , U d )) | ≥ ( − ε ) · m + d . Here Supp denotes the support of a random variable, U d denotes the uniform distribution on { , } d , andthe min-entropy of a random variable X is defined as min x ( − log ( Pr [ X = x ])) . We will use a simple factthat any distribution which is uniform on a 2 k -element subset of the universe and assigns zero probabilityelsewhere (called flat k-source in pseudorandomness literature) has min-entropy k . Interestingly, everydistribution with min-entropy at least k is a convex combination of such distributions (see e.g. Lemma 6.10in [26], first proved in [10]), which makes the following definition equivalent. Definition 15 (Strong dispersers, alternative definition) . For k ∈ N , ε ∈ R + , a ( k , ε ) -strong disperser is afunction Disp : [ N ] × [ D ] → [ M ] such that for any subset S ⊆ [ N ] of size | S | ≥ k wehave |{ ( Disp ( s , d ) , d ) : s ∈ S , d ∈ [ D ] }| ≥ ( − ε ) · M · D . We use efficient explicit strong dispersers constructed by Meka, Reingold and Zhou [22].
Theorem 16 (Theorem 6 in [22]) . For all N = n , k ∈ N , and ε ∈ R + , there exists an explicit ( k , ε ) -strongdisperser Disp : [ N ] × [ D ] → [ M ] with D = O ( log n ) = polylog N and M = k − n − O ( ) = k · Ω ( / log N ) . Designing the algorithm.
We begin with applying Lemma 5 in order to be able to restrict our attentionto task sets (rather than multisets), at the expense of increasing the number of tasks from t to wt . Forconvenience, we round up the new number of tasks to the closest power of two N = ⌈ log wt ⌉ .Our explicit algorithm E has the same structure as the randomized algorithm A , i.e. it is the compositionof log w partial assignment algorithms E = E ◦ E ◦ · · · ◦ E log w . Each E i is responsible for bringing down the number of unassigned workers to the next power of two, andis composed of a number of explicit sub-algorithms E i , j ’s. Contrary to A i , j ’s, sub-algorithms E i , j ’s are notidentical copies for a fixed i . However, the chain of distinct sub-algorithms has to be copied O ( log N ) times.We reflect this introducing the b E i notation: E i = b E i ◦ b E i ◦ · · · ◦ b E i | {z } O ( log N ) times , where b E i = E i , ◦ E i , ◦ · · · ◦ E i , polylog N . The key difference between the randomized and explicit algorithm is that E i , j ’s, instead of using randomhash functions h , h , use explicit functions obtained from strong dispersers. Another notable difference isthat A i , j ’s use k bins to deal with input sets of size in [ k , . k ] , while E i , j ’s have to use polylogarithmicallyless bins, limiting the number of worker-task pairs that can be assigned by a single sub-algorithm and, as aconsequence, forcing us to compose a larger number of sub-algorithms.Let us fix i ∈ [ log w ] , and denote k i = ⌈ log w ⌉ − i . Let Disp i : [ N ] × [ D i ] → [ M i ] be the ( k i , / ) -strongdisperser given by Theorem 16. Recall that D i = polylog N , M i = k i · Ω ( / log N ) , and N is large enoughso that all workers and all tasks are elements of [ N ] . We will have b E i = E i , ◦ E i , ◦ · · · ◦ E i , D i . For each j ∈ [ D i ] , sub-algorithm E i , j assigns workers and tasks to M i bins. Each worker ω ∈ W is assigned to bin Disp i ( ω , j ) , and each task τ ∈ T is assigned to bin Disp i ( ω , j ) . Then, like in the randomized strategy, foreach active bin (i.e. one which was assigned nonempty sets of workers and tasks) the smallest worker andthe smallest task in that bin get assigned to each other.14 nalyzing switching cost. In Section 3.2, where we analyze the switching cost of randomized multi-roundballs-to-bins algorithm, we do not exploit the fact that the hash functions h , h are random. Actually, aswe already remark, our switching cost bound is deterministic and thus works for any choice of functions h , h . Therefore the same analysis works for the explicit algorithm. Namely, each sub-algorithm E i , j is O ( ) -switching cost bounded and composition-friendly (Lemmas 11 and 12 generalize trivially), thus theswitching cost of E depends only on the number of sub-algorithms, which is polylog N = polylog wt , asdesired. Proving the algorithm is fully-assigning.
We begin by analyzing the number of worker/task assignmentsmade by b E i = E i , ◦ · · · ◦ E i , D i . Lemma 17.
Let ( W , T ) be a worker/task input satisfying | W | = | T | ≥ k i . Then b E i ( W , T ) makes at least M i / Proof.
By the definition of dispersers, the two images { ( Disp i ( ω , j ) , j ) : ω ∈ W , j ∈ [ D i ] } , and { ( Disp i ( τ , j ) , j ) : τ ∈ T , j ∈ [ D i ] } have size at least ( / ) · M i · D i . Since they are both subsets of [ M i ] × [ D i ] , their intersection has size at least ( / ) · M i · D i . By the pigeonhole principle, there must exist j ∈ D i such that | Disp i ( W , j ) ∩ Disp i ( T , j ) | ≥ M i / . (4)Let us fix such j , and look at the execution of E i , j . For each bin b ∈ Disp i ( W , j ) ∩ Disp i ( T , j ) , if b is notactive, then all workers { ω ∈ W | Disp i ( ω , j ) = b } or all tasks { τ ∈ T | Disp i ( τ , j ) = b } must have beenalready assigned by ( E i , ◦ · · · ◦ E i , j − )( W , T ) . Thus, each bin in Disp i ( W , j ) ∩ Disp i ( T , j ) either is active –and contributes one worker and one task to the assignment – or is inactive and testifies that at least one workeror at least one task is assigned by earlier sub-algorithms. Let c a denote the number of active bins, c w denotethe number of inactive bins testifying for a worker assigned by earlier sub-algorithms, and c t denote thenumber of inactive bins testifying for a task. We have c a + c w + c t ≥ M i /
2, by Inequality (4). It followsthat the number of worker/task assignments made by ( E i , ◦ · · · ◦ E i , j )( W , T ) is at least c a + max ( c w , c t ) ≥ c a + ( c w + c t ) ≥ M i /
4, as desired.Recall that M i = k i · Ω ( / log N ) . Thus, Lemma 17 implies that each E i – which is a composition of O ( log N ) copies of b E i – when given a worker/task input of size at most 2 · k i returns a worker/task outputof size at most 2 k i . It follows that E = E ◦ E ◦ · · · ◦ E log w is fully-assigning, which concludes the proof ofTheorem 2. Define s w , t to be the optimal switching cost for assignment functions that assign workers 1 , , . . . , w to mul-tisets of w tasks from the universe [ t ] . The upper bounds in this paper establish that s w , t ≤ O ( log w log ( wt )) .It is natural to wonder whether smaller bounds can be achieved, and in particular, whether a small switchingcost that depends only on w can be achieved.It trivially holds that s w , t ≤ w . We show that when t is sufficiently large relative to w , there is a matchinglower bound of s w , t ≥ w . Theorem 3.
Forevery w and t ≥ tow ( Ω ( w )) ,every worker-task assignment function has switching cost w .15 roof. Given any worker-task assignment function f , we can actually find high switching cost between apair of task subsets, in which all demands are 0 or 1. For each T ⊆ [ t ] of w tasks, f produces a bijection ofworkers [ w ] to tasks T . In order to lower-bound the switching cost, we produce a coloring of the complete w -uniform hypergraph with t vertices. The coloring will be designed so that, if it contains a monochromaticclique on w + f must have worst-possible switching cost w . Byapplying the hypergraph Ramsey theorem, we deduce that, if t is large enough, then the coloring mustcontain a monochromatic ( w + ) -clique, completing the lower bound. Coloring the complete w -uniform hypergraph on t vertices. Let K ( w ) t denote the complete w -uniformhypergraph on t vertices. Note that the hyperedges of K ( w ) t are just the w -element subsets of [ t ] , whichcorrespond to sets of tasks.For a task set T = { τ , . . . , τ w } , where 1 ≤ τ < · · · < τ w ≤ t , we color the hyperedge T with the tuple π = h π ( ) , π ( ) , . . . , π ( w ) i , where τ π ( i ) is the task assigned to worker i . One can think of π as a permutationof numbers { , , . . . , w } , and thus the coloring consists of at most w ! colors. Monochromatic ( w + ) -cliques imply high switching cost. The key property of the coloring C is that, if K ( w ) t contains a monochromatic ( w + ) -vertex clique (i.e., K ( w ) w + ), then f must have switching cost w .Namely, if K ( w ) t contains a monochromatic ( w + ) -clique, then we can find w + τ < τ < · · · < τ w + , such that every w -element subset T of these tasks is assigned the same permutation π as its color.In particular, this means that for the task-set T = { τ , . . . , τ w } each worker i is assigned to task τ π ( i ) , but forthe task-set T = { τ , . . . , τ w + } that same worker i is assigned to a different task τ π ( i )+ . Thus there is a pairof adjacent task sets T , T that exhibit switching cost w . Finding a monochromatic clique.
In order to complete the lower bound, we wish to show that, if t issufficiently large, then the coloring contains a monochromatic K ( w ) w + . To do this, we employ the hypergraphRamsey theorem. Theorem 18 (Theorem 1 in [12]) . Let k ≥ N ≥ n ≥ R ( k , n , N ) isdefinedtobetheleastpositiveinteger M suchthatforevery k -coloringofthehyperedgesof K ( n ) M , the complete n -uniform hypergraph on M vertices, contains a monochromatic copy of K ( n ) M . Thisquantity satisfies R ( k , n , N ) ≤ k ( k n − ) ( kn − ) ··· ( k ) k ( N − n )+ . Applying Theorem 18, we see that if t ≥ R ( w ! , w , w + ) , then the ( w ! ) -coloring of K ( w ) t contains amonochromatic ( w + ) -clique, and the assignment function f must have switching cost w , as desired. ByTheorem 18, R ( w ! , w , w + ) ≤ tow ( O ( w )) . which implies that that every worker-task assignment functionhas switching cost w when t ≥ tow ( Ω ( w )) . This completes the proof of Theorem 3.Another way of viewing this argument is that a worker-task assignment function with switching costless than w gives rise to a proper ( w ! ) -coloring of a certain graph, with vertex set (cid:0) [ t ] w (cid:1) and edges of theform ( { τ , . . . , τ w } , { τ , . . . , τ w + } ) for τ < τ < · · · < τ w + . Such graphs are studied under the name of shift-graphs , see e.g., [14, Section 3.4], where the definition and proofs of basic properties are attributedto [11]. In particular, the chromatic number of shift-graphs is known to be ( + o ( )) · log ( w − ) t (with thesuperscript denoting iteration). This gives an alternative way to complete the proof of Theorem 3 and itgives the same asymptotic bound on t in terms of w . While the chromatic number lower bound suffices toprove the switching cost bound, the nearly matching upper bound (on chromatic number) suggests that anentirely different technique would be needed in order to asymptotically improve the switching cost bound.16 Densification into Hamming Space
In this section, we apply our results on worker-task assignment to the problem of densification. In particular,we show how to embed sparse high-dimensional binary vectors into dense low-dimensional Hamming space.Let H kn denote the set of n -dimensional binary vectors with k ones. Let H k ( n ) denote the set of k -dimensional vectors with entries from [ n ] . We show that H kn can be embedded into H k ( n ) with distortion O ( log n log k ) . Theorem 4.
There exists amap φ : H kn → H k ( n ) such that, forevery ~ x ,~ y ∈ H kn ,Ham ( ~ x ,~ y ) / ≤ Ham ( φ ( ~ x ) , φ ( ~ y )) ≤ O ( log n log k ) Ham ( ~ x ,~ y ) . Proof.
Using Theorem 1, let ψ be a worker-task assignment function mapping workers 1 , , . . . , k to a taskset T ⊆ [ n ] with switching-cost O ( log n log k ) .For ~ x ∈ H kn , define T ( ~ x ) = { i | ~ x i = } to be the task set consisting of the positions in ~ x that are 1. Define φ ( ~ x ) to be the k -dimensional vector whose i -th coordinate denotes the task t ∈ T ( ~ x ) to which ψ ( T ( ~ x )) assigns worker i . For example, if k = ~ x = h , , , , , i , and ψ ( T ( ~ x )) assigns workers 1 , , , ,
5, respectively, then φ ( ~ x ) = h , , i .Since the coordinates of φ ( ~ x ) are a permutation of the positions T ( ~ x ) in which ~ x is non-zero, it is neces-sarily the case that Ham ( φ ( ~ x ) , φ ( ~ y )) ≥ | T ( ~ x ) \ T ( ~ y ) | ≥ Ham ( ~ x ,~ y ) / . On the other hand, since ψ has switching cost O ( log n log k ) , it is also the case that ψ ( ~ x ) and ψ ( ~ y ) differ byat most O ( log n log k ) Ham ( ~ x ,~ y ) assignments, meaning that,Ham ( φ ( ~ x ) , φ ( ~ y )) ≤ O ( log n log k ) Ham ( ~ x ,~ y ) . This completes the proof of the theorem.We remark that Theorem 4 can be generalized to allow for the the domain space H kn to have non-binaryentries. In particular, if L kn is the set of vectors with non-negative integer entries that sum to k , then there isan embedding φ : L kn → H k ( n ) such that, for x , y ∈ L kn , ℓ ( ~ x ,~ y ) / ≤ Ham ( φ ( ~ x ) , φ ( ~ y )) ≤ O ( log n log k ) ℓ ( ~ x ,~ y ) . This follows from the same argument as Theorem 4, except that now T ( x ) is the multiset for which eachelement i ∈ [ n ] has multiplicity ~ x i , and now ψ is the worker-task assignment mapping workers 1 , , . . . , k toa task multiset T ⊆ [ n ] . We leave open the question of closing the gap between upper and lower bounds for the worker-task assign-ment problem: the upper bound is polylog ( wt ) and the lower bound is log ∗ ( t ) .One interesting parameter regime is when w and t are comparable in size (say within a polynomial factorof each other). In this regime, no super-constant lower bound is known.Another interesting direction is the problem of densification into Hamming space. Our upper bound forthe worker-task assignment problem implies an upper bound for this problem, but our lower bound does notcarry over. We leave open the problem of whether there is a better upper bound or a super-constant lowerbound for this problem. 17 eferences [1] Alexandr Andoni, Moses S Charikar, Ofer Neiman, and Huy L Nguyen. Near linear lower boundfor dimension reduction in ℓ . In , pages 315–323. IEEE, 2011.[2] Nikhil Bansal, Niv Buchbinder, Aleksander Madry, and Joseph Naor. A polylogarithmic-competitivealgorithm for the k -server problem. In , pages 267–276. IEEE, 2011.[3] Radu Berinde, Anna C Gilbert, Piotr Indyk, Howard Karloff, and Martin J Strauss. Combining geom-etry and combinatorics: A unified approach to sparse signal recovery. In , pages 798–805. IEEE, 2008.[4] Jean Bourgain. On Lipschitz embedding of finite metric spaces in Hilbert space. Israel Journal ofMathematics , 52(1-2):46–52, 1985.[5] Bo Brinkman and Moses Charikar. On the impossibility of dimension reduction in ℓ . Journal of theACM (JACM) , 52(5):766–788, 2005.[6] Diptarka Chakraborty, Elazar Goldenberg, and Michal Kouck`y. Streaming algorithms for embeddingand computing edit distance in the low distance regime. In
Proceedings of the forty-eighth annualACM symposium on Theory of Computing , pages 712–725, 2016.[7] Moses Charikar, Ofir Geri, Michael P Kim, and William Kuszmaul. On estimating edit distance:Alignment, dimension reduction, and embeddings. In
ICALP , 2018.[8] Moses Charikar and Robert Krauthgamer. Embedding the Ulam metric into ℓ . Theory of Computing ,2(1):207–224, 2006.[9] Moses Charikar and Amit Sahai. Dimension reduction in the ℓ norm. In The 43rd Annual IEEESymposium on Foundations of Computer Science, 2002. Proceedings. , pages 551–560. IEEE, 2002.[10] Benny Chor and Oded Goldreich. Unbiased bits from sources of weak randomness and probabilisticcommunication complexity.
SIAM J. Comput. , 17(2):230–261, 1988. doi:10.1137/0217015 .[11] P Erd˝os and A Hajnal. On chromatic number of infinite graphs. In
Theory of Graphs (Proc. Colloq.,Tihany, 1966) , pages 83–98. Academic Press, 1968.[12] Paul Erd˝os and Richard Rado. Combinatorial theorems on classifications of subsets of a given set.
Proceedings of the London mathematical Society , 3(1):417–439, 1952.[13] Jittat Fakcharoenphol, Satish Rao, and Kunal Talwar. A tight bound on approximating arbitrary metricsby tree metrics.
Journal of Computer and System Sciences , 69(3):485–497, 2004.[14] Stefan Felsner.
Interval orders: combinatorial structure and algorithms . PhD thesis, TechnischeUniversit¨at Berlin, 1992. URL: http://page.math.tu-berlin.de/˜felsner/Paper/diss.pdf .[15] A. C. Gilbert, M. J. Strauss, J. A. Tropp, and R. Vershynin. Algorithmic linear dimension reduction inthe ℓ norm for sparse vectors. In Allerton 2006 (44th Annual Allerton Conference on Communication,Control, and Computing , 2006.[16] Anna Gilbert and Piotr Indyk. Sparse recovery using sparse matrices.
Proceedings of the IEEE ,98(6):937–947, 2010. 1817] Piotr Indyk. Explicit constructions for compressed sensing of sparse signals. In
SODA , volume 8,pages 30–33, 2008.[18] William B Johnson and Joram Lindenstrauss. Extensions of Lipschitz mappings into a Hilbert space.
Contemporary mathematics , 26(189-206):1, 1984.[19] Nathan Linial, Eran London, and Yuri Rabinovich. The geometry of graphs and some of its algorithmicapplications.
Combinatorica , 15(2):215–245, 1995.[20] Jiˇr´ı Matouˇsek. On variants of the Johnson–Lindenstrauss lemma.
Random Structures & Algorithms ,33(2):142–156, 2008.[21] Colin McDiarmid. On the method of bounded differences.
Surveys in combinatorics , 141(1):148–188,1989.[22] Raghu Meka, Omer Reingold, and Yuan Zhou. Deterministic Coupon Collection and Better StrongDispersers. In
Approximation, Randomization, and Combinatorial Optimization. Algorithms and Tech-niques (APPROX/RANDOM 2014) , volume 28 of
Leibniz International Proceedings in Informatics(LIPIcs) , pages 872–884, 2014. doi:10.4230/LIPIcs.APPROX-RANDOM.2014.872 .[23] Rafail Ostrovsky and Yuval Rabani. Low distortion embeddings for edit distance.
Journal of the ACM(JACM) , 54(5):23–es, 2007.[24] Hsin-Hao Su, Lili Su, Anna Dornhaus, and Nancy Lynch. Ant-inspired dynamic task allocation viagossiping. In
International Symposium on Stabilization, Safety, and Security of Distributed Systems ,pages 157–171. Springer, 2017.[25] Hsin-Hao Su and Nicole Wein. Lower Bounds for Dynamic Distributed Task Allocation. In , vol-ume 168 of
Leibniz International Proceedings in Informatics (LIPIcs) , pages 99:1–99:14, 2020. doi:10.4230/LIPIcs.ICALP.2020.99 .[26] Salil P. Vadhan. Pseudorandomness.
Foundations and Trends R (cid:13) in Theoretical Computer Science , 7(1–3):1–336, 2012. URL: https://people.seas.harvard.edu/˜salil/pseudorandomness/pseudorandomness-published-Dec12.pdf , doi:10.1561/0400000010doi:10.1561/0400000010