{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

cse373 Intro To Algorithm

cse373 Intro To Algorithm - CSE 373 Spring 2010 HW#4 Chao...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
CSE 373 Spring 2010 HW #4 Chao Xu(106978083) The Algorithm The idea A set is either in the minimum set cover(MSC) or not in the MSC. So we do backtrack on choosing a set or not to chose a set. Naively, this can run O (2 n ) time. Instead of create a global list of sets and universe and all backtrack step pick the next item according to the list. We do it by branch it into two sub problems, where each have its own list of remaining sets and remaining universe. The backtrack step 1. Prune by upper bound 2. Accept if it’s a solution 3. If there is essential set, go to 6. 4. Prune by fast look forward 5. Remove all sets such it’s a subset of some other set. 6. Chose the next set 7. Branch and backtrack Pruning by Upper Bound Let there be a upper bound( UB ) for the MSC size. There is no reason to search beyond if we already chose k sets, where k = UB . In fact, we only search up to k = UB - 1. We only have to search to UB - 2 and run a faster routine at k = UB - 2 (check if any of the remaining set cover the remaining universe) to speed it up by a constant. The common greedy algorithm to approximate the MSC size is always the first set cover this algorithm find. UB get set every time we find a smaller set cover. Pruning by fast look forward Suppose we have chosen some sets and discarded some sets. If the union of the remaining sets don’t cover the remaining universe. Prune. This is done by not try Branch 0 if there exist a essential set. Suppose we have chosen k sets, then we only have UB - k - 1 sets to chose before we do something no better than the current best. If the sum of the size of the largest UB - k - 1 remaining sets is smaller than the size of the remaining universe. Prune. Choosing the next set If a set is essential, that is, it is the only set covering some element, chose that set.
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}