18.04.2013 Views

The.Algorithm.Design.Manual.Springer-Verlag.1998

The.Algorithm.Design.Manual.Springer-Verlag.1998

The.Algorithm.Design.Manual.Springer-Verlag.1998

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.

Set Cover<br />

Figure: Hitting set is dual to set cover<br />

Hitting set is, in fact, dual to set cover, meaning it is exactly the same problem in disguise.<br />

Replace each element of U by a set of the names of the subsets that contain it. Now S and U have<br />

exchanged roles, for we seek a set of subsets from U to cover all the elements of S. This is is<br />

exactly the set cover problem. Thus we can use any of the set cover codes below to solve hitting<br />

set after performing this simple translation.<br />

Since the vertex cover problem is NP-complete, the set cover problem must be at least as hard. In fact, it<br />

is somewhat harder. Approximation algorithms do no worse than twice optimal for vertex cover, but only<br />

a times optimal approximation algorithm exists for set cover.<br />

<strong>The</strong> greedy heuristic is the right approach for set cover. Begin by placing the largest subset in the set<br />

cover, and then mark all its elements as covered. We will repeatedly add the subset containing the largest<br />

number of uncovered elements, until all elements are covered. This heuristic always gives a set cover<br />

using at most times as many sets as optimal, and in practice it usually does a lot better.<br />

<strong>The</strong> simplest implementation of the greedy heuristic sweeps through the entire input instance of m<br />

subsets for each greedy step. However, by using such data structures as linked lists and a bounded-height<br />

priority queue (see Section ), the greedy heuristic can be implemented in O(S) time, where<br />

is the size of the input representation.<br />

It pays to check whether there are certain elements that exist in only a few subsets, ideally only one. If<br />

so, we should select the biggest subsets containing these elements at the very beginning. We will have to<br />

take them eventually, and they carry with them extra elements that we might have to pay to cover by<br />

waiting until later.<br />

Simulated annealing is likely to produce somewhat better set covers than these simple heuristics, if that is<br />

important for your application. Backtracking can be used to guarantee you an optimal solution, but<br />

typically it is not worth the computational expense.<br />

Implementations: Pascal implementations of an exhaustive search algorithm for set packing, as well as<br />

heuristics for set cover, appear in [SDK83]. See Section .<br />

Notes: Survey articles on set cover include [BP76]. See [CK75] for a computational study of set cover<br />

algorithms. An excellent exposition on algorithms and reduction rules for set cover is presented in<br />

[SDK83].<br />

Good expositions of the greedy heuristic for set cover include [CLR90]. An example demonstrating that<br />

the greedy heuristic for set cover can be as bad as is presented in [Joh74, PS82]. This is not a defect<br />

file:///E|/BOOK/BOOK5/NODE201.HTM (3 of 4) [19/1/2003 1:32:04]

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

Saved successfully!

Ooh no, something went wrong!