In budgeted maximum coverage we are given Universe \(U\) and family \(S\) of subsets of \(U\). Each element e in \(U\). has weight w(e) We are also given number \(k\)
The goal if to find subfamily \(C\subseteq S\) that has size not greater than k and maximize weight of covered elements.
We use the following algorithm:
At each stage we add to \(C\) a set witch maximizes (weight of uncovered elements)/(cost of set).
We repeat the step as long as number of selected sets is smaller than k.
example:
complete example is max_coverage_example.cpp
IN: SetIterator sets_begin
IN: SetIterator sets_end,
IN: GetElementsOfSet set_to_elements
OUT: OutputIterator result
The Iterators of selected Sets will be output to the output iterator result
The iterator type must be a model of Output Iterator
IN: GetElementIndex get_el_index we need in algorithm map elements to small unique integers
IN: unsigned int number_of_sets_to_select
IN: GetWeightOfElement element_to_weight =GetWeightOfElement()
equals to \( 1-1/e \).
Complexity of the algorithm is \(E*log(|S|)\). where \(E\) is number of elements in all sets and \(S\) is number of sets
Memory complexity of the algorithm is \(E\). where \(E\) is number of elements in all sets
The algorithm analysis is described in Cohen:2008:GMC:1401272.1401544