torressa/cspy

Label::checkDominance can break out if all_res_equal=false

Closed this issue · 3 comments

This may not make a big performance difference, but it seems like after L167, when all_res_equal=false in
https://github.com/torressa/cspy/blob/master/src/cc/labelling.cc

that you can break out of the loop, since all_res_equal can't be true at that point.

Another small improvement that might help is during that loop to flag if resource consumption is >. Then you can break out without going into another loop.

Something like issue92.txt.

Hi @mgalati13!
Thanks for reporting this. I have already changed this, waiting for some other changes for the next release

cspy/src/cc/labelling.cc

Lines 167 to 173 in beb3cb8

bool all_res_equal = std::equal(
resource_consumption.cbegin(),
resource_consumption.cend(),
other.resource_consumption.cbegin());
if (all_res_equal) {
return false;
}