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.

494<br />

Chapter 8 NP and ComputatiOnal Intractability<br />

We now further constrain the instance so that the only way to solve it will<br />

be to group together a subset of the jobs whose durations add up precisely to<br />

W. To do this, we define an (n + 1) st job; it has a release time of W, a deadline<br />

of W + 1, and a duration of 1.<br />

Now consider any feasible solution to this instance of the scheduling<br />

problem. The (n + 1) st job must be run in the interval [W, W + 1]. This leaves<br />

S available time units between the common release time and the common<br />

deadline; and there are S time units worth of jobs to run. Thus the machine<br />

must not have any idle time, when no jobs are running. In particular, if jobs<br />

ik are the ones that run before time W, then the corresponding numbers<br />

wig in the Subset Sum instance add up to exactly W.<br />

Conversely, if there are numbers wil ..... wig that add up to exactly W,<br />

then we can schedule these before job n + I and the remainder after job n + !;<br />

this is a feasible solution to the schednling instance. TM<br />

Caveat: Subset Sum with Polynomially Bounded Numbers<br />

There is a very common source of pitfalls involving the Subset Sum Problem,<br />

and while it is closely connected to the issues we have been discussing already,<br />

we feel it is worth discussing explicitly¯ The pitfall is the following..<br />

Consider the special case of Subset Sum, with n input numbers, in which W<br />

is bounded by a polynomial ~nction o[ n. Assuming ~P ~ ~N~P, this special<br />

case is not NP-comptete.<br />

It is not NP-complete for the simple reason that it can be solved in time O(nW),<br />

by our dynamic programming algorithm from Section 6.4; when W is bounded<br />

by a polynomial function of n, this is a polynomial-time algorithm.<br />

All this is very clear; so you may ask: Why dwell on its. The reason is that<br />

there is a genre of problem that is often wrongly claimed to be NP-complete<br />

(even in published papers) via reduction from this special case of Stibset Sum.<br />

Here is a basic example of such a problem, which we will call Component<br />

Grouping.<br />

Given a graph G that is not connected, and a number k, does there exist a<br />

subset o[ its connected components whose union has size exactly k?<br />

Incorrect Claim. Component Grouping is NP-complete.<br />

Incorrect Proof. Component Grouping is in ~q~Y, and we’ll skip the proof<br />

of this. We now attempt to show that Subset Sum

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

Saved successfully!

Ooh no, something went wrong!