Closed gaperez64 closed 8 months ago
It's not ground-breaking, but if instead of merely inserting elements from one antichain into the other (cf. https://github.com/gaperez64/acacia-bonsai/blob/617b702848d1ebb79659873d943846f3b4bf936e/src/downsets/vector_backed.hh#L76) we keep a pointer to the end of the first antichain, we can avoid checking domination against freshly inserted elements. This works because we know we started with two antichains.
With this, one gets the best running time we've come up with for union (even considering constants). That is nmd . With k-d trees it seems it's 2nmd since one needs to check for domination on both trees.
nmd
2nmd
Nope the fastest way is to have a single nesting of the loops in which we check both sides of inequalities
It's not ground-breaking, but if instead of merely inserting elements from one antichain into the other (cf. https://github.com/gaperez64/acacia-bonsai/blob/617b702848d1ebb79659873d943846f3b4bf936e/src/downsets/vector_backed.hh#L76) we keep a pointer to the end of the first antichain, we can avoid checking domination against freshly inserted elements. This works because we know we started with two antichains.
With this, one gets the best running time we've come up with for union (even considering constants). That is
nmd
. With k-d trees it seems it's2nmd
since one needs to check for domination on both trees.