10 bool operator() (
const pair<
int, set<int> >& lhs,
const pair<
int, set<int> >& rhs){
11 return lhs.second.size() > rhs.second.size()
12 || (lhs.second.size() == rhs.second.size() && lhs.first > rhs.first);
24 for(
auto it = this->c.begin(); it < this->c.end(); ++it)
26 if(it->first == node_i){
27 it->second.insert(node_j);
30 if(it->first == node_j){
31 it->second.insert(node_i);
34 if(found1 && found2)
break;
36 make_heap(this->c.begin(), this->c.end(), this->comp);
40 for(
auto it = this->c.begin(); it < this->c.end(); ++it){
41 if(it->first == node){
48 auto res = nodes.insert(
id);
49 if(res.second ==
true)
50 this->push(pair<
int, set<int> >(
id, set<int>()));
55 auto it = this->c.begin();
56 for(; it < this->c.end(); ++it)
58 if(it->first == node){
62 if (it != this->c.end()) {
64 make_heap(this->c.begin(), this->c.end(), this->comp);
65 removed.push_back(node);
69 cout <<
"failed to remove node " << node << endl;
74 for(; it < this->c.end(); ++it)
76 it->second.erase(node);