All Classes Namespaces Files Functions Variables Typedefs Enumerations Friends Macros Pages
maximum_coverage.hpp
Go to the documentation of this file.
1 
8 #ifndef PAAL_MAXIMUM_COVERAGE_HPP
9 #define PAAL_MAXIMUM_COVERAGE_HPP
10 
12 #include "paal/utils/functors.hpp"
13 
14 namespace paal{
15 namespace greedy{
36 template<typename SetRange, class GetElementsOfSet, class OutputIterator,class GetElementIndex,
37  class GetWeightOfElement=paal::utils::return_one_functor>
39  SetRange && sets,
40  GetElementsOfSet set_to_elements,
41  OutputIterator result,
42  GetElementIndex get_el_index,
43  unsigned int number_of_sets_to_select,
44  GetWeightOfElement get_weight_of_element = GetWeightOfElement{}
45  ) {
46  auto set_to_cost = paal::utils::return_one_functor{};
48  sets,
49  set_to_cost,
50  set_to_elements,
51  result,
52  get_el_index,
53  number_of_sets_to_select,
54  get_weight_of_element,
55  0
56  );
57 };
58 }
59 }
60 
61 #endif /* PAAL_MAXIMUM_COVERAGE_HPP */
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 maximum_coverage(SetRange &&sets, GetElementsOfSet set_to_elements, OutputIterator result, GetElementIndex get_el_index, unsigned int number_of_sets_to_select, GetWeightOfElement get_weight_of_element=GetWeightOfElement{})
this is solve Set Cover problem and return set cover cost example:
This file contains set of simple useful functors or functor adapters.