3 #include "../SetCover.h"
4 #include "../TypedSetCover.h"
12 Bitset
greedy(SetCover& sc);
24 Bitset
greedy_weighted(SetCover& sc,
const std::vector<double>& weights, std::size_t bound = 0);
30 template<
typename T,
typename F>
32 std::vector<double> weights;
33 for (std::size_t sid = 0; sid < tsc.
set_cover().set_count(); ++sid) {
34 weights.emplace_back(weight(tsc.
get_set(sid)));
Bitset greedy(SetCover &sc)
Simple greedy heuristic: Selects the largest remaining set until all elements are covered.
Bitset greedy_weighted(SetCover &sc, const std::vector< double > &weights, std::size_t bound)
Weighted greedy heuristic: Selects the largest remaining set according to the given weight function u...
Bitset greedy_bounded(SetCover &sc, std::size_t bound)
Bounded greedy heuristic: Selects the largest remaining set until at most bound constraints remain.
Represents a set cover problem where a set is represented by some type.
const Set & get_set(std::size_t sid) const
const auto & set_cover() const
Returns the underlying set cover.