12
Texts and Monographs in Computer Science Editors David Gries Fred Schneider Advisory Board F.L. Bauer S.D. Brookes C.E. Leiserson M. Sipser

David Gries Fred Schneider978-1-4612-1098-6/1.pdf · P.A. Fejer and D.A. Simovici, Mathematical Foundations of Computer Science, Volume I: Sets, Relations, and Induction Melvin Fitting,

  • Upload
    others

  • View
    3

  • Download
    0

Embed Size (px)

Citation preview

Page 1: David Gries Fred Schneider978-1-4612-1098-6/1.pdf · P.A. Fejer and D.A. Simovici, Mathematical Foundations of Computer Science, Volume I: Sets, Relations, and Induction Melvin Fitting,

Texts and Monographs in Computer Science

Editors

David Gries Fred Schneider

Advisory Board F.L. Bauer

S.D. Brookes C.E. Leiserson

M. Sipser

Page 2: David Gries Fred Schneider978-1-4612-1098-6/1.pdf · P.A. Fejer and D.A. Simovici, Mathematical Foundations of Computer Science, Volume I: Sets, Relations, and Induction Melvin Fitting,

Texts and Monographs in Computer Science

Suad Alagic, Object-Oriented Database Programming

Suad Alagic, Relational Database Technology

Suad Alagic and Michael A. Arbib, The Design of Well-Structured and Correct Programs

S. Thomas Alexander, Adaptive Signal Processing: Theory and Applications

Krzysztof R. Apt and Ernst-Rudiger Olderog, Verification of Sequential and Concurrent Programs

Michael A. Arbib, A.J. Kfoury, and Robert N. Moll, A Basis for Theoretical Computer Science

Friedrich L. Bauer and Hans W6ssner, Algorithmic Language and Program Development

W. Bischofberger and G. Pomberger, Prototyping-Oriented Software Development: Concepts and Tools

Ronald V. Book and Friedrich Otto, String-Rewriting Systems

Kaare Christian, A Guide to Modula-2

Edsger W. Dijkstra, Selected Writings on Computing: A Personal Perspective

Edsger W. Dijkstra and Carel S. Scholten, Predicate Calculus and Program Semantics

W.H.J. Feijen, A.J.M. van Gasteren, D. Gries, and J. Misra, Eds., Beauty Is Our Business: A Birthday Salute to Edsger W. Dijkstra

P.A. Fejer and D.A. Simovici, Mathematical Foundations of Computer Science, Volume I: Sets, Relations, and Induction

Melvin Fitting, First-Order Logic and Automated Theorem Proving

Nissim Francez, Fairness

R.T. Gregory and E.V. Krishnamurthy, Methods and Applications of Error-Free Computation

David Gries, Ed., Programming Methodology: A Collection of Articles by Members of IFIP WG2.3

David Gries, The Science of Programming

David Gries and Fred B. Schneider, A Logical Approach to Discrete Math

(continued after index)

Page 3: David Gries Fred Schneider978-1-4612-1098-6/1.pdf · P.A. Fejer and D.A. Simovici, Mathematical Foundations of Computer Science, Volume I: Sets, Relations, and Induction Melvin Fitting,

Computational Geometry

An Introduction

Franco P. Preparata Michael Ian Shamos

With 234 Illustrations

Springer

Page 4: David Gries Fred Schneider978-1-4612-1098-6/1.pdf · P.A. Fejer and D.A. Simovici, Mathematical Foundations of Computer Science, Volume I: Sets, Relations, and Induction Melvin Fitting,

Franco P. Preparata Department of Computer Science Brown University Providence, RI 02912 U.S.A.

Series Editors:

David Gries Department of Computer Science Comell University Upson Hall Ithaca, NY 14853-7501 U.S.A.

Michael lan Shamos Department of Computer Science Carnegie-Mellon University Pittsburgh, PA 15213 U.S.A.

Fred Schneider Department of Computer Science Comell University Upson Hall Ithaca, NY 14853-7501 U.S.A.

Library of Congress Cataloging in Publication Data Preparata, Franco P.

Computational geometry. (Texts and monographs in computer science) Bibliography: p. Includes index. l. Geometry-Data processing. I. Shamos, Michael.

11. Title. III. Series. QA447.P735 1985 516'.028'54 85-8049

Prinled on acid-free paper.

© 1985 by Springer Science+Business Media New York Originally published by Springer-Verlag Berlin Heidelberg New York in 1985 Softcover reprint ofthe hardcover 1st edition 1985

All rights reserved. No part ofthis book may be translated or reproduced in any form without written permission from Springer-Verlag, 175 Fifth Avenue, New York, New York 10010, U.S.A.

Typeset by Asco Trade Typesetting Ltd., Hong Kong.

9 8 7 6

ISBN 978-1-4612-7010-2 ISBN 978-1-4612-1098-6 (eBook) DOI 10.1007/978-1-4612-1098-6

Page 5: David Gries Fred Schneider978-1-4612-1098-6/1.pdf · P.A. Fejer and D.A. Simovici, Mathematical Foundations of Computer Science, Volume I: Sets, Relations, and Induction Melvin Fitting,

To Paola and Claudia and

To Julie

Page 6: David Gries Fred Schneider978-1-4612-1098-6/1.pdf · P.A. Fejer and D.A. Simovici, Mathematical Foundations of Computer Science, Volume I: Sets, Relations, and Induction Melvin Fitting,

Preface to the Second Printing

The second printing of this book offers an excellent opportunity to correct the (forgivable) typos and the (less forgivable) imprecisions or minor errors of the first edition. Moreover, in the three years intervening between the two printings, some problems that were then open have been successfully solved and some techniques, which had just been disclosed at the time of the original edition, have acquired a prominence deserving more than a cursory sketch. Examples of these are found in the presentation of the solution of the linear­time construction of the Voronoi diagram of a convex polygon, and in the expanded discussion of the method of fractional cascading. In attending to these tasks, I have greatly benefited from the constructive advice of my friends and colleagues, among whom I wish to mention: Stephane Aubry, David Avis, Guy DiFruscia, Der-Tsai Lee, Asish Mukhopadhyay, Brad Nickerson, Arnulfo Perez, Ivan Stojmenovic, Hussein Yahia, and Si-Qing Zheng. To all of them go my sincere thanks.

April 1988 F. P. PREPARATA

Page 7: David Gries Fred Schneider978-1-4612-1098-6/1.pdf · P.A. Fejer and D.A. Simovici, Mathematical Foundations of Computer Science, Volume I: Sets, Relations, and Induction Melvin Fitting,

Preface

The objective of this book is a unified exposition of the wealth of results that have appeared-mostly in the past decade-in Computational Geometry. This young discipline-so christened in its current connotation by one of us, M.1. Shamos-has attracted enormous research interest, and has grown from a collection of scattered results to a mature body of knowledge. This achieved maturity, however, does not prevent computational geometry from being a continuing source of problems and scientific interest.

As the research endeavor reaches a level of substantial sophistication, with the emergence of powerful techniques and the beneficial interaction with combinatorial and algebraic geometry, there is increasing demand for a pedagogically organized presentation of the existing results. The demand issues both from the classroom, where experimental graduate courses are being taught from papers and notes, and from the professional environment, where several applied fields-such as computer-aided design, computer graphics, robotics, etc.-are mature for the transfer.

This book is intended to respond to this need. Basically conceived as an early graduate text, it is also directed to the professional in the applied fields mentioned above. It must be pointed out, however, that this book is not exactly a catalog of readily usable techniques, although some algorithms are eminently practical. Rather, the philosophical outlook is inherited from the discipline known as design and analysis of algorithms (or "algorithmics"), which aims at the characterization of the difficulty of individual problems. Our analyses are mainly concerned with the worst-case behavior of algo­rithms; moreover, they achieve full validity for problems of sufficiently large size (asymptotic analysis). These two features should be carefully considered in selecting an algorithm, because the technique most suitable for small sizes

Page 8: David Gries Fred Schneider978-1-4612-1098-6/1.pdf · P.A. Fejer and D.A. Simovici, Mathematical Foundations of Computer Science, Volume I: Sets, Relations, and Induction Melvin Fitting,

x Preface

is not necessarily the asymptotically optimal one, and because an algorithm inferior in the worst case may be superior in its average-case behavior.

We have attempted to offer a rather detailed panoramic view of the "continuous brand" of computational geometry, as distinct from its "discre­tized" counterpart. However, our principal objective has been a coherent discourse rather than a meticulous survey. We have attempted to partially remedy this deficiency with 'Notes and Comments' sections at the end of each chapter. Our apologies go to the numerous authors whose work has not been described or barely mentioned.

The initial core of this book was M. I. Shamos' doctoral dissertation. When in 1981 R. L. Graham suggested to one of us, (F. P. Preparata) to develop the original manuscript into a textbook, none of us had really a clear appraisal of the effort involved. Fortunately many of our colleagues and friends generously assisted in this task by patiently reading successive drafts, suggesting improvements, and catching errors. We are greatly indebted to them; we would like to explicitly thank (in alphabetical order) D. Avis, J. L. Bentley, B. Bhattacharya, B. M. Chazelle, D. P. Dobkin, M. Dyer, S. C. Eisenstat, Dan Hoey, M. Kallay, D. T. Lee, J. van Leeuwen, W. Lipski, Jr., A. J. Perlis, J. O'Rourke, L. C. Rafsky, R. Seidel, M. H. Schultz, G. T. Tous­saint, and D. Wood. We also acknowledge the partial assistance of NSF grant MCS 81-05552 (for the work ofF. P. Preparata), the Office of Naval Research, IBM Corporation, Carnegie-Mellon University, and Bell Laboratories (for the work of M. I. Shamos) and the enthusiastic cooperation of the staff at Springer-Verlag.

Finally, our thanks go to our respective wives, Rosa Maria and Julie, for their patience and support during the long hours that have led to this finished product.

May 1985 F. P. PREPARATA

M.1. SHAMOS

Page 9: David Gries Fred Schneider978-1-4612-1098-6/1.pdf · P.A. Fejer and D.A. Simovici, Mathematical Foundations of Computer Science, Volume I: Sets, Relations, and Induction Melvin Fitting,

Contents

CHAPTER 1 Introduction

1.1 1.1.1 1.1.2 1.1.3 1.l.4 1.2 1.2.1 1.2.2 1.2.3 1.2.3.1 1.2.3.2 1.3 1.3.1 1.3.2 1.3.3 1.4

Historical Perspective Complexity notions in classical geometry The theory of convex sets, metric and combinatorial geometry Prior related work Toward computational geometry Algorithmic Background Algorithms: Their expression and performance evaluation Some considerations on general algorithmic techniques Data structures The segment tree The doubly-connected-edge-list (DCEL) Geometric Preliminaries General definitions and notations Invariants under groups of linear transformations Geometry duality. Polarity Models of Computation

CHAPTER 2 Geometric Searching

2.1 2.2 2.2.1 2.2.2 2.2.2.1

Introduction to Geometric Searching Point-Location Problems General considerations. Simple cases Location of a point in a planar subdivision The slab method

I 2 4 5 6 6 7

10 II I3 15 17 17 19 24 26

36

36 41 41 45 45

Page 10: David Gries Fred Schneider978-1-4612-1098-6/1.pdf · P.A. Fejer and D.A. Simovici, Mathematical Foundations of Computer Science, Volume I: Sets, Relations, and Induction Melvin Fitting,

xii

2.2.2.2 2.2.2.3

2.2.2.4 2.3 2.3.1 2.3.2 2.3.3 2.3.4 2.4 2.5 2.6

The chain method Optimal techniques: the planar-separator method, the triangulation refinement method, and the bridged chain method The trapezoid method Range-Searching Problems General considerations The method of the multidimensional binary tree (k-D tree) A direct access method and its variants The range-tree method and its variants Iterated Search and Fractional Cascading Notes and Comments Exercises

CHAPTER 3 Convex Hulls: Basic Algorithms

3.l 3.2 3.3 3.3.1 3.3.2 3.3.3 3.3.4 3.3.5 3.3.6 3.3.7 3.4 3.4.1 3.4.2 3.4.3 3.5 3.6

Preliminaries Problem Statement and Lower Bounds Convex Hull Algorithms in the Plane Early development of a convex hull algorithm Graham's scan Jarvis's march QUICKHULL techniques Divide-and-conquer algorithms Dynamic convex hull algorithms A generalization: dynamic convex hull maintenance Convex Hulls in More Than Two Dimensions The gift-wrapping method The beneath-beyond method Convex hulls in three dimensions Notes and Comments Exercises

CHAPTER 4 Convex Hulls: Extensions and Applications

4.1 4.1.1 4.1.2 4.1.3 4.1.4 4.2 4.2.1 4.2.2 4.2.3 4.3 4.4

Extensions and Variants Average-case analysis Approximation algorithms for convex hull The problem of the maxima of a point set Convex hull of a simple polygon Applications to Statistics Robust estimation Isotonic regression Clustering (diameter of a point set) Notes and Comments Exercises

Contents

48

56 63 70 70 74 79 83 88 92 94

95

96 99

104 104 106 110 112 114 117 124 131 131 137 141 146 148

150

150 150 154 157 166 171 171 174 176 182 183

Page 11: David Gries Fred Schneider978-1-4612-1098-6/1.pdf · P.A. Fejer and D.A. Simovici, Mathematical Foundations of Computer Science, Volume I: Sets, Relations, and Induction Melvin Fitting,

Contents

CHAPTER 5 Proximity: Fundamental Algorithms

5.1 5.2 5.3 5.4 5.5

5.5.1 5.5.2 5.5.2.1 5.6 5.7 5.8

A Collection of Problems A Computational Prototype: Element Uniqueness Lower Bounds The Closest Pair Problem: A Divide-and-Conquer Approach The Locus Approach to Proximity Problems: The Voronoi Diagram A catalog ofVoronoi properties Constructing the Voronoi diagram Constructing the dividing chain Proximity Problems Solved by the Voronoi Diagram Notes and Comments Exercises

CHAPTER 6 Proximity: Variants and Generalizations

6.1 6.1.1 6.2 6.2.1 6.2.2 6.2.2.1 6.3 6.3.1. 6.3.1.1 6.3.1.2 6.3.1.3 6.3.2

6.4 6.5 6.6

Euclidean Minimum Spanning Trees Euclidean traveling salesman Planar Triangulations The greedy triangulation Constrained triangulations Triangulating a monotone polygon Generalizations of the Voronoi Diagram Higher-order Voronoi diagrams (in the plane) Elements of inversive geometry The structure of higher-order Voronoi diagrams Construction of the higher-order Voronoi diagrams Multidimensional closest-point and farthest-point Voronoi diagrams Gaps and Covers Notes and Comments Exercises

CHAPTER 7 Intersections

7.1 7.1.1 7.1.2 7.1.3 7.1.4 7.2 7.2.1 7.2.2 7.2.3

A Sample of Applications The hidden-line and hidden-surface problems Pattern recognition Wire and component layout Linear programming and common intersection of half-spaces Planar Applications Intersection of convex polygons Intersection of star-shaped polygons Intersection of line segments

xiii

185

186 191 192 195

204 205 211 216 220 222 223

226

226 230 234 235 237 239 241 242 243 244 249

253 255 262 264

266

267 267 268 269 270 271 271 277 278

Page 12: David Gries Fred Schneider978-1-4612-1098-6/1.pdf · P.A. Fejer and D.A. Simovici, Mathematical Foundations of Computer Science, Volume I: Sets, Relations, and Induction Melvin Fitting,

xiv

7.2.3.1 7.2.3.2 7.2.4 7.2.5 7.2.6 7.3 7.3.1 7.3.2 7.4 7.5

Applications Segment intersection algorithms Intersection of half-planes Two-variable linear programming Kernel of a plane polygon Three-Dimensional Applications Intersection of convex polyhedra Intersection of half-spaces Notes and Comments Exercises

CHAPTER 8 The Geometry of Rectangles

8.1 8.1.1 8.1.2 8.2 8.3 8.4 8.5 8.6 8.7 8.8 8.8.1 8.8.2 8.8.3 8.9 8.10

Some Applications of the Geometry of Rectangles Aids for VLSI design Concurrency controls in databases Domain of Validity of the Results General Considerations on Static-Mode Algorithms Measure and Perimeter of a Union of Rectangles The Contour of a Union of Rectangles The Closure of a Union of Rectangles The External Contour of a Union of Rectangles Intersections of Rectangles and Related Problems Intersections of rectangles The rectangle intersection problem revisited Enclosure of rectangles Notes and Comments Exercises

References

Author Index

Subject Index

Contents

278 279 287 290 299 306 306 315 320 322

323

323 323 325 328 330 332 340 348 353 359 359 363 366 372 373

374

385

390