A generator of random convex polygons in a disc

Similar documents
Meshing the hyperbolic octagon

X-Kaapi C programming interface

BoxPlot++ Zeina Azmeh, Fady Hamoui, Marianne Huchard. To cite this version: HAL Id: lirmm

An Experimental Assessment of the 2D Visibility Complex

The optimal routing of augmented cubes.

Computing and maximizing the exact reliability of wireless backhaul networks

Acyclic Coloring of Graphs of Maximum Degree

The Proportional Colouring Problem: Optimizing Buffers in Radio Mesh Networks

Real-Time Collision Detection for Dynamic Virtual Environments

Branch-and-price algorithms for the Bi-Objective Vehicle Routing Problem with Time Windows

Blind Browsing on Hand-Held Devices: Touching the Web... to Understand it Better

Relabeling nodes according to the structure of the graph

Multimedia CTI Services for Telecommunication Systems

Comparison of spatial indexes

NP versus PSPACE. Frank Vega. To cite this version: HAL Id: hal

Mokka, main guidelines and future

Moveability and Collision Analysis for Fully-Parallel Manipulators

THE COVERING OF ANCHORED RECTANGLES UP TO FIVE POINTS

Synthesis of fixed-point programs: the case of matrix multiplication

Every 3-connected, essentially 11-connected line graph is hamiltonian

Traffic Grooming in Bidirectional WDM Ring Networks

Setup of epiphytic assistance systems with SEPIA

Efficient implementation of interval matrix multiplication

Squaring the Circle with Weak Mobile Robots

Deformetrica: a software for statistical analysis of anatomical shapes

An Efficient Numerical Inverse Scattering Algorithm for Generalized Zakharov-Shabat Equations with Two Potential Functions

Does disabling Wi-Fi prevent my Android phone from sending Wi-Fi frames?

Taking Benefit from the User Density in Large Cities for Delivering SMS

Malware models for network and service management

DANCer: Dynamic Attributed Network with Community Structure Generator

Comparison of radiosity and ray-tracing methods for coupled rooms

A Voronoi-Based Hybrid Meshing Method

Linked data from your pocket: The Android RDFContentProvider

lambda-min Decoding Algorithm of Regular and Irregular LDPC Codes

Assisted Policy Management for SPARQL Endpoints Access Control

Linux: Understanding Process-Level Power Consumption

Tacked Link List - An Improved Linked List for Advance Resource Reservation

How to simulate a volume-controlled flooding with mathematical morphology operators?

Comparator: A Tool for Quantifying Behavioural Compatibility

XML Document Classification using SVM

Kernel perfect and critical kernel imperfect digraphs structure

Delaunay Triangulations of Points on Circles

The Connectivity Order of Links

Service Reconfiguration in the DANAH Assistive System

Natural Language Based User Interface for On-Demand Service Composition

FIT IoT-LAB: The Largest IoT Open Experimental Testbed

Fault-Tolerant Storage Servers for the Databases of Redundant Web Servers in a Computing Grid

Grid spanners with low forwarding index for energy efficient networks

Study on Feebly Open Set with Respect to an Ideal Topological Spaces

Representation of Finite Games as Network Congestion Games

Sliding HyperLogLog: Estimating cardinality in a data stream

Minor-monotone crossing number

Decomposition of a curve into arcs and line segments based on dominant point detection

Reverse-engineering of UML 2.0 Sequence Diagrams from Execution Traces

Quasi-tilings. Dominique Rossin, Daniel Krob, Sebastien Desreux

QuickRanking: Fast Algorithm For Sorting And Ranking Data

QAKiS: an Open Domain QA System based on Relational Patterns

LaHC at CLEF 2015 SBS Lab

Periodic meshes for the CGAL library

HySCaS: Hybrid Stereoscopic Calibration Software

Robust IP and UDP-lite header recovery for packetized multimedia transmission

Prototype Selection Methods for On-line HWR

Workspace and joint space analysis of the 3-RPS parallel robot

SIM-Mee - Mobilizing your social network

Structuring the First Steps of Requirements Elicitation

A Practical Approach for 3D Model Indexing by combining Local and Global Invariants

Multi-atlas labeling with population-specific template and non-local patch-based label fusion

RDF/SPARQL Design Pattern for Contextual Metadata

Fuzzy sensor for the perception of colour

Motion-based obstacle detection and tracking for car driving assistance

Elementary transformation analysis for Array-OL

An FCA Framework for Knowledge Discovery in SPARQL Query Answers

Extended interface ID for virtual link selection in GeoNetworking to IPv6 Adaptation Sub-layer (GN6ASL)

Hamilton Cycle Decomposition of the Butterfly Network

Scalewelis: a Scalable Query-based Faceted Search System on Top of SPARQL Endpoints

Catalogue of architectural patterns characterized by constraint components, Version 1.0

Zigbee Wireless Sensor Network Nodes Deployment Strategy for Digital Agricultural Data Acquisition

A Generic Architecture of CCSDS Low Density Parity Check Decoder for Near-Earth Applications

Formal modelling of ontologies within Event-B

Lossless and Lossy Minimal Redundancy Pyramidal Decomposition for Scalable Image Compression Technique

A N-dimensional Stochastic Control Algorithm for Electricity Asset Management on PC cluster and Blue Gene Supercomputer

Light field video dataset captured by a R8 Raytrix camera (with disparity maps)

SDLS: a Matlab package for solving conic least-squares problems

CORON: A Framework for Levelwise Itemset Mining Algorithms

YANG-Based Configuration Modeling - The SecSIP IPS Case Study

Real-Parameter Black-Box Optimization Benchmarking 2009 Software: User Documentation

Decentralised and Privacy-Aware Learning of Traversal Time Models

Regularization parameter estimation for non-negative hyperspectral image deconvolution:supplementary material

COM2REACT: V2V COMMUNICATION FOR COOPERATIVE LOCAL TRAFFIC MANAGEMENT

IP Simulator User Guide

YAM++ : A multi-strategy based approach for Ontology matching task

Change Detection System for the Maintenance of Automated Testing

Accurate Conversion of Earth-Fixed Earth-Centered Coordinates to Geodetic Coordinates

MUTE: A Peer-to-Peer Web-based Real-time Collaborative Editor

Emerging and scripted roles in computer-supported collaborative learning

ASAP.V2 and ASAP.V3: Sequential optimization of an Algorithm Selector and a Scheduler

Caching strategies based on popularity prediction in content delivery networks

Stream Ciphers: A Practical Solution for Efficient Homomorphic-Ciphertext Compression

Quality of Service Enhancement by Using an Integer Bloom Filter Based Data Deduplication Mechanism in the Cloud Storage Environment

Evolutionary Cutting Planes

Transcription:

A generator of random convex polygons in a disc Olivier Devillers, Philippe Duchon, Rémy Thomasse To cite this version: Olivier Devillers, Philippe Duchon, Rémy Thomasse. A generator of random convex polygons in a disc. [Research Report] RR-8467, INRIA. 2014, pp.9. <hal-00943409> HAL Id: hal-00943409 https://hal.inria.fr/hal-00943409 Submitted on 7 Feb 2014 HAL is a multi-disciplinary open access archive for the deposit and dissemination of scientific research documents, whether they are published or not. The documents may come from teaching and research institutions in France or abroad, or from public or private research centers. L archive ouverte pluridisciplinaire HAL, est destinée au dépôt et à la diffusion de documents scientifiques de niveau recherche, publiés ou non, émanant des établissements d enseignement et de recherche français ou étrangers, des laboratoires publics ou privés.

A generator of random convex polygons in a disc Olivier Devillers, Philippe Duchon, Rémy Thomasse RESEARCH REPORT N 8467 Février 2014 Project-Team Geometrica ISSN 0249-6399 ISRN INRIA/RR--8467--FR+ENG

A generator of random convex polygons in a disc Olivier Devillers, Philippe Duchon, Rémy Thomasse Project-Team Geometrica Research Report n 8467 Février 2014 9 pages Abstract: We propose an algorithm that generates a random polygon as a convex hull of n points uniformly and independently distributed in a disc without explicitly generate all the points. Key-words: Convex hull, point distribution, random analysis The work in this paper has been supported by ANR blanc PRESAGE (ANR-11-BS02-003) and Région PACA. Projet Geometrica, INRIA Sophia Antipolis - Méditerranée Univ. Bordeaux, LaBRI, UMR 5800, F-33400 Talence, France CNRS, LaBRI, UMR 5800, F-33400 Talence, France Projet Geometrica, INRIA Sophia Antipolis - Méditerranée RESEARCH CENTRE SOPHIA ANTIPOLIS MÉDITERRANÉE 2004 route des Lucioles - BP 93 06902 Sophia Antipolis Cedex

Un générateur de polygones convexes aléatoires dans un disque Résumé : Nous proposons un algorithme qui génère un polygone aléatoire défini par l enveloppe convexe de n points aléatoires indṕendants et uniformément distribués dans le disque, sans avoir à générer explicitement tous les points. Mots-clés : Enveloppe convexe, polygone aléatoire, générateur

A generator of random convex polygons in a disc 3 1 Introduction Let D be a disc in R 2 with radius R centered at o, and (x 1,...,x n ) a sample of n points uniformly and independently distributed in D. Let s define the polygon P n as the convex hull of (x 1,...,x n ), and f 0 (P n ) its number of vertices. This kind of polygon has been well studied, and using [Bá92, Rei10] one can easily see that Ef 0 (P n ) = c n 1 3 +o(n 1 3 ) (1) where c = 2 4 33 1 3Γ( 5 3 )π 5 3 3.383228964 and Γ denotes the usual Gamma function. To generate such a polygon, one can explicitly generate n points uniformly in D and compute the convex hull. For a very large number of points, it could be interesting to generate fewer points to get the same polygon, for example to evaluate the constant that are not explicitly known for the asymptotic distribution of the perimeter, or other parameters such has the higher moments of the extremal points. In this note, we propose an algorithm that generates far fewer points at random in order to get P n, so that the time and the memory needed is reduced for n large. 2 Algorithm We start with random polygon P i in D where i is very small, and we increase the number of points until we get P n. The idea is that given the convex hull of small number of points, the number of points generated in D that are deeply inside (and so won t change the convex hull) is a random variable that we can easily simulate, so that we need to generate only the small number of points that are close to the convex hull. The outline of the algorithm is the following : Generate a small number of points in D and compute its convex hull; Compute the radius of the largest disc centered at o inscribed in the convex hull; Choose a number of points to simulate at this step; Simulate the number of points that fall in this inscribed disc at this step; Generate the rest of the random points in the annulus defined by these two discs and update the convex hull. continue this process until the sum of the simulated and generated points is equal to n. To simplify the notations, we assume D to have radius 1. Notations n is the total number of points simulated and m i is the total number of points from step 1 to step i; k i is the number of generated points at step i, and k = ik i is the total number of generated points; RR n 8467

4 O. Devillers, P. Duchon & R. Thomasse D D i o Figure 1: At step i, we simulate the number of points that falls in D i and we generate points uniformly in the yellow annulus h i is size of the convex hull at step i, and h is the size of the final convex hull. p i is the probability to fall in the annulus at step i. Initialization First, we have to generate a random polytope P i with a small number of points in D such that o is inside the random polytope. This is not too much to ask, as (see [AS08]) P(o P i ) = 2 (i 1) i (2) We initialize the random polygon by generating 100 points in the disc. As the probability that o P 100 is lower than 1.6 10 28, it s very unlikely that this is not enough. Otherwise, we add another sample of 100 points, until 0 P 100.j for some j. Simulation of Points At the beginning of each step i of the loop,we are given a polygon P mi, which is the convex hull of m i points. Let s i the number of new points simulated at step i. We choose s i = m i if m i < nlog 2 n, and s i = nlog 2 n otherwise. Let D i be the largest inscribed disc in P mi centered in o, and r i its radius. Using a simulation of a binomial variable of parameter s i and 1 ri 2, we can evaluate the number of points that falls in D \D i. As the points in D i won t change the convex hull, we don t need to generate them. Then, we generate the rest of the points uniformly in the annulus D\D i, and we update the convex hull using a Graham scan. Generation of random points To generate random points in an annulus with radii r i and 1, one need to generate the polar angles uniformly in [ π,π) and the squared radii uniformly in [r 2 i,1). As we want to perform a Graham scan in linear time, the points have to be sorted by their polar angles. This can be done in expected linear time and size, using a bucket sort, as the angles are uniformly chosen, see [CSRL01, 8.4]. Inria

A generator of random convex polygons in a disc 5 Full algorithm Data: integer n Result: Convex hull of n uniformly chosen points in the disc D Simulated_Points 0 ; do Generate min(100,n Simulated_Points) points in the disc of radius 1; Simulated_Points Simulated_Points+min(100,n Simulated_Points) ; while o is not in the convex hull and Simulated_Points < n ; while Simulated_Points< n do Compute inscribed_radius; p inscribed_radius 2 ; if Simulated_Points < nlog 2 n then k Simulated_Points; else k min( nlog 2 n,n Simulated_points); end X Simulation of Binomial variable with parameters k,1 p; Generate X points uniformly and sorted in the annulus of radii inscribed_radius, 1; Simulated_Points Simulated_Points + k ; Merge the list of the convex hull and the new points; Update the convex hull with a Graham scan on the list; end return Convex hull Algorithm 1: Algorithm of the Generator of Random Polygon in a disc 3 Complexity Clearly the size complexity is max i (h i + k i ) and the time complexity is i(h i + k i ) since the Graham scan and the points generation are linear in the number of points [Gra72]. For the initialization, as the probability that0 P n decreases exponentially, it is very unlikely that more than one loop is necessary. Let s call p the minimal number of points such that o P p. Using formula (2), the expectation of p is very small : E(p) = jp(p = j) = P(p j) j=1 j=1 3 = P(p j)+ P(o P j 1 ) i=1 j=4 = 3+ P(o P j ) j=3 = 3+ j2 (j 1) = 3+2 = 5. (3) Thus, the expected size and time complexity of the initialization is O(1). j=3 RR n 8467

6 O. Devillers, P. Duchon & R. Thomasse For i big enough, we have [Bár89]: Å logmi E d H (P mi,d) = Θ whered H, the Hausdorff distance, is the maximal distance between a point inp i and the boundary of D. Recall that D i is the annulus with radii r i = 1 d H (P mi,d) and 1 and let p i be the probability that a random point in D falls in D i Using (4), there exist a constant c 0 > 0 such that, for i large E(p i ) = 1 ri 2 < 2(1 r Ä i) < c logmi 0 m i Let s call i τ the last step i where m i < n ä2 3. log 2 n. At each step i i τ, k i is a binomial variable with parameter p i and m i < n. Thus, for i log 2 n large enough, ÇÅ ã1 å E(k i ) = E(E(k i p i )) = m i Ep i = O(m 1 3 i log 2 3 n 3 2 (mi )) = O log log 2 3 n = O(n 1 3 ). (5) n As we choose m i+1 = 2m i, i τ is bounded by log 2 (n). For i > i τ, k i is a binomial variable with parameter p i and m i ã2 3 n log 2 n m i > n log 2 n, we get Ek i = O(n 1 3). As we simulate at each step i > i τ at least of step after i τ is bounded by log 2 (n). Now, Ek = i τ i=1 O O Ñ Ñ Ek i + i>i τ Ek i log 2 3 n log 2 3 n Ñ log2 n i=1 Ñ log2 n m 1 3 i éé +log 2 n O(n 1 3 ) (4), so using (5) and the fact that n, the number log 2 (n) éé (2 i ) 1 3 +O(n 1 3 log 2 n) = O(n 1 3 log 2 n) (6) i=1 At each step i, the expected size of the convex hull is O(m 1 3 i ) = O(n 1 3), and Ek i = O(n 1 3). Thus, the expected size complexity is O(n 1 3). As our points are sorted according to their polar angle, computing the convex hull with a Graham scan is done in linear time (O(n 1 3 log 2 n)), the generation of the k points and the computation of the largest annulus as well (O(n 1 3)). Thus, the expected time complexity is O(n 1 3 log 2 n). 4 Experiments This algorithm has been implemented in C++, and will be submitted for integration in the CGAL library. As expected, the distribution of Ef 0 (P n ) is asymptotically the same as the theoretical one, see equation (1), with the same constant : This estimation has been done one 1000 experiments for each value of log 10 n. Inria

A generator of random convex polygons in a disc 7 Asymptotic Constant 3.38 3.36 Ef 0(P n) n 1 3 3.34 3.32 3.3 2 4 6 8 10 12 14 log 10 (n) Figure 2: Average size of P n divided by n 1 3 Complexities To evaluate the size complexity, we just compute the largest list of points used in the loop, see Figure 3. The time complexity can be evaluated by estimating the total number of points generated, see Figure 4. 3.6 3.5 3.4 3.3 2 4 6 8 10 12 14 log 10 (n) Figure 3: Average maximal size divided by n 1 3 0.4 0.3 0.2 0.1 4 6 8 10 12 14 log 10 (n) Figure 4: Average number of generated points divided by n 1 3 log 2 n As a first application, we can estimate the distribution of the smallest and the largest edge of a random polytope, see Figure 5 and Figure 6. The average have been done on 100 experiments for each value of log 10 n. The expected minimal edge seems to be O(n 1 3), and the maximal O Ä log 2 n n ä1 3. RR n 8467

8 O. Devillers, P. Duchon & R. Thomasse 0.4 size n 1 3 0.3 0.2 0.1 ä1 3 size Ä n log 2 n 1.2 1 0.8 0 2 4 6 8 10 log 10 (n) 2 4 6 8 10 log 10 (n) Figure 5: Average length of the minimal edge Figure 6: Average length of the maximal edge 5 Conclusion We propose an algorithm that generates random polygons given by the convex hull of random points, without generating all the points. There is no theoretical obstacle to generalize to higher dimension. The theoretical results used for the evaluation of the complexity are known in arbitrary dimension [Bár89, Rei10], so the analysis can be done as well. We can reduce the expected time complexity by a logarithmic factor if we allow to increase the expected size complexity by a logarithmic factor. Instead of bounding the simulated points at n step i by log 2 n when m n i becomes bigger than log 2 n, we can choose to always simulate m i points. In this case, Ek i = O(m 1 3 i log 2 3 mi ) = O(n 1 2 3 log 3 n) (7) so the expected size complexity becomes O(n 1 3 log 2 3 n). On the other hand, the expected time complexity is reduced to O(n 1 3 log 2 3 n), as Acknowledgments Ek = Ek i i Ñ = O log 2 3 n Ñ log2 n i=1 m 1 3 i éé = O Ä n 1 3 log 2 3 n ä. This work was initiated during the 2013 Presage Workshop on computational geometry and probability in Valberg. The authors wish to thank all the participants for creating a pleasant and stimulating atmosphere and Pierre Calka for discussions about potential use of the generator. References [AS08] Noga Alon and Joel H. Spencer. The probabilistic method. Wiley-Interscience Series in Discrete Mathematics and Optimization. John Wiley & Sons Inc., Hoboken, NJ, third edition, 2008. With an appendix on the life and work of Paul Erdős. Inria

A generator of random convex polygons in a disc 9 [Bár89] Imre Bárány. Intrinsic volumes and f-vectors of random polytopes. Mathematische Annalen, 285(4):671 699, 1989. [Bá92] Imre Bárány. Random polytopes in smooth convex bodies. Mathematika, 39:81 92, 6 1992. [CSRL01] Thomas H. Cormen, Clifford Stein, Ronald L. Rivest, and Charles E. Leiserson. Introduction to Algorithms. McGraw-Hill Higher Education, 2nd edition, 2001. [Gra72] [Rei10] Ronald L. Graham. An efficient algorith for determining the convex hull of a finite planar set. Information processing letters, 1(4):132 133, 1972. Matthias Reitzner. Random polytopes. In New perspectives in stochastic geometry, pages 45 76. Oxford Univ. Press, Oxford, 2010. RR n 8467

RESEARCH CENTRE SOPHIA ANTIPOLIS MÉDITERRANÉE 2004 route des Lucioles - BP 93 06902 Sophia Antipolis Cedex Publisher Inria Domaine de Voluceau - Rocquencourt BP 105-78153 Le Chesnay Cedex inria.fr ISSN 0249-6399