Here's the approach I ended up taking, commented up all nice! Googling around a bit told me that this is a variation on what's called a "sweep-line algorithm," and the time complexity is at best O(n log n) but depends greatly on the size of the active set during runtime.
1 likes 0 replies
?