HiveBrain v1.2.0
Get Started
← Back to all entries
patternModerate

What are the real world applications of set cover problem?

Submitted by: @import:stackexchange-cs··
0
Viewed 0 times
realproblemthewhatareapplicationsworldcoverset

Problem

I am studying about set cover problem and wondering that which problems in real world can be solved by set cover. I found that IBM used this problem for their anti-virus problem, so there should be many more others that can be solved by set cover.

Solution

Set-cover heuristics are used in random testing ("fuzz testing") of programs. Suppose we have a million test cases, and we're going to test a program by picking a test case, randomly modifying ("mutating") it by flipping a few bits, and running the program on the modified test case to see if it crashes. We'd like to do this over and over again. If we do this naively, it will be less effective than it could be: typically many test cases cover basically the same code paths, but a small minority of test cases cover unusual code paths that would be interesting to test more intensively.

So, here's one solution that is used in industry. We use a coverage measurement tool to instrument the program and record which lines of code are covered by each of the million test cases. Then, we choose a small subset $S$ of those million test cases that has maximal coverage: every line of code covered by one of the million test cases will be covered by some test case in $S$. $S$ is called a reduced test suite. We then apply random mutation & testing to the reduced test suite $S$. Empirically, this seems to make random testing more effective. The smaller $S$ is, the more effective and efficient testing becomes.

So, how do we choose a reduced test suite $S$ that is as small as possible, while still achieving maximal coverage? Answer: that's a set cover problem, so we use standard heuristics/approximation algorithms for the set cover problem. The standard greedy approximation algorithm is typically used for this purpose.

Context

StackExchange Computer Science Q#74407, answer score: 11

Revisions (0)

No revisions yet.