04.09.2013 Views

Algorithm Design

Algorithm Design

Algorithm Design

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

600<br />

Chapter 11 Approximation <strong>Algorithm</strong>s<br />

the study of linear programming, which can also be used to motivate this approach.<br />

Our presentation of the pricing method here will not assume familiarity<br />

with linear programming. We will introduce linear programming through our<br />

third technique in this chapter, linear programming and rounding, in which<br />

one exploits the relationship between the computational feasibility of linear<br />

programming and the expressive power of its more difficult cousin, integer<br />

programming. Finally, we will describe a technique that can lead to extremely<br />

good approximations: using dynamic programming on a rounded version of<br />

the input.<br />

11.1<br />

Greedy <strong>Algorithm</strong>s and Bounds on the<br />

Optimum: A Load Balancing Problem<br />

As our first topic in this chapter, we consider a fundamental Load Balancing<br />

Problem that arises when multiple servers need to process a set of jobs or<br />

requests. We focus on a basic version of the problem in which all servers<br />

are identical, and each can be used to serve any of the requests. This simple<br />

problem is useful for illustrating some of the basic issues that one needs to<br />

deal with in designing and analyzing approximation algorithms, particularly<br />

the task of comparing an approximate solution with an optimum solution that<br />

we cannot compute efficiently. Moreover, we’ll see that the general issue of<br />

load balancing is a problem with many facets, and we’ll explore some of these<br />

in later sections.<br />

/..~ The Problem<br />

We formulate the Load Balancing Problem as follows. We are given a set of m<br />

Mrn and a set of n jobs; each job j has a processing time tj.<br />

We seek to assign each iob to one of the machines so that the loa~ls placed on<br />

al! machines are as "balanced" as possible.<br />

More concretely, in any assignment of iobs to machines, we can let A(i)<br />

denote the set of iobs assigned to machine Mi; under this assignment, machine<br />

Mi needs to work for a total time of<br />

j~A(i)<br />

and we declare this to be the load on machine Mi. We seek to minimize a<br />

quantity known as the makespan; it is simply the maximum load on any<br />

machine, T = maxi Ti. Mthough we wil! not prove this, the scheduling problem<br />

of finding an assignment of minimum makespan is NP-hard.<br />

11.1 Greedy <strong>Algorithm</strong>s and Bounds on the Optimum: A Load Balancing Problem<br />

~ <strong>Design</strong>ing the Mgorithm<br />

We first consider a very simple greedy algOrithm for the problem. The algorithm<br />

makes one pass through the jobs in any order; when it comes to jobj, it assigns<br />

j to the machine whose load is smallest so far.<br />

Greedy-Balance :<br />

Start with no jobs assigned<br />

Set T i=0 and A(0=0 for all machines Mi<br />

For j=l .....<br />

Let M i be a machine that achieves the minimum min/~ T k<br />

Assign job j to machine M<br />

Set A(i) *- A(i) U<br />

Set Ti *- Ti + t j<br />

EndFor<br />

For example, Figure 11.1 shows the result of running this greedy algorithm<br />

on a sequence of six jobs with sizes 2, 3, 4, 6, 2, 2; the resulting makespan is 8,<br />

the "height" of the jobs on the first machine. Note that this is not the optimal<br />

solution; had the jobs arrived in a different order, so that the algorithm saw<br />

the sequence of sizes 6, 4, 3, 2, 2, )., then it would have produced an allocation<br />

with a makespan of 7.<br />

~ Analyzing the Mgorithm<br />

Let T denote the makespan of the resulting assignment; we want to show that<br />

T is not much larger than the minimum possible makespan T*. Of course,<br />

in trying to do this, we immediately encounter the basic problem mentioned<br />

above: We need to compare our solution to the optimal value T*, even though<br />

we don’t know what this value is and have no hope of computing it. For the<br />

M1<br />

Figure 11.1 The result of running the greedy load balancing algorithm on three<br />

machines with job sizes 2, 3, 4, 6, 2, 2,<br />

601

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!