Data structure for non-overlapping ranges within a single dimension

前端 未结 8 1418
再見小時候
再見小時候 2020-12-30 11:26

I need a data structure that can store non-overlapping ranges within a single dimension. The entire range of the dimension need not be completely covered.

An example

8条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-30 12:13

    This is called the "Unary Resource" constraint in the Constraint Programming world. There is a lot of research in this area, specifically for the case when the event times aren't fixed, and you need to find time-slots for each of them. There is a commercial C++ package that does your problem and more Ilog CP, but it is likely overkill. There is also a somewhat open-source version called eclipse (no relation to the IDE).

提交回复
热议问题