2,795 research outputs found

    A Simple and Correct Even-Odd Algorithm for the Point-in-Polygon Problem for Complex Polygons

    Get PDF
    Determining if a point is in a polygon or not is used by a lot of applications in computer graphics, computer games and geoinformatics. Implementing this check is error-prone since there are many special cases to be considered. This holds true in particular for complex polygons whose edges intersect each other creating holes. In this paper we present a simple even-odd algorithm to solve this problem for complex polygons in linear time and prove its correctness for all possible points and polygons. We furthermore provide examples and implementation notes for this algorithm.Comment: Proceedings of the 12th International Joint Conference on Computer Vision, Imaging and Computer Graphics Theory and Applications (VISIGRAPP 2017), Volume 1: GRAP

    Meeting in a Polygon by Anonymous Oblivious Robots

    Full text link
    The Meeting problem for k≥2k\geq 2 searchers in a polygon PP (possibly with holes) consists in making the searchers move within PP, according to a distributed algorithm, in such a way that at least two of them eventually come to see each other, regardless of their initial positions. The polygon is initially unknown to the searchers, and its edges obstruct both movement and vision. Depending on the shape of PP, we minimize the number of searchers kk for which the Meeting problem is solvable. Specifically, if PP has a rotational symmetry of order σ\sigma (where σ=1\sigma=1 corresponds to no rotational symmetry), we prove that k=σ+1k=\sigma+1 searchers are sufficient, and the bound is tight. Furthermore, we give an improved algorithm that optimally solves the Meeting problem with k=2k=2 searchers in all polygons whose barycenter is not in a hole (which includes the polygons with no holes). Our algorithms can be implemented in a variety of standard models of mobile robots operating in Look-Compute-Move cycles. For instance, if the searchers have memory but are anonymous, asynchronous, and have no agreement on a coordinate system or a notion of clockwise direction, then our algorithms work even if the initial memory contents of the searchers are arbitrary and possibly misleading. Moreover, oblivious searchers can execute our algorithms as well, encoding information by carefully positioning themselves within the polygon. This code is computable with basic arithmetic operations, and each searcher can geometrically construct its own destination point at each cycle using only a compass. We stress that such memoryless searchers may be located anywhere in the polygon when the execution begins, and hence the information they initially encode is arbitrary. Our algorithms use a self-stabilizing map construction subroutine which is of independent interest.Comment: 37 pages, 9 figure

    Fuchsian differential equation for the perimeter generating function of three-choice polygons

    Get PDF
    Using a simple transfer matrix approach we have derived very long series expansions for the perimeter generating function of three-choice polygons. We find that all the terms in the generating function can be reproduced from a linear Fuchsian differential equation of order 8. We perform an analysis of the properties of the differential equation.Comment: 13 pages, 2 figures, talk presented in honour of X. Viennot at Seminaire Lotharengien, Lucelle, France, April 3-6 2005. Paper amended and sligtly expanded after refereein

    A new transfer-matrix algorithm for exact enumerations: Self-avoiding polygons on the square lattice

    Full text link
    We present a new and more efficient implementation of transfer-matrix methods for exact enumerations of lattice objects. The new method is illustrated by an application to the enumeration of self-avoiding polygons on the square lattice. A detailed comparison with the previous best algorithm shows significant improvement in the running time of the algorithm. The new algorithm is used to extend the enumeration of polygons to length 130 from the previous record of 110.Comment: 17 pages, 8 figures, IoP style file

    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

    Punctured polygons and polyominoes on the square lattice

    Full text link
    We use the finite lattice method to count the number of punctured staircase and self-avoiding polygons with up to three holes on the square lattice. New or radically extended series have been derived for both the perimeter and area generating functions. We show that the critical point is unchanged by a finite number of punctures, and that the critical exponent increases by a fixed amount for each puncture. The increase is 1.5 per puncture when enumerating by perimeter and 1.0 when enumerating by area. A refined estimate of the connective constant for polygons by area is given. A similar set of results is obtained for finitely punctured polyominoes. The exponent increase is proved to be 1.0 per puncture for polyominoes.Comment: 36 pages, 11 figure
    • …
    corecore