1,094 research outputs found

    Memory-Constrained Algorithms for Simple Polygons

    Get PDF
    A constant-workspace algorithm has read-only access to an input array and may use only O(1) additional words of O(logn)O(\log n) bits, where nn is the size of the input. We assume that a simple nn-gon is given by the ordered sequence of its vertices. We show that we can find a triangulation of a plane straight-line graph in O(n2)O(n^2) time. We also consider preprocessing a simple polygon for shortest path queries when the space constraint is relaxed to allow ss words of working space. After a preprocessing of O(n2)O(n^2) time, we are able to solve shortest path queries between any two points inside the polygon in O(n2/s)O(n^2/s) time.Comment: Preprint appeared in EuroCG 201

    Ear-clipping Based Algorithms of Generating High-quality Polygon Triangulation

    Full text link
    A basic and an improved ear clipping based algorithm for triangulating simple polygons and polygons with holes are presented. In the basic version, the ear with smallest interior angle is always selected to be cut in order to create fewer sliver triangles. To reduce sliver triangles in further, a bound of angle is set to determine whether a newly formed triangle has sharp angles, and edge swapping is accepted when the triangle is sharp. To apply the two algorithms on polygons with holes, "Bridge" edges are created to transform a polygon with holes to a degenerate polygon which can be triangulated by the two algorithms. Applications show that the basic algorithm can avoid creating sliver triangles and obtain better triangulations than the traditional ear clipping algorithm, and the improved algorithm can in further reduce sliver triangles effectively. Both of the algorithms run in O(n2) time and O(n) space.Comment: Proceedings of the 2012 International Conference on Information Technology and Software Engineering Lecture Notes in Electrical Engineering Volume 212, 2013, pp 979-98

    Space-Time Trade-offs for Stack-Based Algorithms

    Get PDF
    In memory-constrained algorithms we have read-only access to the input, and the number of additional variables is limited. In this paper we introduce the compressed stack technique, a method that allows to transform algorithms whose space bottleneck is a stack into memory-constrained algorithms. Given an algorithm \alg\ that runs in O(n) time using Θ(n)\Theta(n) variables, we can modify it so that it runs in O(n2/s)O(n^2/s) time using a workspace of O(s) variables (for any so(logn)s\in o(\log n)) or O(nlogn/logp)O(n\log n/\log p) time using O(plogn/logp)O(p\log n/\log p) variables (for any 2pn2\leq p\leq n). We also show how the technique can be applied to solve various geometric problems, namely computing the convex hull of a simple polygon, a triangulation of a monotone polygon, the shortest path between two points inside a monotone polygon, 1-dimensional pyramid approximation of a 1-dimensional vector, and the visibility profile of a point inside a simple polygon. Our approach exceeds or matches the best-known results for these problems in constant-workspace models (when they exist), and gives the first trade-off between the size of the workspace and running time. To the best of our knowledge, this is the first general framework for obtaining memory-constrained algorithms

    Geodesic-Preserving Polygon Simplification

    Full text link
    Polygons are a paramount data structure in computational geometry. While the complexity of many algorithms on simple polygons or polygons with holes depends on the size of the input polygon, the intrinsic complexity of the problems these algorithms solve is often related to the reflex vertices of the polygon. In this paper, we give an easy-to-describe linear-time method to replace an input polygon P\mathcal{P} by a polygon P\mathcal{P}' such that (1) P\mathcal{P}' contains P\mathcal{P}, (2) P\mathcal{P}' has its reflex vertices at the same positions as P\mathcal{P}, and (3) the number of vertices of P\mathcal{P}' is linear in the number of reflex vertices. Since the solutions of numerous problems on polygons (including shortest paths, geodesic hulls, separating point sets, and Voronoi diagrams) are equivalent for both P\mathcal{P} and P\mathcal{P}', our algorithm can be used as a preprocessing step for several algorithms and makes their running time dependent on the number of reflex vertices rather than on the size of P\mathcal{P}

    Detecting Weakly Simple Polygons

    Full text link
    A closed curve in the plane is weakly simple if it is the limit (in the Fr\'echet metric) of a sequence of simple closed curves. We describe an algorithm to determine whether a closed walk of length n in a simple plane graph is weakly simple in O(n log n) time, improving an earlier O(n^3)-time algorithm of Cortese et al. [Discrete Math. 2009]. As an immediate corollary, we obtain the first efficient algorithm to determine whether an arbitrary n-vertex polygon is weakly simple; our algorithm runs in O(n^2 log n) time. We also describe algorithms that detect weak simplicity in O(n log n) time for two interesting classes of polygons. Finally, we discuss subtle errors in several previously published definitions of weak simplicity.Comment: 25 pages and 13 figures, submitted to SODA 201

    Linear-Time Algorithms for Geometric Graphs with Sublinearly Many Edge Crossings

    Full text link
    We provide linear-time algorithms for geometric graphs with sublinearly many crossings. That is, we provide algorithms running in O(n) time on connected geometric graphs having n vertices and k crossings, where k is smaller than n by an iterated logarithmic factor. Specific problems we study include Voronoi diagrams and single-source shortest paths. Our algorithms all run in linear time in the standard comparison-based computational model; hence, we make no assumptions about the distribution or bit complexities of edge weights, nor do we utilize unusual bit-level operations on memory words. Instead, our algorithms are based on a planarization method that "zeroes in" on edge crossings, together with methods for extending planar separator decompositions to geometric graphs with sublinearly many crossings. Incidentally, our planarization algorithm also solves an open computational geometry problem of Chazelle for triangulating a self-intersecting polygonal chain having n segments and k crossings in linear time, for the case when k is sublinear in n by an iterated logarithmic factor.Comment: Expanded version of a paper appearing at the 20th ACM-SIAM Symposium on Discrete Algorithms (SODA09
    corecore