interval-tree

Help finding C++ interval tree algorithm implementation

I'm trying to find an efficient C++ interval tree implementation (mostly likely based on red black trees) without a viral or restrictive license. Any pointers to a clean lightweight standalone implementation? For the use case I have in mind, the set of intervals is known at the outset (there would be say a million) and I want to be able ...

Finding Overlap among multiple intervals

Let's say I have a list of intervals (or ranges) (Eg. 10-15, 5-7, 9-12..). The problem is to find the subset of ranges that overlaps. Of course I can use Interval tree for this. The actual problem that I have is there are multiple ranges. Best explained by an example: 10-15, 5-7, 9-12 1-2, 3-6, 14-15 3-5, 9-15, 10-15 In the abov...

IntervalTree Java Implementation

I need an IntervalTree or RangeTree implementation in Java, and am having trouble finding one with working deletion support. There's a built-in one at sun.jvm.hotspot.utilities.IntervalTree, but the deleteNode method in the RBTree superclass states: /** * FIXME: this does not work properly yet for augmented red-black * trees since it...

Interval tree algorithm that supports merging of intervals with no overlap

I'm looking for an interval tree algorithm similar to the red-black interval tree in CLR but that supports merging of intervals by default so that there are never any overlapping intervals. In other words if you had a tree containing two intervals [2,3] and [5,6] and you added the interval [4,4], the result would be a tree containing ju...

Maximum interval overlaps using an interval tree

Here is an interesting question: Given a set of N intervals ([start, end]), use an interval tree to find the maximum number of overlapping intervals. A similar question on StackOverflow provided an O(N) solution, but if we can pre-process the intervals into an interval tree, perhaps we can find the solution in logarithmic time. In fact, ...