How to divide a set of overlapping ranges into non-overlapping ranges?

前端 未结 5 1146
伪装坚强ぢ
伪装坚强ぢ 2021-02-13 23:22

Let\'s say you have a set of ranges:

  • 0 - 100: \'a\'
  • 0 - 75: \'b\'
  • 95 - 150: \'c\'
  • 120 - 130: \'d\'

Obviously, these range

5条回答
  •  悲哀的现实
    2021-02-13 23:55

    What you describe is an example of set theory. For a general algorithm for computing unions, intersections, and differences of sets see:

    www.gvu.gatech.edu/~jarek/graphics/papers/04PolygonBooleansMargalit.pdf

    While the paper is targeted at graphics it is applicable to general set theory as well. Not exactly light reading material.

提交回复
热议问题