53 void apply(std::vector<WeightedRelationItem>& weightedRelations)
override
55 std::vector<WeightedRelationItem> selectedWeightedRelations;
61 while (not weightedRelations.empty()) {
63 const auto maxElement = *(std::min_element(weightedRelations.begin(), weightedRelations.end(), GreaterWeight()));
64 selectedWeightedRelations.push_back(maxElement);
67 return item.getFrom() == maxElement.getFrom() or item.getTo() == maxElement.getTo();
70 erase_remove_if(weightedRelations, itemSharesFromOrTo);
73 std::sort(selectedWeightedRelations.begin(), selectedWeightedRelations.end());
74 weightedRelations.swap(selectedWeightedRelations);