10 std::vector<Bitset> columns;
11 for (std::size_t i = 0; i < sc.
set_count(); ++i) {
12 const auto& set = sc.
get_set(i);
13 while (columns.size() < set.size()) {
14 columns.emplace_back();
16 for (std::size_t elem: set) {
20 std::sort(columns.begin(), columns.end());
21 columns.erase(std::unique(columns.begin(), columns.end()), columns.end());
23 for (std::size_t i = 0; i < columns.size(); ++i) {
24 for (std::size_t s: columns[i]) {
Bitset remove_duplicates(SetCover &sc)
Preprocessing heuristic: Compresses the matrix by removing duplicate columns.
This class is a simple wrapper around boost::dynamic_bitset.
Represents a set cover problem.
const auto & get_set(std::size_t set) const
Returns the given set.
std::size_t set_count() const
Returns the number of sets.
void set(std::size_t set, std::size_t element)
States that s covers the given element.