1

I'm working on a C# implementation of the Interval Binary Search Tree by Hanson and Chaabouni. In short terms, it is a data structure for dynamic interval collections that allows you to quickly find intervals that overlap a point. The data structure is an augmented binary search tree (BST) using an AVL balancing scheme.

Each node in the tree contains three sets of intervals. When doing rotations, we need to do a lot of set operations in order to maintain the invariant. We need support for iterating the intervals in a set, addition and subtraction of sets and set intersections. If the collection contains duplicate intervals (intervals that have the same endpoints, but are not the same object) they will be contained in the same sets.

We need to be able to do these set operations as fast as possible - it is our limiting factor atm. Is there any data structures that supports these operations efficiently?

Bonus info:

  • An interval consists of a low and a high endpoint. That is all we know about them.
  • We can hash those endpoints, but a duplicate interval with the same endpoints will naturally have the same hashcode.
  • Intervals are differentiated on reference equality.
  • We can sort endpoint, but duplicate intervals with the same endpoints will naturally have the same sorting order.
  • We do not have any other information that could be used for hashing or sorting.
Mikkel R. Lund
  • 2,336
  • 1
  • 31
  • 44
  • there is fast disjoint set (also known as union-find) data structure for fast set union and finding out for which set element belong. ( "almost" O(1) operations with path compression). Not sure if it's what you're looking for. – fex Oct 28 '13 at 16:30
  • No, not at all. The sets are all independent. We do not want to know if intervals are in the same sets, but which intervals are in a set. – Mikkel R. Lund Oct 28 '13 at 16:35

0 Answers0