23 void set(std::size_t
set, std::size_t element);
41 std::size_t
largest_set(
const std::vector<double>& weights)
const;
49 std::ostream&
operator<<(std::ostream& os,
const SetCover& sc);
std::ostream & operator<<(std::ostream &os, const SetCover &sc)
Print the set cover to os.
This class is a simple wrapper around boost::dynamic_bitset.
Represents a set cover problem.
std::size_t active_set_count() const
Returns the number of active sets (that still cover uncovered elements).
const auto & get_set(std::size_t set) const
Returns the given set.
void select_set(std::size_t s)
Selects the given set and purges the covered elements from all other sets.
void prune_sets()
Removes empty sets.
std::vector< Bitset > mSets
The actual sets.
Bitset get_uncovered() const
Returns the uncovered elements.
std::size_t set_count() const
Returns the number of sets.
std::size_t element_count() const
Returns the number of elements.
void set(std::size_t set, std::size_t element)
States that s covers the given element.
friend std::ostream & operator<<(std::ostream &os, const SetCover &sc)
Print the set cover to os.
std::size_t largest_set() const
Returns the id of the largest set.