I need to solve dynamic convex hull algorithm problem, i.e. maintaining the convex hull of 2D points, where I can add and delete points.
The naive approach is clearly O(N)
; whenever one of the N
points is added/deleted, we recompute the convex hull from scratch. However, I cannot afford linear time, so I am looking for a sublinear algorithm. So far, I have found a bunch of paper all of which describe some sophisticated algorithm with crazy time bounds which would take ages to implement. Even the oldest efficient algorithm, due to Overmars and Leeuween, which is O(log^2 N)
seems way too complicated. (As usual, most of algorithms described in such papers have tons of dependencies in terms of structures/algorithms from other, referenced papers)
I am looking for something simpler, not necessarily novel, which performs better than linear in the worst case (e.g. O(sqrt N)
). Finally, I don't mind if the time is amortized. Any ideas?
(By simple, I primarily mean something that does not require more than a few hundred lines of code.)