04.09.2013 Views

Algorithm Design

Algorithm Design

Algorithm Design

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

514<br />

Chapter 8 NP and Computational Intractability<br />

effect is that the committee presents an affirmative decision on the issue<br />

if the number of "Yes" votes is strictly greater than the nurnber of "No"<br />

votes (the "Abstain" votes don’t count for either side), and it delivers a<br />

negative decision otherwise.<br />

Now we have a big table consisting of the vote cast by each committee<br />

member on each issue, and we’d !ike to consider the following definition.<br />

We say that a subset of the member~ M’ c__ M is decisive if, had we looked<br />

19.<br />

just atlthe votes cast by the members in M’, the committee’s decision<br />

on every issue would have been the same, (In other words, the overall<br />

outcome of the voting among the members in M’ is the same on every<br />

issue as the overall outcome of the v0ting]~ the entire committee.) Such<br />

a subset canbe viewed as a kin d of "inner circle" that reflects the behavior<br />

of the committee as a whole. ~<br />

Here’s the question: Given the votes cast by each member on each<br />

issue, and given a parameter k, we want to know whether there is a decisive<br />

subset consisting of at most k members. We’ll call this an instance<br />

of the Decisive Subset Problem.<br />

Example. Suppose we have four committee members and three issues.<br />

We’re looking for a decisive set of size at most k = 2, and the voting went<br />

as follows.<br />

Issue # rnt /’/12 rrt3 /rt4<br />

Issue 1 Yes Yes Abstain No<br />

Issue 2 Abstain No No Abstain<br />

Issue 3 Yes Abstain Yes Yes<br />

Then the answer to this instance is "Yes," since members ml and m3<br />

constitute a decisive subset.<br />

Prove that Decisive Subset is NP-complete.<br />

Suppose you’re acting as a consultant for the port authority of a small<br />

Pacific Rim nation. They’re currently doing a multi-billion-dollar business<br />

per year, and their revenue is constrained almost entirely by the rate at<br />

which they can unload ships that arrive in the port.<br />

Handling hazardous materials adds additional complexity to what is,<br />

for them, an already complicated task. Suppose a convoy of ships arrives<br />

in the morning and delivers a total of n cannisters, each containing a<br />

different kind of hazardous material. Standing on the dock is a set of m<br />

trucks, each of which can hold up to k containers.<br />

20.<br />

Exercises<br />

Here are two related problems, which arise from different types of<br />

constraints that might be placed on the handling of hazardous materials.<br />

For each of the two problems, give one of the following two answers:<br />

* A polynomial-time algorithm to solve it; or ....<br />

proof that it is NP-complete.<br />

(a) For each cannister, there is a specified subset of the trucks in ;~hich<br />

it may be safely carried. Is there a way to load all n carmisters -into<br />

the m trucks so that no h-uck is overloaded, and each container goes<br />

in a truck that is allowed to carry it?<br />

In this different Version.of the problem, any cannister can be placed<br />

in any, truck; however, there ~e certain pairs of cannisters that<br />

cannot be placed together in the same truck. (The chemicals they<br />

contain may react e.xplosively if brought into contact.) Is there a<br />

way to load all n cannisters into the m trucks so that no truck is<br />

overloaded, and no two carmisters are placed in the same truck when<br />

they are not supposed to be?<br />

There are many different ways to formalize the intuitive problem of<br />

clustering, where the goal is to divide up a collection of objects into<br />

groups that are "similar" to one another.<br />

First, a natural way to express the input to a clustering problem is via<br />

a set of objects Pl, P2 ..... Pn, with a numerical distance d(p~, PJ) defined on<br />

each pair. (We reqt~e only that d(p~., p~) = 0; that d(p~, Pi) > 0 for distinct<br />

p~ and PJ; and that distances are symmetric: d(p~, PJ) = d(PJ, P~).)<br />

In Section 4.7, earlier in the book, we considered one reasonable<br />

formulation of the clustering problem: Divide the objects into k sets so<br />

as to maximize the minimum distance between any pair of objects in<br />

distinct dusters. This turns out to be solvable by a nice application of<br />

the MinLmum Spanning Tree Problem.<br />

A different but seemingly related way to formalize the clustering<br />

problem would be as follows: Divide the objects into k sets so as to<br />

minimize the maximum distance between any pair of objects in the<br />

same cluster. Note the change. Where the formulation in the previous<br />

paragraph sought clusters so that no two were "close together," this new<br />

formulation seeks clusters so that none of them is too "wide"--that is,<br />

no cluster contains two points at a large distance from each other.<br />

Given the similarities, it’s perhaps surprising that this new formulation<br />

is computationally hard to solve optimally. To be able to think about<br />

this in terms of NP-completeness, let’s write it first as a yes/no decision<br />

problem. Given n objects p~, P2 ..... Pn with distances on them as above,<br />

515

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

Saved successfully!

Ooh no, something went wrong!