2

Given a universe of elements U={e_1....e_n}, I have a collection of subsets of these elements C={s_1...s_m}. Now given a positive integer k, I want to find a solution of k elements which cover a maximal number of subsets.

A concrete example: I have a collection of songs. each song is composed of notes. if i only know how to play k distinct notes - which k notes would allow me to play the maximal number of songs, and what is this maximal number?

How is this problem called?

o17t H1H' S'k
  • 2,541
  • 5
  • 31
  • 52
  • 1
    Are you looking for the name of the problem only or for an algorithm too? – Damien Jun 07 '19 at 12:17
  • 1
    same as this: https://math.stackexchange.com/questions/2251418/maximize-number-of-covered-sets-by-choosing-given-number-of-elements – o17t H1H' S'k Jun 07 '19 at 13:00
  • 1
    Interesting. Note that *try every possibility* in general means dynamic programming (backtracking?). Here devil is in the detail. Not sure a name exists for the problem. – Damien Jun 07 '19 at 13:07
  • Are you only interested in the name of this problem or would a solution suffice? How big are your numbers? – sascha Jun 08 '19 at 19:18

1 Answers1

0

Brute force approach:

First find all distinct permutations of size k from n. Then for every permutation find ,number of subsets it cover. And remember, if you are taking one element that cover subset 's_1' for example then you have to take all elements from that subset, else greedy approach will cover only some part of subset not whole. And then pick that permutation which gives maximum answer.

But brute force approach only works when k is less than 10. As the order goes exponentially and there is no better solution than this, thus this question goes to np_hard. It can be shown that that your problem reduces to vertex cover problem.

Consider subsets as trees and elements as nodes. Now your problem is to select k elements such that it covers maximum number of trees fully.