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.

612<br />

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

have S’ # 0 after selecting k centers, as it would have s ~ S’, and so it would<br />

go on and select more than k centers and eventually conclude that k centers<br />

cannot have covering radius at most r. This contradicts our choide of r, and<br />

the contradiction proves that r(C) _ O. The goal is to find a set cover e so that the total<br />

weight<br />

is minimized. Note that this problem is at least as hard as the decision version<br />

of Set Cover we encountered earlier; if we set al! wi = 1, then the minimum<br />

11.3 Set Cover: A General Greedy Heuristic<br />

weight of a set cover is at most k if and only if there is a collection of at most<br />

k sets that covers U.<br />

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

We will develop and analyze a greedy algorithm for this problem. The algorithm<br />

will have the property that it builds the cover one set at a time; to choose<br />

its next set, it looks for one that seems to make the most progress toward the<br />

goal. What is a natural way to define "progress" in this setting? Desirable<br />

sets have two properties: They have small weight wi, and they cover lots of<br />

elements. Neither of these properties alone, however, would be enough for<br />

designing a good approximation algorithm. Instead, it is natural to combine<br />

these two criteria into the single measure wi/ISil--that is, by selecting Si, we<br />

cover tSit elements at a cost of w i, and so this ratio gives the ,COSt per element<br />

covered," a very reasonable thing to use as a guide.<br />

Of course, once some sets have already been selected, we are only concerned<br />

with how we are doing on the elements still 1eft uncovered. So we will<br />

maintain the set R of remaining uncovered elements and choose the set Si that<br />

minimizes wi/[S i ~ RI.<br />

Greedy-Set-Cover:<br />

Start with R= U and no sets selected<br />

While R # 0 -<br />

Select set S i that minimizes u~i/[S ~ N<br />

Delete set S~ from R<br />

EndWhile<br />

Return the selected sets<br />

As an example of the behavior of this algorithm, consider what it would do<br />

on the instance in Figure 11.6. It would first choose the set containing the four<br />

nodes at the bottom (since this has the best weight-to-coverage ratio, !/4). It<br />

then chooses the set containing the two nodes in the second row, and finally<br />

it chooses the sets containing the two individual nodes at the top. It thereby<br />

chooses a collection of sets of total weight 4. Because it myopically chooses<br />

the best option each time, this algorithm misses the fact that there’s a way to<br />

cover everything using a weight of just 2 + 2~, by selectit~g the two sets that<br />

each cover a fi~ column.<br />

~4~ Analyzing the <strong>Algorithm</strong><br />

The sets selected by the algorithm clearly form a set cover. The question we<br />

want to address is: How much larger is the weight of this set cover than the<br />

weight ~v* of an optimal set cover?<br />

613

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

Saved successfully!

Ooh no, something went wrong!