Time- and Space-Optimal Contour Computation for a Set of Rectangles

Abstract We present the first time- and space-optimal algorithm for the problem of computing the contours of the disjoint polygons defined by the union of n rectangles in the plane. It requires O(n log n+e) time and O(n) space, where e is the total number of edges in the contour cycles. The space optimality of the solution is demonstrated by way of a combinatorial argument.