14 #include <boost/range/irange.hpp>
18 std::vector<std::vector<int>> set_to_elements = {
19 { 1 }, { 2 }, { 0, 1 }, { 2, 3, 4 }
21 std::vector<int> set_to_cost = { 1, 1, 5, 5 };
22 std::vector<int> element_to_weight = { 3, 5, 1, 1, 1 };
23 const int BUDGET = 10;
25 std::vector<int> result;
26 auto element_index = [](
int el){
return el;};
29 [&](
int set){
return set_to_cost[set];},
30 [&](
int set){
return set_to_elements[set];},
31 back_inserter(result),
34 [&](
int el){
return element_to_weight[el];});
35 std::cout <<
"Covered: " << covered << std::endl;
int main()
[Budgeted Maximum Coverage Example]
auto budgeted_maximum_coverage(SetRange &&sets, GetCostOfSet set_to_cost, GetElementsOfSet set_to_elements, OutputIterator result, ElementIndex get_el_index, Budget budget, GetWeightOfElement element_to_weight=GetWeightOfElement(), const unsigned int initial_set_size=3)
detail
auto irange(T begin, T end)
irange