Fast Geometric Algorithms

Total Page:16

File Type:pdf, Size:1020Kb

Fast Geometric Algorithms FAST GEOMETRICALGORITHMS by Mark T. Noga Dissertation submitted to the Faculty of the Yi rgin ia Polytechnic Institute and State University in partial fulfillment of the requirements for the degree of DOCTOR OF PH I LOSO PHY in Computer Science and Applications APPROVED: D.C.S. Allison D. P. Rosel le R.M. Haralick R.W. Ehrich J .W. Roach January, 1984 Blacksburg, Virginia To Naida ii WORDS OF THANKS "I' II note you in my book of memory." - William Shakespeare, King Henry VI This thesis describes the culmination of five years of prolonged study at Virginia Polytechnic Institute. During that time, have benefitted from the close companionship of many people from all different parts of the United States and the world. Without your concern, understanding, encouragement, wisdom, and prodding, completion of this document would have been an all but impossible task. To all my friends I would Ii ke to say "thank you." Some of you gave more than what one would normally expect out of friendship and curiosity, and it is an honor for me to acknowledge these individually (and not in any special order). Occasionally you meet an individual who has the ability to take several seemingly unrelated results and somehow combine them to form what is often a colorful and unique solution to a particular problem. Doug Smith is one of these rare individuals. We spent many hours discussing, amongst other things, why art is pleasing to the eye (the entropy of art), or what features programming languages would contain in the year 2050 (or even if they would exist in a form equivalent to today's languages). Doug was always willing to discuss spatial problems because of his keen interest in art. His contributions were the basis for several of the most important results in this thesis. iii Another fellow student who had a profound influence on my work was Barry Fritchman or "Super Fritch" as he was known within the Department of Computer Science. Barry was very helpful when it came to VAX system procedures and protocols. Among the qualities Barry possessed was the ability to quickly spot an incorrect approach to a problem. This no doubt saved considerable time in my research effort. Two of my neighbors in "closets" F and H, Dwight Barnette and Irene Stein, also deserve my warmest thanks for their encouragement and stimulation during those times when I firmly believed that it would be impossible to finish testing out my theories and ideas. Both Dwight and Irene were very enthusiastic about major sporting events. In fact, Irene was so proficient at picking Super Bowl and World Series winners that we accorded her the special name of "The Swami." For technical assistance and support, preparing work orders, typing letters, money for computer accounts, etc., a big thanks goes to Donna Burford, Barbara Love, Allison Taylor, Sandy Birch, and Dee Stater. Dee always made sure I received my assistantship check on time (or at least she tried, subject to the whims of the payroll department). Donna and Allison were always willing to listen to my little problems and help me out of a tough spot when I needed it. Occasionally, they even drove me to one of the local markets to buy groceries. Looking for a job is an especially time-consuming process. This, coupled with the additional responsibility of completing a dissertation, can lead to many long work days. That is why I am especially grateful iv to two former Virginia Tech colleagues, Tom Laffey and B.ill McCormack. Both helped to guide me in my search for an appropriate position in the "Silicon Valley" area of Northern California where they now work. Bill also served for a short time on my Ph.D. committee and I would like to thank him for his help then. The following names stand out amongst the many people I have had the pleasure to know while at Virginia Tech. Most were either roommates, personal friends, or fellow graduate students. Sometimes I feel as if a book could be written about the varied experiences we've shared together: Pat Bixler, Erik Turner, Ned Okie, Andie Bretzius, Mike Stinson, Dave Taylor, Bonnie Maier, Shuhab Ahmed, Peter Forbes, Art and Denise Leifer, Peggy Laffey, Dave Kanazawa, Teresa Asid, Peggy Bertsch, Mike and Betsy Heruska, Lois Remsen, Jill Foreman, Betsy Decker, Hilary Zaloom, Jeff and Valerie Facemire, T. C. Pong, Prasanna Mulgonkar, Bob Moose, and Diane Trahan of Arnold's. The family is always an integral part of any student's life. In my case two sisters, Julie and Lisa Noga, always welcomed me with open arms and affection whenever I had the opportunity to return to my home in Minnesota. They never ceased to amuse me with all their experiences, little jokes, and tidbits of gossip about family and friends. It is easy to take for granted the effort your parents spend in raising you during the formative years. We as their children believe that they have a moral responsibility to ensure a proper education, diet, and medical care at least until the age of 18. In my case I have V placed an additional ten years of responsibility upon their shoulders. Yet they have rarely, if ever, complained and have encouraged me in my academic adventures. I am deeply indebted for their love and generous support throughout the college years. I would like to thank Donald Allison, David Roselle, Bob Haralick, Roger Ehrich, and John Roach for serving as the members of my dissertation committee. Donald was the chairman of this distinguished group and it was he who suggested that my early work on convex hull algorithms might be expanded to form the basis for the set of topics discussed inside this document. The time and effort he has spent editing this document has been considerable. It would be remiss of me not to thank him for his many contributions. Much of the growth in the Computer Science Department at Virginia Tech in prestige, and in quality and size of faculty, can be attributed to his leadership as Department Chairman. Financial aid, in the form of research assistantships, part-time hourly wages, and a Tennessee Eastman Scholarship were always available because of his committment to Ph.D. (graduate student) research. David helped in several ways. As Dean of the Graduate School he was no doubt instrumental in helping me win a Cunningham Summer Fellowship. Also, his encouragement and enthusiasm during the early stages of research were critically important to me. The original research proposal called for work involving the Euclidean metric only. Bob suggested that I consider problems in the L1 (or Manhatten) metric, such as the diameter of a set. His other contribution involved the statistical nature of sorting where he insisted vi upon both a broader test-bed for performance profiling. and a clearer definition of where the majority of computation takes place in sorting algorithms. Roger made several contributions involving the style and form of the manuscript. These have helped to produce a "very readable" report of my work. John agreed to serve on my Ph.D. committee on short notice for which am very grateful. He also provided me with a place to live during the final days of this research effort. Naida Seemann led a short life of some twenty years. At the time of her tragic death she was a theater arts major at the University of Minnesota, Duluth. She was both a fine musician and actress. My memories are of a beautiful fair-haired girl of Norwegian descent, a symbol of the Minnesota Lake Region. am proud to say that she was my friend. and close companion. It is to her that I dedicate this dissertation. M.T.N. Blacksburg, VA January, 1984 vii TABLE OF CONTENTS WORDS OF THANKS iii 1 . INTRODUCTION 1 . 1 . The Interplay Between Geometry and the Computing Sciences 1 1. 2. Literature Synopsis 3 1 . 2. 1 . Minimization and Maximization Problems 5 1. 2. 2. Closest Point Problems 6 1.2.3. Inclusion Problems 9 1.2.4. Intersection and Visibility Problems 11 1.2.5. Summary 15 1.3. Thesis Outline 16 2. ALGORITHM DESIGN ISSUES 19 2. 1. Introduction 19 2.2. Specification and Representation 20 2.3. Model of Computation 22 2.4. The Analysis of Algorithms 24 2.4. 1. Analyzing Some Simple Programs 24 2.4.2. Asymptotic Notation 26 2.4.3. Performance Profiling 27 2.5. Metric Distance 28 3. SORTING AND SELECTION BY DISTRIBUTIVE PARTITIONING 31 3. 1. Introduction to Sorting 31 3.2. Distributive Partitioning Sorting 34 3.2.1. Towards a New Sorting Algorithm 34 3.2.2. The Algorithm 36 3.2.3. Implementation and Storage Requirements 37 3.2.4. Worst-case and Average-case Time Complexity 38 3.2.5. Modifications for Pointer Sorting 41 3.2.6. Comparison With Other Distributive Methods 41 3.2.7. Early Test Results and Discussion 42 3.2.8. Later Test Results 44 3.3 Selection by Distributive Parititioning 65 3.3.1. Introduction to Selection 65 3.3.2. The Algorithm 65 3.3.3. Complexity Analysis for Uniform Distributions 67 3.3.4. Results and Discussion 68 3.3.5. Multiple Selection 70 viii 4. HULL ALGORITHMS 72 4.1. Definition of the Convex Hull 72 4.2. Representation and Other Considerations 74 4.3. The Graham Algorithm 76 4.3. 1. The Method 77 4.3.2. Implementation Details 77 4.3.3. Complexity Analysis 81 4.4 Package Wrapping - The Jarvis Algorithm 81 4.4. 1. The Method 81 4.4.2.
Recommended publications
  • Parallel Techniques for Paths, Visibility, and Related Problems (Thesis)
    Purdue University Purdue e-Pubs Department of Computer Science Technical Reports Department of Computer Science 1992 Parallel Techniques for Paths, Visibility, and Related Problems (Thesis) Ziyi Danny Chen Report Number: 92-051 Chen, Ziyi Danny, "Parallel Techniques for Paths, Visibility, and Related Problems (Thesis)" (1992). Department of Computer Science Technical Reports. Paper 972. https://docs.lib.purdue.edu/cstech/972 This document has been made available through Purdue e-Pubs, a service of the Purdue University Libraries. Please contact [email protected] for additional information. PARALLEL TECHNIQUES FOR PATHS, VISIBILITY, AND RELATED PROBLEMS Ziyi Danny Chen CSD·TR-92·0S1 August 1992 PARALLEL TECHNIQUES FOR PATHS, VISIBILITY, AND RELATED PROBLEMS A Thesis Submitted to the Faculty of Purdue University by Ziyi Danny Chen In Partial Fulfillment of the Requirements for the Degree of Doctor of Philosophy August 1992 11 To the memory of my father III ACKNOWLEDGMENTS There are many people that I would like to thank. First, I would like to express my greatest appreciation to my major professor Mikhail J. Atallah. He has always given me the freedom to develop my own research interest and at the same time provided all the support, guidance, and encouragement I needed. Learning how to do research from him and discussing problems with him have become some of my most joyful experience at Purdue. Furthermore, I am greatly indebted to Professor Greg N. Frederickson and Professor Susanne E. Hambrusch, for serving as my committee members and for giving me many needed suggestions and helps during my study at Purdue. I also like to thank Professor Christoph M.
    [Show full text]
  • 30 POLYGONS Joseph O’Rourke, Subhash Suri, and Csaba D
    30 POLYGONS Joseph O'Rourke, Subhash Suri, and Csaba D. T´oth INTRODUCTION Polygons are one of the fundamental building blocks in geometric modeling, and they are used to represent a wide variety of shapes and figures in computer graph- ics, vision, pattern recognition, robotics, and other computational fields. By a polygon we mean a region of the plane enclosed by a simple cycle of straight line segments; a simple cycle means that nonadjacent segments do not intersect and two adjacent segments intersect only at their common endpoint. This chapter de- scribes a collection of results on polygons with both combinatorial and algorithmic flavors. After classifying polygons in the opening section, Section 30.2 looks at sim- ple polygonizations, Section 30.3 covers polygon decomposition, and Section 30.4 polygon intersection. Sections 30.5 addresses polygon containment problems and Section 30.6 touches upon a few miscellaneous problems and results. 30.1 POLYGON CLASSIFICATION Polygons can be classified in several different ways depending on their domain of application. In chip-masking applications, for instance, the most commonly used polygons have their sides parallel to the coordinate axes. GLOSSARY Simple polygon: A closed region of the plane enclosed by a simple cycle of straight line segments. Convex polygon: The line segment joining any two points of the polygon lies within the polygon. Monotone polygon: Any line orthogonal to the direction of monotonicity inter- sects the polygon in a single connected piece. Star-shaped polygon: The entire polygon is visible from some point inside the polygon. Orthogonal polygon: A polygon with sides parallel to the (orthogonal) coordi- nate axes.
    [Show full text]
  • Minimum Rectilinear Polygons for Given Angle Sequences ∗
    Minimum Rectilinear Polygons for Given Angle Sequences ∗ William S. Evansyz Krzysztof Fleszarx Philipp Kindermann{k Noushin Saeediy∗∗ Chan-Su Shinyy Alexander Wolff {zz Abstract A rectilinear polygon is a polygon whose edges are axis-aligned. Walking counterclock- wise on the boundary of such a polygon yields a sequence of left turns and right turns. The number of left turns always equals the number of right turns plus 4. It is known that any such sequence can be realized by a rectilinear polygon. In this paper, we consider the problem of finding realizations that minimize the perimeter or the area of the polygon or the area of the bounding box of the polygon. We show that all three problems are NP-hard in general. This answers an open question of Patrignani [CGTA 2001], who showed that it is NP-hard to minimize the area of the bounding box of an orthogonal drawing of a given planar graph. We also show that realizing polylines with minimum bounding box area is NP-hard. Then we consider the special cases of x-monotone and xy-monotone rectilinear polygons. For these, we can optimize the three objectives efficiently. 1 Introduction In this paper, we consider the problem of computing, for a given rectilinear angle sequence, a \small" rectilinear polygon that realizes the sequence. A rectilinear angle sequence S is a sequence of left (+90◦) turns, denoted by L, and right (−90◦) turns, denoted by R. We n write S = (s1; : : : ; sn) 2 fL; Rg , where n is the length of S. As we consider only rectilinear angle sequences, we usually drop the term \rectilinear." A polygon P realizes an angle sequence S if there is a counterclockwise (ccw) walk along the boundary of P such that the turns at the vertices of P , encountered during the walk, form the sequence S.
    [Show full text]
  • Optimal Uniformly Monotone Partitioning of Polygons with Holes
    Computer-Aided Design 44 (2012) 1235–1252 Contents lists available at SciVerse ScienceDirect Computer-Aided Design journal homepage: www.elsevier.com/locate/cad Optimal uniformly monotone partitioning of polygons with holes Xiangzhi Wei a, Ajay Joneja a,∗, David M. Mount b a Department of Industrial Engineering and Logistics Management, Hong Kong University of Science and Technology, Clear Water Bay, Kowloon, Hong Kong b Department of Computer Science and Institute for Advanced Computer Studies, University of Maryland, College Park, MD, USA article info a b s t r a c t Article history: Polygon partitioning is an important problem in computational geometry with a long history. In this Received 15 November 2011 paper we consider the problem of partitioning a polygon with holes into a minimum number of uniformly Accepted 11 June 2012 monotone components allowing arbitrary Steiner points. We call this the MUMC problem. We show that, given a polygon with n vertices and h holes and a scan direction, the MUMC problem relative to this Keywords: direction can be solved in time O.n log nCh log3 h/. Our algorithm produces a compressed representation Polygon subdivision of the subdivision of size O.n/, from which it is possible to extract either the entire decomposition or just Uniformly monotone subdivision the boundary of any desired component, in time proportional to the output size. When the scan direction Simple polygons 3 Network flow is not given, the problem can be solved in time O.K.n log n C h log h//, where K is the number of edges Planar graphs in the polygon's visibility graph.
    [Show full text]
  • Triangulating Polygons
    TRIANGULATING POLYGONS Vera Sacrist´an Computational Geometry Facultat d'Inform`aticade Barcelona Universitat Politcnica de Catalunya TRIANGULATING POLYGONS Computational Geometry, Facultat d'Inform`aticade Barcelona, UPC TRIANGULATING POLYGONS A polygon triangulation is the decomposition of a polygon into triangles. This is done by inserting internal diagonals. An internal diagonal is any segment... • connecting two vertices of the polygon and • completely enclosed in the polygon. Computational Geometry, Facultat d'Inform`aticade Barcelona, UPC TRIANGULATING POLYGONS A polygon triangulation is the decomposition of a polygon into triangles. This is done by inserting internal diagonals. An internal diagonal is any segment... • connecting two vertices of the polygon and • completely enclosed in the polygon. Computational Geometry, Facultat d'Inform`aticade Barcelona, UPC TRIANGULATING POLYGONS A polygon triangulation is the decomposition of a polygon into triangles. This is done by inserting internal diagonals. An internal diagonal is any segment... • connecting two vertices of the polygon and • completely enclosed in the polygon. Computational Geometry, Facultat d'Inform`aticade Barcelona, UPC TRIANGULATING POLYGONS A polygon triangulation is the decomposition of a polygon into triangles. This is done by inserting internal diagonals. An internal diagonal is any segment... • connecting two vertices of the polygon and • completely enclosed in the polygon. Computational Geometry, Facultat d'Inform`aticade Barcelona, UPC TRIANGULATING POLYGONS A polygon triangulation is the decomposition of a polygon into triangles. This is done by inserting internal diagonals. An internal diagonal is any segment... • connecting two vertices of the polygon and • completely enclosed in the polygon. Computational Geometry, Facultat d'Inform`aticade Barcelona, UPC TRIANGULATING POLYGONS A polygon triangulation is the decomposition of a polygon into triangles.
    [Show full text]
  • Multi-Goal Path Planning for Cooperative Sensing
    CZECH TECHNICAL UNIVERSITY IN PRAGUE FACULTY OF ELECTRICAL ENGINEERING Doctoral Thesis February, 2010 Jan Faigl CZECH TECHNICAL UNIVERSITY IN PRAGUE FACULTY OF ELECTRICAL ENGINEERING DEPARTMENT OF CYBERNETICS GERSTNER LABORATORY MULTI-GOAL PATH PLANNING FOR COOPERATIVE SENSING Doctoral Thesis Jan Faigl Prague, February, 2010 Ph.D. Programme: Electrical Engineering and Information Technology Branch of study: Artificial Intelligence and Biocybernetics Supervisor: Ing. Libor Pˇreuˇcil,CSc. Abstract The thesis deals with the multi-goal path planning problem. The problem is studied in the context of the inspection task of cooperating robots in a search and rescue mission. Two models of the sensing are considered: continuous and discrete. An environment is a priori known and it is represented by a polygonal domain in both approaches. The con- tinuous sensing assumes relatively inexpensive cost of sensing in comparison to the cost of motion and can be formulated as the Watchman Route Problem (WRP). The discrete sensing leads to the decoupled approach that is motivated by problems where the cost of sensing is dominant. The decoupled approach consists of two problems: the problem of finding minimal set of sensing locations, and the multi-goal path planning problem to find a path visiting the found locations. The set of sensing locations can be found as a solution of the Art Gallery Problem (AGP) or sensor placement problem if additional vis- ibility constraints have to be considered, e.g. visibility range, incident angle. The multi- goal path planning problem can be formulated as the Traveling Salesman Problem (TSP) in which paths between cities have to be traversable by the robot.
    [Show full text]
  • CS 473G Algorithmsx
    CS 473g Algorithms¬ Sariel Har-Peled December 7, 2009 ­This work is licensed under the Creative Commons Attribution-Noncommercial 3.0 License. To view a copy of this license, visit http://creativecommons.org/licenses/by-nc/3.0/ or send a letter to Creative Commons, 171 Second Street, Suite 300, San Francisco, California, 94105, USA. 2 Contents Preface 11 I NP Completeness 13 1 NP Completeness I 15 1.1 Introduction . 15 1.2 Complexity classes . 17 1.2.1 Reductions . 18 1.3 More NP-Complete problems . 19 1.3.1 3SAT ..................................... 19 1.4 Bibliographical Notes . 21 2 NP Completeness II 23 2.1 Max-Clique . 23 2.2 Independent Set . 25 2.3 Vertex Cover . 25 2.4 Graph Coloring . 26 3 NP Completeness III 29 3.1 Hamiltonian Cycle . 29 3.2 Traveling Salesman Problem . 30 3.3 Subset Sum . 31 3.4 3 dimensional Matching (3DM) . 32 3.5 Partition . 33 4 Dynamic programming 35 4.1 Basic Idea - Partition Number . 35 4.1.1 Memoization: . 37 4.2 Fibonacci numbers . 38 4.3 Edit Distance . 39 5 Dynamic programming II - The Recursion Strikes Back 43 5.1 Optimal Search Trees . 43 5.2 Optimal Triangulations . 45 3 5.3 Matrix Multiplication . 46 5.4 Longest Ascending Subsequence . 47 5.5 Pattern Matching . 47 6 Approximation algorithms 49 6.1 Greedy algorithms and approximation algorithms . 49 6.1.1 Alternative algorithm – two for the price of one . 51 6.2 Traveling Salesman Person . 51 6.2.1 TSP with the triangle inequality . 52 6.2.1.1 A 2-approximation .
    [Show full text]
  • Algorithm for Triangulating a Simple Polygon
    On the Agenda Computational Geometry The Art Gallery Problem Polygon Triangulation Chapter 3 Polygons and Triangulation 13. 23. Art Gallery Problem Observations Given a simple polygon P, say The entire interior of a convex that two points p and q can see polygon is visible from any each other if the open segment pq R interior point. lies entirely within P. p q A point guards a region R ⊆ P if p convex sees all q∈R. Given a polygon P, what is the p non star-shaped minimal number of guards required A star-shaped polygon requires to guard P, and what are their only one guard located in its locations ? kernel . (actually this is the definition of a star-shape star-shaped polygon) 33. 43. Art Gallery Problem – Easy Upper Diagonals in Polygons Bound A diagonal of a polygon P is a line segment connecting two non-adjacent vertices, which lies entirely within P. Theorem: Any polygon with n>3 vertices n-2 guards suffice: has a diagonal, which may be found in Subdivide the polygon into n-2 O( n) time. triangles (triangulation) u Proof: Find the leftmost vertex v. Connect (we will show that this is the correct number of triangles) its two neighbors u and w. If this is not a diagonal there are other vertices inside v Place one guard in each triangle. the triangle uvw. Connect v to the vertex v’ v’ furthest from the (line containing the) w Theorem : Any simple planar polygon segment uw . with n vertices has a triangulation of size n-2.
    [Show full text]
  • Computational Geometry Fall 2002
    CMSC 754: Computational Geometry Fall 2002 http://www.cs.umd.edu/~mount/754/ Instructor: Dave Mount. Office: AVW 3209. Email: [email protected]. Office phone: (301) 405–2704. Office hours: Mon 3:00–4:00, Wed 3:30–4:30. I am also available immediately after class for questions. Feel free to send me email if you cannot make these times to set up another time. Teaching Assistant: Justin Wan. Office: AVW 1151. Email: [email protected]. Office hours: Mon 2:30–3:30, Thu 5:00–6:00. Class Time: Tue, Thur 2:00-3:15. Room: CSI 1122. Course Objectives: This is an introductory course to computational geometry and its appli- cations. We will discuss techniques needed in designing and analyzing efficient algorithms for problems in geometry, including convex hulls, geometric intersections, Voronoi diagrams, Delaunay triangulations, geometric data structures, and motion planning. Text: (Required) Computational Geometry: Algorithms and Applications (2nd Edition), M. de Berg, M. van Kreveld, M. Overmars, O. Schwarzkopf, Springer-Verlag, 2000. Prerequisites: CMSC 451, or its equivalent. • Knowledge of basic algorithm design techniques, such as divide-and-conquer, greedy algorithms, dynamic programming, • Knowledge of basic analysis techniques such as asymptotic notation, solving summations and recurrences, basic probability theory. • Knowledge of basic data structures (e.g. balanced binary trees and heaps). Course Work: There will be roughly 5 homework assignments. Normally, late homeworks will not be accepted. If you think that you have a legitimate excuse for handing in a homework late, contact me before the due date. There will be a midterm and comprehensive final exam.
    [Show full text]