11 #include "utils/graph_typedefs.hpp"
16 template<
class Compare = std::less<
size_t> >
19 typedef std::pair<EdgeName, unsigned> value_type;
28 return entries.empty();
54 DEBUG4(std::cout <<
"registering edge ("<<e.first<<
","<<e.second<<
") globally"<<std::endl);
55 entries.emplace_back(e, weight);
56 global_weight += weight;
58 void add_edge_global(
const VertexName& u,
const VertexName& v,
const unsigned weight)
63 friend std::ostream& operator<<(std::ostream& os, const Solution<Compare>& S)
65 return os << S.entries;
void combine_disjoint_union(const Solution< Compare > &S)
combine two solutions for the graphs g & h to form a solution for the disjoint union g + h ...
Definition: solution.hpp:45
Definition: read_adj_list.hpp:22
std::list< value_type > entries
edges of the solution paired with their weights at the time of addition
Definition: solution.hpp:21
unsigned global_weight
keeps track of the global weight for O(1) checks
Definition: solution.hpp:22
unsigned total_weight() const
return the total weight of this solution
Definition: solution.hpp:32
bool no_solutions() const
return whether there are no solutions stored in the object
Definition: solution.hpp:26
void invalidate()
invalidate this solution by removing all edges
Definition: solution.hpp:38
a solution is a list of edge names with weights; it keeps track of the overall weight for O(1) access...
Definition: solution.hpp:17
void add_edge_global(const EdgeName &e, const unsigned weight)
add an edge to the list
Definition: solution.hpp:52