Upper Envelope Onion Peeling

We consider the problem of finding the upper envelope layers of a set of line segments, sequentially and in parallel. The upper envelope of a set of n line segments in the plane can be computed in O(n log n) time [10]. By repeatedly removing the segments that appear on the envelope and recomputing the envelope, one obtains a natural partition of the set of segments into layers. We give an O(n log n) sequential algorithm to find envelope layers if the segments are disjoint and an O(na(n) log2n) algorithm if the segments intersect (α(n) is the extremely slowly-growing inverse of Ackermann's function [9]). Finally, we prove that the problem of finding envelope layers in parallel is P-complete, and hence likely to be intractable.