Fast Geometric Algorithms
Total Page:16
File Type:pdf, Size:1020Kb
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.