Doubts related to set cover NP complete problem

90 Views Asked by At

I am trying to show that a problem is ${\sf NP}$-complete by reducing Set Cover to it.

I have three sets, say

  • $A = \{1, 3\}$,
  • $B = \{1\}$ and
  • $C = \{1, 2\}$.

In my problem, I need to find the smallest set such that it has at least one element common with all the other sets. So in my case the solution could be either $A$, $B$ or $C$.

If I go to the original definition of Set Cover, it would be $\{A,B,C\}$ itself.

Since my problem doesn't need to have everything, an intersection is enough to cover. Am I allowed to do this?

1

There are 1 best solutions below

0
On

Part 1

If I understand your problem, you're given a collection of sets $\mathcal{S}=\{S_{1},\ldots, S_{n}\}$ and you want to pick $S_{i} \in \mathcal{S}$ such that $S_{i} \cap S_{j} \neq \emptyset$ for all $j\in [1,n]$ and $|S_{i}|$ is minimized.

If so, the problem is solvable in polynomial time. We can test whether each set in $\mathcal{S}$ intersects all of the others. If the maximum set size is $m$ then we can test whether two sets have a non empty intersection in $O(m\log m)$ time, so working out which set instersect all others takes at most $O(n^{2}\cdot m \log m)$ time.

Then with this subset of $\mathcal{S}$ we just take whichever is the minimal size set. We can even produce all minimal answers in polynomial time.

As this is problem is in P, you're not going to find a reduction from Set Cover (unless P=NP, and then you've just made $1 million).

Part 2

If I didn't get the problem right, could you restate it a little more clearly: tell us what the input is, and what the question is (i.e. what a solution should look like).