Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

(12 points) Remember the load balancing problem from HW1: In computations over m

ID: 3604051 • Letter: #

Question

(12 points) Remember the load balancing problem from HW1: In computations over multiple processors, the load of a processor is the sum of the times of all loads assigned to that processor. To balance the computation, the goal is to minimize the maximum load across the processors. The input to the load balancing problem is a list of jobs, each labelled by the time it would take to complete that job. The output of the problem is an assignment of a processor to each job. In this HW, you’ll explore the theoretical limits for balancing the load, depending on the input jobs given. Throughout, assume there are k processors P1, . . . , Pk and n jobs j1, . . . , jn where n and k are positive integers.

(a) Find a formula for the biggest theoretical value for the maximum load of a processor, as a function of the input list of jobs. Justify your formula.

(b) Is there an algorithm which will always produce an assignment of jobs to processors that exactly yields this biggest theoretical maximum load? If so, give such an algorithm and explain why it has this property. If not, explain why not. Note: such an algorithm would *not* do a good job of load balancing.

(c) Prove that the minimum maximum load across all processors must be greater than or equal to 1 k Xn i=1 ji Note: recall that this notation indicates 1 k (j1 + · · · + jn).

(d) Is there an algorithm which will always produce an assignment of jobs to processors that exactly yields this theoretical lower bound for the smallest maximum load (i.e. the formula from part (c))? If so, give such an algorithm and explain why it has this property. If not, explain why not.

Explanation / Answer

private void relax(EdgeWeightedDigraph G, int v) { for (DirectedEdge e : G.adj(v)) { int w = e.to(); if (distTo[w] > distTo[v] + e.weight()) { distTo[w] = distTo[v] + e.weight(); edgeTo[w] = e; } } } for (int pass = 0; pass