It is somehow not so fully clear, what you mean with dominance.
But I guess you can do that, with an
if first condition then ... else if second condition then ...
For the comparison, we can use a double nested loop with o(N^2) time complexity, so, not very efficient.
And, with your given data, all but the first will element will be erased, because all "reducedcost" of elements will be greater than the first one.
Please check the following example code
#include <iostream>
#include <vector>
#include <iterator>
struct Label {
double reducedcost{};
int totalload{};
};
int main() {
std::vector<Label> labels{};
labels.emplace_back(1, 6);
labels.emplace_back(7, 2);
labels.emplace_back(2, 3);
labels.emplace_back(5, 5);
labels.emplace_back(6, 4);
size_t i{};
while (i < labels.size()) {
size_t j{};
while (j < labels.size()) {
if (labels[j].reducedcost > labels[i].reducedcost)
labels.erase(std::next(labels.begin(), j));
else if (labels[j].totalload > labels[i].totalload)
labels.erase(std::next(labels.begin(), j));
else
++j;
}
++i;
}
for (const auto& [r, t] : labels)
std::cout << r << '\t' << t << '\n';
}
But, as said, not really sure what you try to attempt.