I met a geometry/algorithm problem.
With help of a function, I can know if 2 segments intersect with each other, like
def intersect(P,Q):
return True if P,Q intersect
based on this function, I want get something more.
I have around 100 segments, and wondering how can I get the quantity of classes of all non-conflict/intersect combinations (add: if you know a term in traffic management, I want to find something like PHASE)
for example, the following img link: I got 4 segments A, B, C and D.
A intersect with B,C C intersect with D
possible non-conflict/intersect combinations could be:
[A D], [B C], the class number is 2
or
[B D], [A], [C], the class number is 3
Is there anyway to get those combination list and the corresponding class number?
Any answer would be much appreciated!
