13 #include <boost/range/irange.hpp>
18 std::vector<std::vector<int>> set_to_elements = {
21 { 7, 8, 9, 10, 11, 12, 13, 0 },
22 { 1, 3, 5, 7, 9, 11, 13 },
23 { 2, 4, 6, 8, 10, 12, 0 }
25 std::vector<int> costs = { 1, 1, 1, 1, 1 };
27 std::vector<int> result;
28 auto element_index = [](
int el){
return el;};
30 [&](
int set){
return costs[set];},
31 [&](
int set){
return set_to_elements[set];},
32 back_inserter(result),
34 std::cout <<
"Cost: " << cost << std::endl;
auto irange(T begin, T end)
irange
auto set_cover(SetRange &&sets, GetCostOfSet set_to_cost, GetElementsOfSet set_to_elements, OutputIterator result, GetElementIndex get_el_index)
detail
int main()
[Set Cover Example]