XP is just a number | |
PerlMonks |
Re: Set intersection problemby Corion (Patriarch) |
on May 23, 2023 at 08:12 UTC ( [id://11152382]=note: print w/replies, xml ) | Need Help?? |
I think you can reduce the problem to the problem of overlapping "axis aligned bounding boxes" ("AABB"). There are many algorithms to improve "collision detection" for these AABBs as the problem occurs often in computer graphics. Depending on whether this is a one-time setup or whether the arrays change over time, it can pay off to use a more complicated structure (quad-tree) over brute force.
In Section
Seekers of Perl Wisdom
|
|