I hava a problem which is described below. Do you have any good solution or this problem is just another form of any “classics” or “have been solved” problem?
The problem is :
There are some group of numbers,e.g.
A(1 8 9)
B(1 4 5)
C(2 4 6)
D(3 4 7)
E(2 10 11)
F(3 12 13)
There are “A-F” six group. we have numbers “1,2,3,4,5,6,7,8,9,10,11,12,13”.
Now find the minimum amount of number set which satisfies each group must have a number in this set at least. For examlpe, we can find the set “1 4 2 13 12” that A has “1”,B has “1,4”,C has “2,4”,D has “4” ,E has “2”,F has “12,13” .
But set “1 2 4” is not that we find ,F does not has any number in the set.
The best set is “1,2,3”,every gruop has a number in the set,and the size of the set is optimal. It has only three numbers. THIS is What we want. If there are many best sets,finding any one is OK. Thanks.
This is equivalent to the set cover problem. In this case, each of your sets A, B, …, F are the elements of the set cover problem, and each of the numbers 1, 2, …, 13 are the sets. For example, in this mapping 1 becomes {A, B}, and 11 becomes the set {E}.
Set cover is NP-hard. The integer linear programming formulation on the linked Wikipedia page is probably as good as you’ll get for exact solutions; the greedy algorithm there is a decent approximation for large problems.