• Aucun résultat trouvé

Special Topicsand Techniques

N/A
N/A
Protected

Academic year: 2022

Partager "Special Topicsand Techniques"

Copied!
952
0
0

Texte intégral

(1)
(2)

Algorithms and Theory of Computation Handbook

Second Edition

Special Topics and Techniques

Edited by

Mikhail J. Atallah

Marina Blanton

(3)

Aims and Scopes

The design and analysis of algorithms and data structures form the foundation of computer science. As current algorithms and data structures are improved and new methods are in- troduced, it becomes increasingly important to present the latest research and applications to professionals in the field.

This series aims to capture new developments and applications in the design and analysis of algorithms and data structures through the publication of a broad range of textbooks, reference works, and handbooks. We are looking for single authored works and edited compilations that will:

Appeal to students and professionals by providing introductory as well as advanced r

material on mathematical, statistical, and computational methods and techniques Present researchers with the latest theories and experimentation

r

Supply information to interdisciplinary researchers and practitioners who use algo- r

rithms and data structures but may not have advanced computer science backgrounds The inclusion of concrete examples and applications is highly encouraged. The scope of the series includes, but is not limited to, titles in the areas of parallel algorithms, approxi- mation algorithms, randomized algorithms, graph algorithms, search algorithms, machine learning algorithms, medical algorithms, data structures, graph structures, tree data struc- tures, and more. We are willing to consider other relevant topics that might be proposed by potential contributors.

Chapman & Hall/CRC

Applied Algorithms and Data Structures Series

Series Editor

Samir Khuller University of Maryland

Proposals for the series may be submitted to the series editor or directly to:

Randi Cohen Acquisitions Editor Chapman & Hall/CRC Press

6000 Broken Sound Parkway NW, Suite 300

Boca Raton, FL 33487

(4)

Algorithms and Theory of Computation Handbook, Second Edition Algorithms and Theory of Computation Handbook, Second Edition: General Concepts

and Techniques

Algorithms and Theory of Computation Handbook, Second Edition: Special Topics and Techniques

(5)

Taylor & Francis Group

6000 Broken Sound Parkway NW, Suite 300 Boca Raton, FL 33487-2742

© 2010 by Taylor and Francis Group, LLC

Chapman & Hall/CRC is an imprint of Taylor & Francis Group, an Informa business No claim to original U.S. Government works

Printed in the United States of America on acid-free paper 10 9 8 7 6 5 4 3 2 1

International Standard Book Number: 978-1-58488-820-8 (Hardback)

This book contains information obtained from authentic and highly regarded sources. Reasonable efforts have been made to publish reliable data and information, but the author and publisher cannot assume responsibility for the valid- ity of all materials or the consequences of their use. The authors and publishers have attempted to trace the copyright holders of all material reproduced in this publication and apologize to copyright holders if permission to publish in this form has not been obtained. If any copyright material has not been acknowledged please write and let us know so we may rectify in any future reprint.

Except as permitted under U.S. Copyright Law, no part of this book may be reprinted, reproduced, transmitted, or uti- lized in any form by any electronic, mechanical, or other means, now known or hereafter invented, including photocopy- ing, microfilming, and recording, or in any information storage or retrieval system, without written permission from the publishers.

For permission to photocopy or use material electronically from this work, please access www.copyright.com (http://

www.copyright.com/) or contact the Copyright Clearance Center, Inc. (CCC), 222 Rosewood Drive, Danvers, MA 01923, 978-750-8400. CCC is a not-for-profit organization that provides licenses and registration for a variety of users. For organizations that have been granted a photocopy license by the CCC, a separate system of payment has been arranged.

Trademark Notice: Product or corporate names may be trademarks or registered trademarks, and are used only for identification and explanation without intent to infringe.

Library of Congress Cataloging-in-Publication Data

Algorithms and theory of computation handbook. Special topics and techniques / editors, Mikhail J.

Atallah and Marina Blanton. -- 2nd ed.

p. cm. -- (Chapman & Hall/CRC applied algorithms and data structures series) Includes bibliographical references and index.

ISBN 978-1-58488-820-8 (alk. paper)

1. Computer algorithms. 2. Computer science. 3. Computational complexity. I. Atallah, Mikhail J.

II. Blanton, Marina. III. Title. IV. Series.

QA76.9.A43A433 2009

005.1--dc22 2009017978

Visit the Taylor & Francis Web site at http://www.taylorandfrancis.com and the CRC Press Web site at http://www.crcpress.com

(6)

Contents

Preface . . . ix Editors . . . xi Contributors . . . xiii

1

Computational Geometry I

D.T. Lee . . . 1-1

2

Computational Geometry II

D.T. Lee . . . 2-1

3

Computational Topology

Afra Zomorodian . . . 3-1

4

Robot Algorithms

Konstantinos Tsianos, Dan Halperin, Lydia Kavraki, and

Jean-Claude Latombe . . . 4-1

5

Vision and Image Processing Algorithms

Concettina Guerra . . . 5-1

6

Graph Drawing Algorithms

Peter Eades, Carsten Gutwenger, Seok-Hee Hong, and Petra Mutzel . . . 6-1

7

Algorithmics in Intensity-Modulated Radiation Therapy

Danny Z. Chen and Chao Wang . . . 7-1

8

VLSI Layout Algorithms

Andrea S. LaPaugh . . . 8-1

9

Cryptographic Foundations

Yvo Desmedt . . . 9-1

10

Encryption Schemes

Yvo Desmedt . . . 10-1

11

Cryptanalysis

Samuel S. Wagstaff, Jr. . . . 11-1

12

Crypto Topics and Applications I

Jennifer Seberry, Chris Charnes, Josef Pieprzyk, and Rei Safavi-Naini . . . 12-1

v

(7)

13

Crypto Topics and Applications II

Jennifer Seberry, Chris Charnes, Josef Pieprzyk, and Rei Safavi-Naini . . . 13-1

14

Secure Multiparty Computation

Keith B. Frikken . . . 14-1

15

Voting Schemes

Berry Schoenmakers . . . 15-1

16

Auction Protocols

Vincent Conitzer . . . 16-1

17

Pseudorandom Sequences and Stream Ciphers

Andrew Klapper . . . 17-1

18

Theory of Privacy and Anonymity

Valentina Ciriani, Sabrina De Capitani di Vimercati, Sara Foresti, and

Pierangela Samarati . . . 18-1

19

Database Theory: Query Languages

Nicole Schweikardt, Thomas Schwentick, and Luc Segoufin . . . 19-1

20

Scheduling Algorithms

David Karger, Cliff Stein, and Joel Wein . . . 20-1

21

Computational Game Theory: An Introduction

Paul G. Spirakis and Panagiota N. Panagopoulou . . . 21-1

22

Artificial Intelligence Search Algorithms

Richard E. Korf . . . 22-1

23

Algorithmic Aspects of Natural Language Processing

Mark-Jan Nederhof and Giorgio Satta . . . 23-1

24

Algorithmic Techniques for Regular Networks of Processors

Russ Miller and Quentin F. Stout . . . 24-1

25

Parallel Algorithms

Guy E. Blelloch and Bruce M. Maggs . . . 25-1

26

Self-Stabilizing Algorithms

Sébastien Tixeuil . . . 26-1

27

Theory of Communication Networks

Gopal Pandurangan and Maleq Khan . . . 27-1

(8)

Contents vii

28

Network Algorithmics

George Varghese . . . 28-1

29

Algorithmic Issues in Grid Computing

Yves Robert and Frédéric Vivien . . . 29-1

30

Uncheatable Grid Computing

Wenliang Du, Mummoorthy Murugesan, and Jing Jia . . . 30-1

31

DNA Computing: A Research Snapshot

Lila Kari and Kalpana Mahalingam . . . 31-1

32

Computational Systems Biology

T.M. Murali and Srinivas Aluru . . . 32-1

33

Pricing Algorithms for Financial Derivatives

Ruppa K. Thulasiram and Parimala Thulasiraman . . . 33-1 Index . . . I-1

(9)
(10)

Preface

This handbook aims to provide a comprehensive coverage of algorithms and theoretical computer science for computer scientists, engineers, and other professionals in related scientific and engi- neering disciplines. Its focus is to provide a compendium of fundamental topics and techniques for professionals, including practicing engineers, students, and researchers. The handbook is organized along the main subject areas of the discipline, and also contains chapters from application areas that illustrate how the fundamental concepts and techniques come together to provide efficient solutions to important practical problems.

Thecontents of each chapter were chosen in such a manner as to help the computer professional and the engineer in finding significant information on a topic of his or her interest. While the reader may not find all the specialized topics in a given chapter, nor will the coverage of each topic be exhaustive, the reader should be able to find sufficient information for initial inquiries and a number of references to the current in-depth literature. In addition to defining terminology and presenting the basic results and techniques for their respective topics, the chapters also provide a glimpse of the major research issues concerning the relevant topics.

Compared to the first edition, this edition contains 21 new chapters, and therefore provides a significantly broader coverage of the field and its application areas. This, together with the updating and revision of many of the chapters from the first edition, has made it necessary to move into a two-volume format.

It is a pleasure to extend our thanks to the people and organizations who made this handbook possible. First and foremost the chapter authors, whose dedication and expertise are at the core of this handbook; the universities and research laboratories with which the authors are affiliated for providing the computing and communication facilities and the intellectual environment for this project; Randi Cohen and her colleagues at Taylor & Francis for perfect organization and logistics that spared us the tedious aspects of such a project and enabled us to focus on its scholarly side; and, last but not least, our spouses and families, who provided moral support and encouragement.

Mikhail Atallah Marina Blanton

ix

(11)
(12)

Editors

Mikhail Atallahobtained his PhD from The Johns Hopkins University in 1982 and immediately thereafter joined the computer science department at Purdue University, Klest Lafayette Indiana, where he currently holds the rank of distinguished professor of computer science. His research inter- ests include information security, distributed computing, algorithms, and computational geometry.

A fellow of both the ACM and the IEEE, Dr. Atallah has served on the editorial boards of top journals and on the program committees of top conferences and workshops. He was a keynote and invited speaker at many national and international meetings, and a speaker in the Distinguished Colloquium Series of top computer science departments on nine occasions. In 1999, he was selected as one of the best teachers in the history of Purdue and was included in a permanent wall display of Purdue’s best teachers, past and present.

Marina Blantonis an assistant professor in the computer science and engineering department at the University of Notre Dame, Notre Dame, Indiana. She holds a PhD from Purdue University.

Her research interests focus on information security, privacy, and applied cryptography, and, in particular, span across areas such as privacy-preserving computation, authentication, anonymity, and key management. Dr. Blanton has numerous publications at top venues and is actively involved in program committee work.

xi

(13)
(14)

Contributors

Srinivas Aluru

Department of Electrical and Computer Engineering Iowa State University Ames, Iowa

and

Department of Computer Science and Engineering

Indian Institute of Technology Bombay, India

Guy E. Blelloch

School of Computer Science Carnegie Mellon University Pittsburgh, Pennsylvania Chris Charnes

Institute of Applied Physics and CASED Technical University Darmstadt Darmstadt, Germany Danny Z. Chen

Department of Computer Science and Engineering

University of Notre Dame Notre Dame, Indiana Valentina Ciriani

Dipartimento di Technologie dell’Informazione

Università degli Studi di Milano Crema, Italy

Vincent Conitzer

Department of Computer Science and Department of Economics Duke University

Durham, North Carolina

Sabrina De Capitani di Vimercati Dipartimento di Technologie

dell’Informazione

Università degli Studi di Milano Crema, Italy

Yvo Desmedt

Department of Computer Science University College London London, United Kingdom Wenliang Du

Department of Electrical Engineering and Computer Science

Syracuse University Syracuse, New York Peter Eades

School of Information Technologies University of Sydney

Sydney, New South Wales, Australia Sara Foresti

Dipartimento di Technologie dell’Informazione

Università degli Studi di Milano Crema, Italy

Keith B. Frikken

Department of Computer Science and Software Engineering Miami University

Oxford, Ohio Concettina Guerra College of Computing

Georgia Institute of Technology Atlanta, Georgia

Carsten Gutwenger

Department of Computer Science Dortmund University of Technology Dortmund, Germany

Dan Halperin

School of Computer Science Tel-Aviv University Tel-Aviv, Israel Seok-Hee Hong

School of Information Technologies University of Sydney

Sydney, New South Wales, Australia

xiii

(15)

Jing Jia

Department of Electrical Engineering and Computer Science

Syracuse University Syracuse, New York David Karger

Computer Science and Artificial Intelligence Laboratory

Massachusetts Institute of Technology Cambridge, Massachusetts

Lila Kari

Department of Computer Science University of Western Ontario London, Ontario, Canada Lydia Kavraki

Department of Computer Science Rice University

Houston, Texas Maleq Khan

Department of Computer Science Purdue University

West Lafayette, Indiana Andrew Klapper

Department of Computer Science University of Kentucky

Lexington, Kentucky Richard E. Korf

Computer Science Department University of California Los Angeles, California Andrea S. LaPaugh

Department of Computer Science Princeton University

Princeton, New Jersey Jean-Claude Latombe

Computer Science Department Stanford University

Stanford, California

D.T. Lee

Institute of Information Science and Research Center for Information Technology

Innovation Academia Sinica Taipei, Taiwan Bruce M. Maggs

Department of Computer Science Duke University

Durham, North Carolina and

Akamai Technologies Cambridge, Massachusetts Kalpana Mahalingam Department of Mathematics Indian Institute of Technology Guindy, Chennai, India Russ Miller

Department of Computer Science and Engineering

State University of New York Buffalo, New York

T.M. Murali

Department of Computer Science Virginia Polytechnic Institute and

State University Blacksburg, Virginia Mummoorthy Murugesan

Department of Electrical Engineering and Computer Science

Syracuse University Syracuse, New York Petra Mutzel

Department of Computer Science Dortmund University of Technology Dortmund, Germany

Mark-Jan Nederhof School of Computer Science University of St Andrews

St. Andrews, Scotland, United Kingdom

(16)

Contributors xv

Panagiota N. Panagopoulou

Research Academic Computer Technology Institute

University Campus, Rion Patras, Greece

and

Department of Computer Engineering and Informatics

Patras University Patras, Greece Gopal Pandurangan

Department of Computer Science Purdue University

West Lafayette, Indiana Josef Pieprzyk

Department of Computer Science Macquarie University

Sydney, New South Wales, Australia Yves Robert

Laboratoire del’Informatique du Parallélisme

Ecole Normale Supérieure de Lyon Lyon, France

Rei Safavi-Naini

Department of Computer Science University of Calgary

Calgary, Alberta, Canada Pierangela Samarati Dipartimento di Technologie

dell’Informazione

Università degli Studi di Milano Crema, Italy

Giorgio Satta

Department of Information Engineering University of Padua

Padua, Italy

Berry Schoenmakers

Department of Mathematics and Computer Science

Technical University of Eindhoven Eindhoven, the Netherlands

Nicole Schweikardt Institut für Informatik

Goethe-Universität Frankfurt am Main Frankfurt, Germany

Thomas Schwentick Fakultät für Informatik

Technische Universität Dortmund Dortmund, Germany

Jennifer Seberry

Centre for Computer Security Research University of Wollongong

Wollongong, New South Wales, Australia Luc Segoufin

LSV

INRIA and ENS Cachan Cachan, France

Paul G. Spirakis

Research Academic Computer Technology Institute

University Campus, Rion Patras, Greece

and

Department of Computer Engineering and Informatics

Patras University Patras, Greece Cliff Stein

Department of Computer Science Dartmouth College

Hanover, New Hampshire Quentin F. Stout

Department of Electrical Engineering and Computer Science

University of Michigan Ann Arbor, Michigan Ruppa K. Thulasiram

Department of Computer Science University of Manitoba

Winnipeg, Manitoba, Canada Parimala Thulasiraman

Department of Computer Science University of Manitoba

Winnipeg, Manitoba, Canada

(17)

Sébastien Tixeuil

Laboratory LIP6–CNRS UMR 7606 Université Pierre et Marie Curie Paris, France

Konstantinos Tsianos

Department of Computer Science Rice University

Houston, Texas George Varghese

Department of Computer Science University of California

San Diego, California Frédéric Vivien

Laboratoire del’Informatique du Parallélisme (INRIA)

Ecole Normale Supérieure de Lyon Lyon, France

Samuel S. Wagstaff, Jr.

Department of Computer Science Purdue University

West Lafayette, Indiana Chao Wang

Department of Computer Science and Engineering

University of Notre Dame Notre Dame, Indiana Joel Wein

Department of Computer and Information Science

Polytechnic Institute of New York University Brooklyn, New York

Afra Zomorodian

Department of Computer Science Dartmouth College

Hanover, New Hampshire

(18)

1

Computational Geometry I

D.T. Lee

Academia Sinica

1.1 Introduction. . . . 1-1 1.2 Convex Hull. . . . 1-2

Convex Hulls in Two and Three DimensionsConvex Hulls inkDimensions,k>3Convex Layers of a Planar Set Applications of Convex Hulls

1.3 Maxima Finding. . . . 1-10 Maxima in Two and Three DimensionsMaxima in Higher DimensionsMaximal Layers of a Planar Set

1.4 Row Maxima Searching in Monotone Matrices. . . . 1-16 1.5 Decomposition. . . . 1-18

TrapezoidalizationTriangulationOther Decompositions 1.6 Research Issues and Summary. . . . 1-27 1.7 Further Information. . . . 1-27 Defining Terms. . . . 1-28 References. . . . 1-29

1.1 Introduction

Computational geometry, since its inception [66] in 1975,has received a great deal of attention from researchers in the area of design and analysis of algorithms. It has evolved into a discipline of its own. It is concerned with the computational complexity of geometric problems that arise in various disciplines such as pattern recognition, computer graphics, geographical information system, computer vision, CAD/CAM, robotics, VLSI layout, operations research, and statistics. In contrast with the classical approach to proving mathematical theorems about geometry-related problems, this discipline emphasizes the computational aspect of these problems and attempts to exploit the underlying geometric properties possible, e.g., the metric space, to derive efficient algorithmic solutions.

An objective of this discipline in the theoretical context is to study the computational complex- ity (giving lower bounds) of geometric problems, and to devise efficient algorithms (giving upper bounds) whose complexity preferably matches the lower bounds. That is, not only are we interested in the intrinsic difficulty of geometric computational problems under a certain computation model, but we are also concerned with the algorithmic solutions that are efficient or provably optimal in the worst or average case. In this regard, the asymptotic time (or space) complexity of an algorithm, i.e., the behavior of an algorithm, as the input size approaches infinity, is of interest. Due to its applications to various science and engineering related disciplines, researchers in this field have begun to address theefficacyof the algorithms, the issues concerningrobustnessandnumerical sta- bility[33,82], and the actual running times of their implementations. In order to value and get better understanding of the geometric algorithms in action, a computational problem solving environment 1-1

(19)

has been developed at the Institute of Information Science and the Research Center for Information Technology Innovation, Academia Sinica, Taiwan. Actual implementations of several geomet- ric algorithms have been incorporated into a Java-based algorithm visualization and debugging software system, dubbedGeoBuilder(http://webcollab.iis.sinica.edu.tw/Components/GeoBuilder/), which supports remote compilation, visualization of intermediate execution results, and other run- time features, e.g., visual debugging, etc. This system facilitates geometric algorithmic researchers in testing their ideas and demonstrating their findings in computational geometry. GeoBuilder sys- tem is embedded into a knowledge portal [51], called OpenCPS (Open Computational Problem Solving), (http://www.opencps.org/) and possesses three important features. First, it is a platform- independent software system based on Java’s promise of portability, and can be invoked by Sun’s Java Web Start technology in any browser-enabled environment. Second, it has the collabora- tion capability for multiple users to concurrently develop programs, manipulate geometric objects, and control the camera. Finally, its three-dimensional (3D) geometric drawing bean provides an optional function that can automatically position the camera to track 3D objects during algo- rithm visualization [79]. GeoBuilder develops its rich client platform based on Eclipse RCP and has already built in certain functionalities such as remote addition, deletion, and saving of files as well as remote compiling, and execution of LEDA C/C++ programs, etc., based on a multipage editor. Other notable geometric software projects include, among others, CGAL (http://www.cgal.

org/) [32] and LEDA (http://www.algorithmic-solutions.com/leda/about/index.htm.) [60].

In this and the following chapter (Chapter 2) we concentrate mostly on the theoretical development of this field in the context of sequential computation, and discuss a number of typical topics and the algorithmic approaches. We will adopt therealRAM (random access machine) model of computation in which all arithmetic operations, comparisons,kth root, exponential, or logarithmic functions take unit time.

1.2 Convex Hull

The convex hull of a set of points inkis the most fundamental problem in computational geometry.

Given is a set of points ink, and we are interested in computing its convex hull, which is defined to be the smallest convex set containing these points. There are two ways to represent a convex hull.

An implicit representation is to list all the extreme points, whereas an explicit representation is to list all the extremed-faces of dimensionsd=0, 1,. . .,k−1. Thus, the complexity of any convex hull algorithm would have two parts, computation part and the output part. An algorithm is said to be output-sensitive if its complexity depends on the size of the output.

1.2.1 Convex Hulls in Two and Three Dimensions

For an arbitrary set ofnpoints in two and three dimensions, we can compute its convex hull using the Graham scan,gift-wrappingmethod, ordivide-and-conquerparadigm, which are briefly described below.

Note that the convex hull of an arbitrary setSof points in two dimensions is a convex polygon.

We’ll describe algorithms that compute theupper hullofS, since the convex hull is just the union of the upper and lower hulls. Letv0denote the point with minimumx-coordinate; if there are more than one, pick the one with the maximumy-coordinate. Letvn1 be similarly defined except that it denotes the point with the maximumx-coordinate. In two dimensions, the upper hull consists of two vertical lines passing throughv0andvn1, respectively and a sequence of edges, known as a polygonal chain,C= {vji−1,vji|i=1, 2,. . .,k}, wherevj0 =v0andvjk =vn1, such that the entire setSof points lies on one side of orbelowthe linesLicontaining each edgevji−1,vji. See Figure 1.1a for an illustration of the upper hull. The lower hull is similarly defined.

(20)

Computational Geometry I 1-3

(a)

Pa

(b) Pb

Pc

Pd

Pe

Pf

FIGURE 1.1 The upper hull of a set of points (a) and illustration of the Graham scan (b).

TheGraham scancomputes the convex hull by (1) sorting the input set of points in ascending order of theirx-coordinates (in case of ties, in ascending order of theiry-coordinates), (2) connecting these points into a polygonal chainPstored as a doubly linked listL, and (3) performing a linear scan to compute the upper hull of the polygon [66].

The triple(vi,vj,vk)of points is said to form arightturn if and only if the determinant

xi yi 1 xj yj 1 xk yk 1

<0,

where(xi,yi)are thex- andy-coordinates ofvi. If the determinant is positive, then the triple(vi,vj,vk) of points is said to form aleftturn. The pointsvi,vj, andvkare collinear if the determinant is zero.

This is also known as the side test, determining on which side of the line defined by pointsviandvj

the pointvklies.

It is obvious that when we scan points inLin ascending order ofx-coordinate, the middle point of a triple(vi,vj,vk)that does not form a right turn is not on the upper hull and can be deleted. The following is the algorithm.

ALGORITHMGRAHAM_SCAN

Input: A setSof points sorted in lexicographically ascending order of their(x,y)-coordinate values.

Output: A sorted listLof points in ascendingx-coordinates.

begin

if(|S| ==2)return(v0,vn−1);

i=0;vn−1=next(vn−1); /* set sentinel */

pa=v0;pb=next(pa),pc=next(pb);

while(pb=vn1)do

if(pa,pb,pc)forms a right turn then begin/*advance*/

pa=pb;pb=pc; pc=next(pb);

end

else begin/*backtrack*/

deletepb;

(21)

if(pa=v0) thenpa=prev(pa);

pb=next(pa);pc=next(pb);

end pt =next(v0);

L= {v0,pt};

while(pt=vn−1)do begin

pu=next(pt);

L=L∪ {pt,pu};

pt =pu; end;

return(L);

end.

Step (i) being the dominating step, ALGORITHMGRAHAM_SCAN, takesO(nlogn)time. Figure 1.1b shows the initial listLand vertices not on the upper hull are removed fromL. For example,pbis removed since(pa,pb,pc)forms a left turn;pcis removed since(pa,pc,pd)forms a left turn;pd, and peare removed for the same reason.

One can also use thegift-wrappingtechnique to compute the upper hull. Starting with a vertex that is known to be on the upper hull, say the pointv0 =vi0. We sweep clockwise the half-line emanating fromv0in the direction of the positivey-axis. The first pointvi1this half-line hits will be the next point on the upper hull. We then march tovi1, repeat the same process by sweeping clockwise the half-line emanating fromvi1in the direction fromvi0tovi1, and find the next vertexvi2. This process terminates when we reachvn1. This is similar to wrapping an object with arope.Finding the next vertex takes time proportional to the number of points not yet known to be on the upper hull.

Thus, the total time spent isO(nH), whereHdenotes the number of points on the upper hull. The gift-wrapping algorithm is output-sensitive, and is more efficient than the ALGORITHMGRAHAM_SCAN

if the number of points on the upper hull is small, i.e.,O(logn).

One can also compute the upper hull recursively by divide-and-conquer. This method is more amenable to parallelization. The divide-and-conquer paradigm consists of the following steps.

ALGORITHMUPPER_HULL_D&C (2d-Point S) Input: A setSof points.

Output: A sorted listLof points in ascendingx-coordinates.

1. If|S| ≤3, compute the upper hull UH(S)explicitly and return (UH(S)).

2. DivideSby a vertical lineLinto two approximately equal subsetsSlandSr such that SlandSrlie, respectively, to the left and to the right ofL.

3. UH(Sl)=Upper_Hull_D&C(Sl).

4. UH(Sr)=Upper_Hull_D&C(Sr).

5. UH(S)=Merge(UH(Sl),UH(Sr)).

6. return (UH(S)).

The key step is the Merge of two upper hulls, each of which is the solution to a subproblem derived from the recursive step. These two upper hulls are separated by a vertical lineL. The Merge step basically calls for computation of a common tangent, calledbridgeover lineL, of these two upper hulls (Figure 1.2).

The computation of the bridge begins with a segment connecting the rightmost pointlof the left upper hull to the leftmost pointrof the right upper hull, resulting in a sorted listL. Using the Graham

(22)

Computational Geometry I 1-5

q p

l r

Sr Sl

v0

Upper-hull for Sr

Upper-hull for Sl

Bridge over

vn–1

FIGURE 1.2 The bridgep,qover the vertical lineL.

scan one can obtain in linear time the two endpoints of the bridge, (p,qshown in Figure 1.2), such that the entire set of points lies on one side of the line, calledsupporting line,containing the bridge.

The running time of the divide-and-conquer algorithm is easily shown to beO(nlogn)since the Mergestep can be done inO(n)time.

A more sophisticated output-sensitive and optimal algorithm which runs inO(nlogH)time has been developed by Kirkpatrick and Seidel [48]. It is based on a variation of the divide-and- conquer paradigm, called divide-and-marriage-before-conquest method. It has been shown to be asymptotically optimal; a lower bound proof ofΩ(nlogH)can be found in [48]. The main idea in achieving the optimal result is that of eliminating redundant computations. Observe that in the divide-and-conquer approach after the bridge is obtained, some vertices belonging to the left and right upper hulls that are below the bridge are deleted. Had we known that these vertices are not on the final hull, we could have saved time without computing them. Kirkpatrick and Seidel capitalized on this concept and introduced the marriage-before-conquest principle putting Merge step before the two recursive calls.

The divide-and-conquer scheme can be easily generalized to three dimensions. The Merge step in this case calls for computing common supporting faces that wrap two recursively computed convex polyhedra. It is observed by Preparata and Shamos [66] that the common supporting faces are computed from connecting two cyclic sequences of edges, one on each polyhedron (Figure 1.3).

See [3] for a characterization of the two cycles of seam edges. The computation of these supporting

Common supporting faces

FIGURE 1.3 Common supporting faces of two disjoint convex polyhedra.

(23)

faces can be accomplished in linear time, giving rise to anO(nlogn)time algorithm. By applying the marriage-before-conquest principle Edelsbrunner and Shi [28] obtained anO(nlog2H)algorithm.

The gift-wrapping approach for computing the convex hull in three dimensions would mimic the process of wrapping a gift with a piece of paper. One starts with a plane supporting S, i.e., a plane determined by three points ofSsuch that the entire set of points lie on one side. In general, the supporting face is a triangleΔ(a,b,c). Pivoting at an edge, say(a,b)of this triangle, one rotates the plane in space until it hits a third pointv, thereby determining another supporting faceΔ(a,b,v).

This process repeats until the entire set of points are wrapped by a collection of supporting faces.

These supporting faces are called 2-faces, the edges common to two supporting faces, 1-faces, and the vertices (or extreme points) common to 2-faces and 1-faces are called 0-faces. The gift-wrapping method has a running time ofO(nH), whereHis the total number ofi-faces,i=0, 1, 2.

The following optimal output-sensitive algorithm that runs inO(nlogH)time in two and three dimensions is due to Chan [13]. It is a modification of thegift-wrappingmethod (also known as the Jarvis’ March method) and uses agroupingtechnique.

ALGORITHM2DHULL(S) 1. Fori=1, 2,. . .do

2. P←HULL2D(S,H0,H0), whereH0=min{22i,n}

3. IfP=nilthen returnP.

FUNCTIONHULL2D(S,m,H0)

1. PartitionSinto subsetsS1,S2,. . .,Sn

m, each of size at mostm 2. Fori=1, 2,. . .,mndo

3. ComputeCH(Si)and preprocess it in a suitable data structure 4. p0(0,−∞),p1←the rightmost point ofS

5. Forj=1, 2,. . .,H0do 6. Fori=1, 2,. . .,mndo

7. Compute a pointqiSithat maximizes∩pj1pjqi

8. pj+1←a pointqfrom{q1,. . .,qn

m}maximizing∩pj1pjq 9. Ifpj+1=p1then return list(p1,. . .,pj)

10. returnnil

Let us analyze the complexity of the algorithm. In Step 2, we use an O(mlogm) time algo- rithm for computing the convex hull for each subset of m points, e.g., Graham’s scan for S in two dimensions, and Preparata–Hong algorithm for S in three dimensions. Thus, it takes O((mn)mlogm) = O(nlogm) time. In Step 5 we build a suitable data structure that supports the computation of the supporting vertex or supporting face in logarithmic time. In two dimensions we can use an array that stores the vertices on the convex hull in say, clockwise order. In three dimen- sions we use Dobkin–Kirkpatrick hierarchical representation of the faces of the convex hull [24].

Thus, Step 5 takes H0(mn)O(logm)time. Settingm = H0 gives anO(nlogH0)time. Note that settingm=1 we have the Jarvis’ March, and settingm=nthe two-dimensional (2D) convex hull algorithm degenerates to the Graham’s scan. Since we do not knowHin advance, we use in Step 2 of ALGORITHM2DHULL(S)a sequenceHi=22isuch thatH1+ · · · +Hk−1<HH1+ · · · +Hkto guess it. The total running time is

O k

i=1

nlogHi

=O

log logH i=1

n2i

⎠=O nlogH

(24)

Computational Geometry I 1-7

1.2.2 Convex Hulls inkDimensions,k>3

For convex hulls of higher dimensions, Chazelle [16] showed that the convex hull can be computed in timeO(nlogn+nk/2), which is optimal in all dimensionsk ≥ 2 in the worst case. But this result is insensitive to the output size. The gift-wrapping approach generalizes to higher dimensions and yields an output-sensitive solution with running timeO(nH), whereHis the total number of i-faces,i=0, 1,. . .,k−1 andH=O(nk/2)[27]. One can also usebeneath–beyondmethod [66]

of adding points one at a time in ascending order along one of the coordinate axis.We compute the convex hull CH(Si−1)for pointsSi−1 = {p1,p2,. . .,pi−1}. For each added pointpiwe update CH(Si−1)to get CH(Si)fori = 2, 3,. . .,nby deleting thoset-faces,t = 0, 1,. . .,k−1, that are internal to CH(Si−1∪ {pi}). It has been shown by Seidel [27] thatO(n2+Hlogh)time is sufficient, where his the number of extreme points. Later Chan [13] obtained an algorithm based on gift- wrapping method using the data structures for ray-shooting queries in polytopes developed by Agarwal and Matoušek [1] and refined by Matoušek and Schwarzkopf [58], that runs inO(nlogH+

(nH)1−1/(k/2+1)logO(1)n)time. Note that the algorithm is optimal whenk=2, 3. In particular, it is optimal whenH=O(n1/(k/2)/logδn)for a sufficiently largeδ.

We conclude this section with the following theorem [13].

THEOREM 1.1 The convex hull of a set S of n points inkcan be computed in O(nlogH)time for k =2or k=3, and in O(nlogH+(nH)11/(k/2+1)logO(1)n)time for k>3, whereHis the number of i-faces, i=0, 1,. . .,k−1.

1.2.3 Convex Layers of a Planar Set

The convex layersC(S)of a setSofnpoints in the Euclidean plane is obtained by a process, known asonion peeling,i.e., compute the convex hull ofSand remove its vertices fromS, untilSbecomes empty. Figure 1.4 shows the convex layer of a point set. This onion peeling process of a point set is central in the study of robust estimators in statistics, in which the outliers, points lying on the outermost convex layers, should be removed. In this section we describe an efficient algorithm due to Chazelle [14] that runs in optimalO(nlogn)time.

As described in Section 1.2.1, each convex layer ofC(S)can be decomposed into two convex polygonal chains, called upper and lower hulls (Figure 1.5).

FIGURE 1.4 Convex layers of a point set.

If the points ofSare not givena priori,the algorithm can be made on-line by adding an extra step of checking if the newly added point is internal or external to the current convex hull. If it is internal, just discard it.

(25)

FIGURE 1.5 Decomposition of each convex layer into upper and lower hulls.

0

20, 26

20, 22 20, 21

20 31

15 16, 20 8, 20

24 29 21 25

9 23

14 18 11 2 5

0 1

9 4 3 7

8

6 10 13

12 15 17 16 20

22 26

27 28

30 31

(a) (b)

FIGURE 1.6 The hull graph of upper hull (a) and a complete binary tree representation (b).

Let l and r denote the points with the minimum and maximum x-coordinate, respectively, in a convex layer. The upper (respectively, lower) hull of this layer runs clockwise (respectively, counterclockwise) fromltor. The upper and lower hulls are the same if the convex layer has one or two points. Assume that the setSof pointsp0,p1,. . .,pn1are ordered in nondescending order of theirx-coordinates. We shall concentrate on the computation of upper hulls ofC(S); the other case is symmetric. Consider the complete binary treeT(S)with leavesp0,p1,. . .,pn1from left to right. LetS(v)denote the set of points stored at the leaves of the subtree rooted at nodevofT and letU(v)denote its upper hull of the convex hull ofS(v). Thus,U(ρ), whereρdenotes the root ofT, is the upper hull of the convex hull ofSin the outermost layer. The union of all the upper hullsU(v) for all nodesvis a tree, calledhull graph[14]. (A similar graph is also computed for the lower hull of the convex hull.) To minimize the amount of space, at each internal nodevwe store the bridge (common tangent) connecting a point inU(vl)and a point inU(vr), wherevlandvrare the left and right children of nodev, respectively. Figure 1.6a and b illustrates the binary treeT and the corresponding hull graph, respectively.

Computation of the hull graph proceeds from bottom up. Computing the bridge at each node takes time linear in the number of vertices on the respective upper hulls in the left and right subtrees. Thus, the total time needed to compute the hull graph isO(nlogn). The bridges computed at each nodev which are incident upon a vertexpkare naturally separated into two subsets divided by the vertical lineL(pk)passing throughpk. Those on the left are arranged in a listL(pk)in counterclockwise order from the positiveydirection ofL(pk), and those on the right are arranged in a listR(pk)in clockwise order. This adjacency list at each vertex in the hull graph can be maintained fairly easily.

Suppose the bridge at nodevconnects vertexpjin the left subtree and vertexpkin the right subtree.

The edgepj,pkwill be inserted at thefirstposition in the current listsR(pj)andL(pk). That is, edge

(26)

Computational Geometry I 1-9 pj,pkis thetopedge in both listsR(pj)andL(pk). It is easy to retrieve the vertices on the upper hull of the outermost layer from the hull graph beginning at the root node ofT.

To compute the upper hull of the next convex layer, one needs to remove those vertices on the first layer (including those vertices in the lower hull). Thus, update of the hull graph includes deletion of vertices on both upper hull and lower hull. Deletions of vertices on the upper hull can be performed in an arbitrary order. But if deletions of vertices on the lower hull from the hull graph are done in say clockwise order, then the update of the adjacency list of each vertexpkcan be made easy, e.g., R(pk)= ∅. The deletion of a vertexpkon the upper hull entails removal of edges incident onpkin the hull graph. Letv1,v2,. . .,vlbe the list of internal nodes on the leaf-to-root path frompk. The edges inL(pk)andR(pk)are deleted from bottom up inO(1)time each, i.e., the top edge in each list gets deleted last. Figure 1.6b shows the leaf-to-root path when vertexp20is deleted. Figure 1.7a–f shows the updates of bridges whenp20is deleted and Figure 1.7g is the final upper hull after the update is finished. It can be shown that the overall time for deletions can be done inO(nlogn)time [14].

THEOREM 1.2 The convex layers of a set of n points in the plane can be computed in O(nlogn) time.

Nielsen [64] considered the problem of computing the firstklayers of convex hull of a planar point setSthat arises in statistics and pattern recognition, and gave anO(nlogHk)time algorithm, whereHkdenotes the number of points on the firstklayers of convex hull ofS, using the grouping scheme of Chan [13].

1.2.4 Applications of Convex Hulls

Convex hulls have applications in clustering, linear regression, and Voronoi diagrams (see Chapter 2).

The following problems have solutions derived from the convex hull.

Problem C1 (Set Diameter) Given a setS ofn points, find the two points that are the farthest apart, i.e., findpi,pjSsuch thatd(pi,pj)=max{d(pk,pl)} ∀pk,plS, whered(p,q)denotes the Euclidean distance betweenpandq.

In two dimensionsO(nlogn)time is both sufficient and necessary in the worst case [66]. It is easy to see that the farthest pair must be extreme points of the convex hull ofS. Once the convex hull is computed, the farthest pair in two dimensions can be found in linear time by observing that it admits a pair of parallel supporting lines. Various attempts, including geometric sampling and parametric search method, have been made to solve this problem in three dimensions. See e.g., [59].

Clarkson and Shor [20] gave a randomized algorithm with an optimal expectedO(nlogn)time.

Later Ramos [67] gave an optimal deterministic algorithm, based on a simplification of the ran- domization scheme of Clarkson and Shor [20], and derandomization making use of the efficient construction of-nets by Matoušek [57].

Problem C2(Smallest enclosing rectangle) Given a setSofnpoints, find the smallest rectangle that encloses the set.

Problem C3(Regression line) Given a setSofnpoints, find a line such that the maximum distance fromSto the line is minimized.

These two problems can be solved in optimal timeO(nlogn)using the convex hull ofS[54] in two dimensions. Inkdimensions Houle et al. [43] gave anO(nk/2+1)time andO(n(k+1)/2)space algorithm. The time complexity is essentially that of computing the convex hull of the point set.

(27)

(e) 13

8 16

17

19 21

23 22 20

26

27 30

(f)

20

13

8 16

17

19 21

23 22

26

27 30

(g) 13 8

16 17

19 21

23 22

26 27

30 (a)

13

8 16

17

19 21

23 22 20

26

27 30

(b)

20

13

8 16

17

19 21

23 22

26

27 30

(c)

13

8 16

17

19 21

23 22 20

26

27 30

(d) 13

8 16

17

19 21

23 22 20

26

27 30

FIGURE 1.7 Update of hull graph.

1.3 Maxima Finding

In this section we discuss a problem concerned with theextremesof a point set which is somewhat related to that of convex hull problems. Consider a setSofnpoints inkin the Cartesian coordinate system. Let (x1(p),x2(p),. . .,xk(p)) denote the coordinates of point pk. Pointp is said to dominate pointq, denotedp q, (orqis dominated byp, denoted q p) ifxi(p)xi(q)for all 1 ≤ ik. A pointpis said to bemaximal(or amaximum) in Sif no point inSdominates p. The maxima-finding problem is that of finding the setM(S)of maximal elements for a setSof points ink.

(28)

Computational Geometry I 1-11

1.3.1 Maxima in Two and Three Dimensions

In two dimensions the problem can be done fairly easily by a plane-sweep technique. (For a more detailed description of plane-sweep technique, see, e.g., [50] or Section 1.5.1) Assume that the set Sof pointsp1,p2,. . .,pnare ordered in nondescending order of theirx-coordinates, i.e.,x(p1)x(p2)≤ · · · ≤x(pn).

We shall scan the points from right to left. The pointpnis necessarily a maximal element. As we scan the points, we maintain the maximumy-coordinate among those that have been scanned so far. Initially, maxy = y(pn). The next pointpi is a maximal element if and only ify(pi) > maxy. Ify(pi) >maxy, thenpiM(S), and maxyis set toy(pi), and we continue. Otherwisepi pjfor somej>i. Thus, after the initial sorting, the set of maxima can be computed in linear time. Note that the set of maximal elements satisfies the property that theirx- andy-coordinates are totally ordered: If they are ordered in strictly ascendingx-coordinate, theiry-coordinates are ordered in strictly descending order.

In three dimensions we can use the same strategy. We will scan the set in descending order of thex-coordinate by a planeP orthogonal to thex-axis. Pointpn as before is a maximal element.

Suppose we have computedM(Si+1), whereSi+1 = {pi+1,. . .,pn}, and we are scanning pointpi. Consider the orthogonal projectionSxi+1of the points inSi+1toP withx=x(pi). We now have an

Y Z

Pi

FIGURE 1.8 Update of max- imal elements.

instance of anon-line2D maximal problem, i.e., for pointpi, ifpxi pxj for somepxjSxi+1, then it is not a maximal element, otherwise it is (pxi denotes the projection of pi onto P). If we maintain the points in M(Sxi+1)as a height-balanced binary search tree in either y- or z-coordinate, then testing whetherpiis maximal or not can be done in logarithmic time. If it is dominated by some point in M(Sxi+1), then it is ignored. Otherwise, it is inM(Sxi+1)(and also inM(Si+1));

M(Sxi+1)will then be updated to beM(Sxi)accordingly. The update may involve deleting points inM(Sxi+1)that are no longer maximal because they are dominated bypxi. Figure 1.8 shows the effect of adding a maximal elementpxi to the setM(Sxi+1)of maximal elements. Points in the shaded area will be deleted. Thus, after the initial sorting, the set of maxima in three dimensions can be computed inO(nlogH)time,

as theon-line2D maximal problem takesO(logH)time to maintainM(Sxi)for each pointpi, where Hdenotes the size ofM(S).

Since the total number of points deleted is at mostn, we conclude the following.

LEMMA 1.1 Given a set ofn points in two and three dimensions, the set of maxima can be computed inO(nlogn)time.

For two and three dimensions one can solve the problem in optimal timeO(nlogH), whereH denotes the size ofM(S). The key observation is that we need notsort Sin its entirety. For instance, in two dimensions one can solve the problem by divide-and-marriage-before-conquest paradigm.

We first use a linear time median finding algorithm to divide the set into two halvesLandRwith points inRhaving largerx-coordinate values than those of points inL. We then recursively compute M(R). Before we recursively computeM(L)we note that points inLthat are dominated by points in M(R)can be eliminated from consideration. We trimLbefore we invoke the algorithm recursively.

That is, we computeM(L)recursively, whereLLconsists of pointsqpfor allpM(R). A careful analysis of the running time shows that the complexity of this algorithm isO(nlogH). For three dimensions we note that other than the initial sorting step, the subsequent plane-sweep step takesO(nlogH)time. It turns out that one can replace the full-fledgedO(nlogn)sorting step with a so-calledlazy sortingofSusing a technique similar to those described in Section 1.2.1 to derive an output-sensitive algorithm.

Références

Documents relatifs

glycolipids that were identified as product D and PGL-tb by TLC and MALDI-TOF analyses (Figure 3 and Figure S2). The presence of product D indicated that the Rv2957 gene carried

ﻥﻴﺘﻴﻵﺍ ﻥﻴﺘﺎﻫ ﻲﻓ ﻰﻨﻌﻤﻟﺍﻭ ّلﻜ ﻪﻤﻠﻌﻴ ﷲﺍ ﻥﻴﺩ ﻥﻤ ﺎﻤﻠﻋ ﻡﺘﻜ ﻥﻤ ، ﻡﻠﻌﻟﺍ ﺀﺍﻭﺴ ﻱﺫﹼﻟﺍ ﻭـﻫ لﻬﺠﻟﺍ ﺩﻀ ﻭﺃ ، ﻤ ﻭﻫ ﺎﻤﻋ لﻴﺩﺒﻟﺍ ﻡﻠﻌﻟﺍ ﺭ ﻓ ﻪـﻨﺍﻭﻟﺃ ﻑـﻠﺘﺨﻤ ﺩﺎﺴﻓ ﻥﻤ ﻊﻗﺍﻭﻟﺍ

We first approximate the non standard semantics by the domain N V c associating to each program point its threads occurrence in the configuration and to each transition label,

Vos historiques publiés sont accessibles à l’ensemble des utilisateurs loggés sur Galaxy (Shared Data / Published Histories). Les historiques partagés sont

5 ( مﻼﻌﺘﺴﻻا : مﺎظﻨﻝا موﻘﻴ ﺎﻨرﺎﺒﺨﺈﺒ دوﻘﻔﻤ وأ فﻝﺎﺘ رﻴودﺘﻝا ، دﻴﻠﺠﺘﻝا ﻲﻓ ﻪﻨﺄﺒ ددﻋ لﻜ فﻗوﻤﺒ.. 5 - ةددﺤﻤ ﺔﻴﻨﻤز ةدﻤ لﻼﺨ ﺔﻨﻴﻌﻤ تﺎﻴرود ﻲﻓ كارﺘﺸﻻا دﻴدﺠﺘ ﺦﻴراوﺘﺒ رﻴرﻘﺘ

Nevertheless, since different cell types have different microtopography preferences, topography patterning can be used to control cell cultures of more than one cell type..

Activation of the Constitutive Androstane Receptor induces hepatic lipogenesis and regulates Pnpla3 gene expression in a LXR-independent way...

We adopt a very simple economic model with only three agents: households allocate their income between consumption and saving; firms produce consumption and capital goods,