7.Geometric Intersection: Interval
目录
1.Interval intersection detection
1.1algorithm
1.2 Lower-bound
2. Segement Intersection Reporting: Hardness
2.1algorithm
2.2 Lower-bound
3.Segement Intersection Report
3.1 Proximity & Separability
3.2 Comparability & Ordering
3.3 data structrue
3.4 possible Cases
1.Interval intersection detection
1.1algorithm
只检测有没有交集部分
解决方法
如果存在交集,必然会有两个连续的 LL 或者 RR
上述的算法复杂度为O(N)
1.2 Lower-bound
通过IEU 规约,求解Interval intersection detection 算法复杂度
IID的输出如果存在交集,那么IEU的输出就存在重复出现的数字
2. Segement Intersection Reporting: Hardness
2.1algorithm
二维平面如何求交?
有没有更加简洁的方法呢?
To-Left test,一对线段有交集,当且仅当其中任何一条线段的两个端点,都位于另一个所在直线的异侧。
2.2 Lower-bound
- EU是输入可以转换为 x 轴上的点,把点拔高转换为SID算法的输入
- SID输出没有交集合,当且仅当之前 EU 问题的答案是Yes
是否存在这种算法呢
的确有这种算法
3.Segement Intersection Report
3.1 Proximity & Separability
先进行筛选,再做有目的性的比对
3.2 Comparability & Ordering
按照交点进行排序
3.3 data structrue
1.Status structrure: 竖直方向,一些列的活跃线段
2.Event Queue: 水平方向,存储事件
3.4 possible Cases
succ: 后继点
pred: 前驱点