1

Have anyone used the Boolean function of Boost polygon library? Boost polygon library

It says that the algorithm is O(nlogn) in time complexity, n = #points

I input 200000 random generated polygons (with 5~8 potins)

but the OR and XOR function cost about half hours (yes, just call its function)

though the result is correct, but the time consuming is horrible

have anyone met this problem?

alfC
  • 14,261
  • 4
  • 67
  • 118
user1815783
  • 45
  • 2
  • 7
  • are you using floating-point (not integer) coordinates? (that is a common mistake with this library). – alfC Jul 15 '15 at 04:05

1 Answers1

0

Although it would always help to post the code that exhibits the described behavior, I assume that each of the i=1..n polygons has some (unique) crossings with each of the previous 1..(i-1) polygons, which implies that the number of points that result from XOR'ing the first n-1 polygons is quadratic in n, so you are requesting n times an operation of O(#Points * log(#Points)) where #Points is O(n^2), thus the total complexity would be O(n^2*log(n)).