# sol8 - Introduction to Algorithms CS 482, Spring 2008...

This preview shows pages 1–2. Sign up to view the full content.

Introduction to Algorithms Solution Set 8 CS 482, Spring 2008 (1) The algorithm resembles the Greedy-Balance algorithm given in Section 11.1. For each machine M i , we maintain a variable T i which keeps tracks of the total amount of time required for M i to process all of the jobs that have been assigned to it by the algorithm so far. Initially all jobs are unassigned, and T i = 0 for all i . We run through the jobs in arbitrary order. Each job is assigned to the machine M i with the minimum current load, M i = arg min j ( T j ) . The load on M i is then updated to reﬂect the new job that has been assigned to it; thus we increase T i by either t i or 1 2 t i depending on whether M i is a slow machine or a fast machine. The main loop of the algorithm has n iterations. In a na¨ ıve implementation, each loop iteration requires O ( m + k ) work to ﬁnd the machine with the minimum current load, and O (1) work to update the load on that machine, for a total running time of O ( n ( m + k )) . Using a heap to store the values T i , one can reduce the running time to

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

## This note was uploaded on 10/02/2008 for the course CS 482 taught by Professor Kleinberg during the Spring '08 term at Cornell University (Engineering School).

### Page1 / 2

sol8 - Introduction to Algorithms CS 482, Spring 2008...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online