Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

System of nondistinct representatives efficiently solvable?

We have sets S1, S2, ..., Sn. These sets do not have to be disjoint. Our task is to select a representative member for each set, such that the total number of elements selected is as small as possible. One element may be present in more than one set, and can represent all the sets it is included in. Is there an algorithm to solve this efficiently?

like image 641
sentinel Avatar asked Mar 05 '13 08:03

sentinel


2 Answers

It is easier to answer this question after restatement: let the original sets S1, S2, ..., Sn be elements of the universe and let the original set members be sets themselves: T1, T2, ..., Tm (where Ti contains elements {Sj} which are the original sets containing corresponding member).

Now we have to cover universe S1, S2, ..., Sn with sets T1, T2, ..., Tm. Which is exactly Set cover problem. It is a well known NP-hard problem, so there is no algorithm to solve it efficiently (unless P=NP, as theorists usually say). As you can see from Wikipedia page, there is a greedy approximation algorithm; it is efficient, but approximation ratio is not very good.

like image 52
Evgeny Kluev Avatar answered Sep 28 '22 10:09

Evgeny Kluev


I'm assuming that by "efficiently," you mean in polynomial time.

Evgeny Kluev is correct, the problem is NP-hard. The decision version of it is known as the hitting set problem and was shown to be what we now call NP-complete soon after the introduction of that concept. While it's true that Evgeny's reduction is from the hitting set problem to the set cover problem, it's not hard to see an explicit inverse reduction.

Given a set C={C1,C2,...Cm} whose union is U={u1,u2,...,un}, we want to find a minimal-cardinality subset C' whose union is also equal to U. Define Si in your initial problem as {Cj in C | ui is an element of Cj}. The minimum hitting set of S={S1,S2,...,Sn} is then equal to our desired C'.

like image 33
jerry Avatar answered Sep 28 '22 10:09

jerry